open-uri-s3 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/open-uri-s3.rb +7 -6
- data/open-uri-s3.gemspec +2 -2
- data/spec/lib/open-uri-s3_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 173a6d9e73fff6d19915a376e1afa06cf1ca3104
|
4
|
+
data.tar.gz: ac7354c002aaa90e3df0fb3b1094f521a3514c9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 019e2867e6e0929cba03330e18d3150f5f10fac051c4bf4733c7d5fbbe4a312154333ea5ab5f2d3058d2ff55274d0b0b295fc17e52332fe4747d9478ae2b29de
|
7
|
+
data.tar.gz: 905c19d72cd9199c8f766bdd20d0083c606f1d030f508f144723d83b040a5dac3b443f410bf5ac682b7be07b9af292eb1c467c240ff0d5016c2dda71c563a584
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/lib/open-uri-s3.rb
CHANGED
@@ -7,15 +7,16 @@ module URI
|
|
7
7
|
|
8
8
|
# @return [Aws::S3::Object] S3 object (quacks like IO)
|
9
9
|
def open(*args)
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
client = Aws::S3::Client.new
|
11
|
+
bucket_location = client.get_bucket_location(bucket: self.hostname)
|
12
|
+
location_constraint = bucket_location.data.location_constraint
|
13
|
+
|
14
|
+
if !location_constraint.empty?
|
15
|
+
client = Aws::S3::Client.new(region: location_constraint)
|
15
16
|
end
|
16
17
|
|
17
18
|
path = self.path[1..-1]
|
18
|
-
object = bucket.
|
19
|
+
object = client.get_object(bucket: self.hostname, key: path).body
|
19
20
|
|
20
21
|
if block_given?
|
21
22
|
yield object
|
data/open-uri-s3.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "open-uri-s3"
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Erik Terpstra"]
|
12
|
-
s.date = "2015-11-
|
12
|
+
s.date = "2015-11-24"
|
13
13
|
s.description = "AWS S3 protocol support for open-uri"
|
14
14
|
s.email = "erterpstra@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open-uri-s3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Terpstra
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|