open-uri-s3 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 818e0f417de91f2ff326399a1a07e9d1b7a5c822
4
- data.tar.gz: 8db7c78d571007f1fcb263e6d97bdbbdb52b84fc
3
+ metadata.gz: 3f5f989aeebc0501484187b9192d8d88137d5a7c
4
+ data.tar.gz: e0f986766169093e492df81ca0fb157857f4a7ac
5
5
  SHA512:
6
- metadata.gz: 9792b83ea026bb21d428fda3aeba0b4af5190cbbb4083dfb80273cb0e0bbedaad7f8f4eb9c86773e9045b98ded597c69c65413087e8635fb474749d04f4ee85d
7
- data.tar.gz: e181494ace6718df65f0e0d6e62e06e7e2fca4b8b9875b682da917db825bae669b9cc271cb9ce4a64717293ecab139a4aab0de7b900282c67fe93ce173e1077d
6
+ metadata.gz: 33e7503385f120c4c2f729fcced76391824e59223a52e2431305cd17dc2f1032814f7d9a615e8c5a85ddbc0e29ae1fa9021637ab4354b1b42ce68a5618985713
7
+ data.tar.gz: 84957564dfa526ee31fa1cd1455dfa3cd51ac681f87234109bbd264d76687f0b6b578535ce86745aac321da49d5bffecd57e5efdfe2a0c2110242842eedb0074
data/README.md CHANGED
@@ -24,6 +24,15 @@ Writing objects:
24
24
  open('s3://my.bucket/public/hello', 'w'){|f| f.write 'Hello world!'}
25
25
  ```
26
26
 
27
+ ## Using a different (non-aws) backend
28
+
29
+ In order to use a different s3 compatible backend, you can use the following ENV variables
30
+
31
+ ```
32
+ ENV['AWS_USE_SSL'] = 'false'
33
+ ENV['AWS_S3_ENDPOINT'] = 'http://my-s3-alternative'
34
+ ```
35
+
27
36
  ## Contributing to open-uri-s3
28
37
 
29
38
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.0
1
+ 1.6.0
@@ -7,11 +7,19 @@ module URI
7
7
 
8
8
  # @return [AWS::S3::S3Object] S3 object (quacks like IO)
9
9
  def open(*args)
10
- s3 = ::AWS::S3.new
10
+ options = {}
11
+ options[:use_ssl] = false if ENV['AWS_USE_SSL'] == 'false'
12
+ if ENV["AWS_S3_ENDPOINT"]
13
+ s3_endpoint_uri = URI(ENV['AWS_S3_ENDPOINT'])
14
+ AWS.config(s3_endpoint: s3_endpoint_uri.host, s3_port: s3_endpoint_uri.port)
15
+ end
16
+
17
+ s3 = ::AWS::S3.new(options)
11
18
  bucket = s3.buckets[self.hostname]
12
- if bucket.location_constraint
13
- s3 = ::AWS::S3.new(s3_endpoint: "s3-#{bucket.location_constraint}.amazonaws.com")
14
- bucket = s3.buckets[self.hostname]
19
+ if !ENV['AWS_S3_ENDPOINT'] && bucket.location_constraint
20
+ s3_endpoint = "s3-#{bucket.location_constraint}.amazonaws.com"
21
+ s3 = ::AWS::S3.new(options.update(s3_endpoint: s3_endpoint))
22
+ bucket = s3.buckets[self.hostname]
15
23
  end
16
24
 
17
25
  path = self.path[1..-1]
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: open-uri-s3 1.6.0 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "open-uri-s3"
8
- s.version = "1.5.0"
9
+ s.version = "1.6.0"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Erik Terpstra"]
12
- s.date = "2015-11-27"
14
+ s.date = "2016-04-23"
13
15
  s.description = "AWS S3 protocol support for open-uri"
14
16
  s.email = "erterpstra@gmail.com"
15
17
  s.extra_rdoc_files = [
@@ -30,8 +32,7 @@ Gem::Specification.new do |s|
30
32
  ]
31
33
  s.homepage = "http://github.com/eterps/open-uri-s3"
32
34
  s.licenses = ["MIT"]
33
- s.require_paths = ["lib"]
34
- s.rubygems_version = "2.0.14"
35
+ s.rubygems_version = "2.4.8"
35
36
  s.summary = "AWS S3 protocol support for open-uri"
36
37
 
37
38
  if s.respond_to? :specification_version then
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.5.0
4
+ version: 1.6.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-27 00:00:00.000000000 Z
11
+ date: 2016-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  requirements: []
134
134
  rubyforge_project:
135
- rubygems_version: 2.0.14
135
+ rubygems_version: 2.4.8
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: AWS S3 protocol support for open-uri