From 4b6a3fcdd032a79e73ad2f1f01906682764af327 Mon Sep 17 00:00:00 2001 From: Vital Ryabchinskiy Date: Wed, 13 Jan 2021 21:09:24 +0000 Subject: [PATCH 1/2] Replace Kernel.open, support Ruby 3 --- .gitignore | 3 ++- lib/refile/s3.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2b05b96..d046d45 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ *.o *.a mkmf.log -s3.yml \ No newline at end of file +s3.yml +.idea diff --git a/lib/refile/s3.rb b/lib/refile/s3.rb index 25187a2..b24940a 100644 --- a/lib/refile/s3.rb +++ b/lib/refile/s3.rb @@ -95,7 +95,7 @@ def initialize(region:, bucket:, max_size: nil, prefix: nil, hasher: Refile::Ran # @param [String] id The id of the file # @return [IO] An IO object containing the file contents verify_id def open(id) - Kernel.open(object(id).presigned_url(:get)) + URI.parse(object(id).presigned_url(:get)).open end # Return the entire contents of the uploaded file as a String. From efc07888fdcf8b9560a240ea4dda29758b17a95c Mon Sep 17 00:00:00 2001 From: Vital Ryabchinskiy Date: Wed, 13 Jan 2021 21:10:40 +0000 Subject: [PATCH 2/2] Bump version --- lib/refile/s3/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/refile/s3/version.rb b/lib/refile/s3/version.rb index a039184..511992f 100644 --- a/lib/refile/s3/version.rb +++ b/lib/refile/s3/version.rb @@ -1,5 +1,5 @@ module Refile class S3 - VERSION = "0.2.0" + VERSION = "0.2.1" end end