s3 0.3.21 → 0.3.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fb4a11b96fe119fc5b67dd54f1e9418f682c1c4
4
- data.tar.gz: 24eda3309ae8f62742c696e396e45a5ae40ab3c2
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YjM4ZTVkNTRkODZjMWY1MzBmNDU1NDc4YTFjOWI5MzAzM2I4NzhiOA==
5
+ data.tar.gz: !binary |-
6
+ OWVjNTUwZjFiZDU5NzI3NmEwNWFjNWU1YjMzNmVhNWJlOWVhZTZkMA==
5
7
  SHA512:
6
- metadata.gz: 0a36e844ad009eb1602acc425f644beb2b16837f432ee94cfd2b03cbcc717126308817343651b47a3066b7984ed4ab4543391d205c8a79fd6d5020b4383c260a
7
- data.tar.gz: 4fa122a14e36b4f40d2848c0e32e1140f5e2997f790036d8fcd44ab047b965de354fe83b83eadf3a2c7fd1e382b4ec91ef4be023d24d154e1f8a7626717642b6
8
+ metadata.gz: !binary |-
9
+ MmY2MTFlNWFjMjZiM2UzOTA2NTJmZDUxZGM0NzM1YjZhOWZlZmVkMDE3MWIz
10
+ MzhkZjRiZDRiNzFiMDU0ZDZjMDRlNDliMDlkYzZhYWE2YjMzZmVkYzdlZWU0
11
+ OTM4Y2RlZDhmYjhmNWY4MjYwMjI2OGQzMzYzZWYwOGJjMjhkNzM=
12
+ data.tar.gz: !binary |-
13
+ MGU3NzgwOGZlMmUzMzkxMWE0OGEyMmI0Y2I5ZGNjMWVjZDcwZmQwMzkwZTAz
14
+ MGI4ZThjZjA1MWNjM2YwMGJmOWJlYzExNjkzYjFhZDc2OGY4OWRjMzk0NmYw
15
+ MGRiNzVjMDhjOTRjODllYzIwZDIxZmM5YThmNjNjYWIwMjZhMDk=
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.3
4
+ - 2.0.0
5
+ - 2.1
6
+ - 2.2
7
+ sudo: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- s3 (0.3.21)
4
+ s3 (0.3.22)
5
5
  proxies (~> 0.2.0)
6
6
 
7
7
  GEM
@@ -1,8 +1,10 @@
1
1
  = S3
2
2
 
3
+ {<img src="https://travis-ci.org/qoobaa/s3.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/qoobaa/s3]
4
+
3
5
  S3 library provides access to {Amazon's Simple Storage Service}[http://aws.amazon.com/s3/].
4
6
 
5
- It supports both: European and US buckets through the {REST API}[http://docs.amazonwebservices.com/AmazonS3/latest/API/APIRest.html].
7
+ It supports *all* S3 regions through the {REST API}[http://docs.amazonwebservices.com/AmazonS3/latest/API/APIRest.html].
6
8
 
7
9
  == Installation
8
10
 
@@ -92,7 +94,7 @@ This will return hash with all users/groups and theirs permissions
92
94
 
93
95
  ==== Rails 3
94
96
 
95
- To do that you just send file using proper form direct to amazon. You can create simple halper for that, for example like this one: https://gist.github.com/3169039
97
+ To do that you just send file using proper form direct to amazon. You can create simple helper for that, for example like this one: https://gist.github.com/3169039
96
98
 
97
99
  == See also
98
100
 
@@ -227,11 +227,7 @@ module S3
227
227
  end
228
228
 
229
229
  def key_valid?(key)
230
- if (key.nil? or key.empty? or key =~ %r#//#)
231
- false
232
- else
233
- true
234
- end
230
+ !(key.nil? or key.empty?)
235
231
  end
236
232
 
237
233
  def dump_headers
@@ -257,7 +253,9 @@ module S3
257
253
  self.size = response["content-range"].sub(/[^\/]+\//, "").to_i
258
254
  else
259
255
  self.size = response["content-length"]
260
- self.content = response.body
256
+ if body = response.body
257
+ self.content = body
258
+ end
261
259
  end
262
260
  end
263
261
  end
@@ -1,3 +1,3 @@
1
1
  module S3
2
- VERSION = "0.3.21"
2
+ VERSION = "0.3.22"
3
3
  end
@@ -34,7 +34,6 @@ class ObjectTest < Test::Unit::TestCase
34
34
 
35
35
  test "initializing" do
36
36
  assert_raise ArgumentError do S3::Object.send(:new, nil, :key => "") end # should not allow empty key
37
- assert_raise ArgumentError do S3::Object.send(:new, nil, :key => "//") end # should not allow key with double slash
38
37
 
39
38
  assert_nothing_raised do
40
39
  S3::Object.send(:new, nil, :key => "Lena.png")
@@ -68,7 +67,7 @@ class ObjectTest < Test::Unit::TestCase
68
67
  expected = "http://images.s3.amazonaws.com/Lena%20S%C3%B6derberg.png"
69
68
  actual = object12.url
70
69
  assert_equal expected, actual
71
-
70
+
72
71
  object13 = S3::Object.send(:new, bucket1, :key => "Lena Söderberg [1].png")
73
72
  expected = "http://images.s3.amazonaws.com/Lena%20S%C3%B6derberg%20%5B1%5D.png"
74
73
  actual = object13.url
@@ -146,6 +145,19 @@ class ObjectTest < Test::Unit::TestCase
146
145
  assert_equal meta, @object_lena.retrieve.metadata
147
146
  end
148
147
 
148
+ test "retrieve dont set content" do
149
+ @object_lena.send(:remove_instance_variable, :@content)
150
+
151
+ @response_binary.stubs(:body).returns(nil)
152
+ @object_lena.expects(:object_request).with(:head, {}).returns(@response_binary)
153
+ assert @object_lena.retrieve
154
+
155
+ @object_lena.expects(:object_request).with(:get, {}).returns(@response_binary)
156
+ @response_binary.stubs(:body).returns("hello")
157
+
158
+ assert_equal "hello", @object_lena.content
159
+ end
160
+
149
161
  test "exists" do
150
162
  @object_lena.expects(:retrieve).returns(true)
151
163
  assert @object_lena.exists?
metadata CHANGED
@@ -1,94 +1,95 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.21
4
+ version: 0.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kuba Kuźma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: proxies
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mocha
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - ! '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - ! '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: 'S3 library provides access to Amazon''s Simple Storage Service. It supports
84
- both: European and US buckets through REST API.'
83
+ description: ! 'S3 library provides access to Amazon''s Simple Storage Service. It
84
+ supports both: European and US buckets through REST API.'
85
85
  email:
86
86
  - kuba@jah.pl
87
87
  executables: []
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
- - ".gitignore"
91
+ - .gitignore
92
+ - .travis.yml
92
93
  - Gemfile
93
94
  - Gemfile.lock
94
95
  - LICENSE
@@ -123,17 +124,17 @@ require_paths:
123
124
  - lib
124
125
  required_ruby_version: !ruby/object:Gem::Requirement
125
126
  requirements:
126
- - - ">="
127
+ - - ! '>='
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  requirements:
131
- - - ">="
132
+ - - ! '>='
132
133
  - !ruby/object:Gem::Version
133
134
  version: 1.3.6
134
135
  requirements: []
135
136
  rubyforge_project: s3
136
- rubygems_version: 2.2.0
137
+ rubygems_version: 2.4.6
137
138
  signing_key:
138
139
  specification_version: 4
139
140
  summary: Library for accessing S3 objects and buckets