lib/io_streams/s3/reader.rb in iostreams-0.17.0 vs lib/io_streams/s3/reader.rb in iostreams-0.17.1
- old
+ new
@@ -3,9 +3,11 @@
class Reader
# Read from a AWS S3 file
def self.open(uri, region: nil, **args, &block)
raise(ArgumentError, 'file_name must be a URI string') unless uri.is_a?(String)
+ IOStreams::S3.load_dependencies
+
s3 = region.nil? ? Aws::S3::Resource.new : Aws::S3::Resource.new(region: region)
options = IOStreams::S3.parse_uri(uri)
object = s3.bucket(options[:bucket]).object(options[:key])
begin