has_bucket 0.0.2 → 0.0.3

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: eb33066de7c4c4ff573e521b6f221158f1716611
4
- data.tar.gz: 1b86a76ba5bb31a1df5cc2b38c4e2c38c83115fa
3
+ metadata.gz: ec7ea7ae46b38236a052c4ba78c19bb29d8344c2
4
+ data.tar.gz: b92d96e8b5e6f07679ca447cd9f8e4ca40b75a72
5
5
  SHA512:
6
- metadata.gz: 78aa24e9dc6dfdf75344268f5562f5ad91212fc489e4f0f76da511aab5b855062f3f6063832cfe1f436802a505006ee27291609c8e8663cdf446718545c191f7
7
- data.tar.gz: a3c16494024f7228711d47679ff0d8c9b82c513c892132365616aabddd2d2e7750b87a0d5f350391f3a69b7cc65fb1e28e66ac8f2dbdf7f85291b19325f2adef
6
+ metadata.gz: 31490558e3bafb25eb4afae3d87a8d3e9c917219d208b305d3564267812f5df9ee916e102cc9f1f2d0df04cad7bd05f8408f4aabf740807375f8feb420ddce45
7
+ data.tar.gz: 87b2561613ca600d1ad8e5d45987971c962f5ff10d71f1a6921fe0956efe00d55cf8026b30eaa4042c313a3e7d7351f75762329b167a3225797f9974751d55bc
@@ -13,6 +13,10 @@ module HasBucket
13
13
  object(key).exists?
14
14
  end
15
15
 
16
+ def object_keys
17
+ bucket.objects.map(&:key)
18
+ end
19
+
16
20
  def prefixed_with(prefix)
17
21
  bucket.objects(prefix: prefix).map(&:key)
18
22
  end
@@ -1,3 +1,3 @@
1
1
  module HasBucket
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -0,0 +1,212 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: https://s3.amazonaws.com/jma-2014-test-bucket/other/bar
6
+ body:
7
+ encoding: UTF-8
8
+ string: bar
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ X-Amz-Acl:
17
+ - private
18
+ X-Amz-Storage-Class:
19
+ - STANDARD
20
+ Content-Type:
21
+ - application/octet-stream
22
+ Content-Length:
23
+ - '3'
24
+ Date:
25
+ - Thu, 05 Feb 2015 05:33:10 GMT
26
+ Content-Md5:
27
+ - N7UdGUp1E+RbVvZSTy1R8g==
28
+ Authorization:
29
+ - AWS AKIAICVNTIM4AWNLWR4Q:otoyWlTFVrtqX1c+f+9dhURnXTQ=
30
+ response:
31
+ status:
32
+ code: 200
33
+ message: OK
34
+ headers:
35
+ X-Amz-Id-2:
36
+ - X70wBT5hMcI6AZN3WcY3vI9YivxVPR3bJ24cCZKY5unU+kZsvKsYm+NgPif6QS3z
37
+ X-Amz-Request-Id:
38
+ - 12EF462DC17AE60D
39
+ Date:
40
+ - Thu, 05 Feb 2015 05:33:12 GMT
41
+ Etag:
42
+ - '"37b51d194a7513e45b56f6524f2d51f2"'
43
+ Content-Length:
44
+ - '0'
45
+ Server:
46
+ - AmazonS3
47
+ body:
48
+ encoding: UTF-8
49
+ string: ''
50
+ http_version:
51
+ recorded_at: Thu, 05 Feb 2015 05:33:10 GMT
52
+ - request:
53
+ method: put
54
+ uri: https://s3.amazonaws.com/jma-2014-test-bucket/foo/bar
55
+ body:
56
+ encoding: UTF-8
57
+ string: bar
58
+ headers:
59
+ Accept-Encoding:
60
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
61
+ Accept:
62
+ - "*/*"
63
+ User-Agent:
64
+ - Ruby
65
+ X-Amz-Acl:
66
+ - private
67
+ X-Amz-Storage-Class:
68
+ - STANDARD
69
+ Content-Type:
70
+ - application/octet-stream
71
+ Content-Length:
72
+ - '3'
73
+ Date:
74
+ - Thu, 05 Feb 2015 05:33:10 GMT
75
+ Content-Md5:
76
+ - N7UdGUp1E+RbVvZSTy1R8g==
77
+ Authorization:
78
+ - AWS AKIAICVNTIM4AWNLWR4Q:BgaDrXq33tmfqcEsIfnkEclXm9k=
79
+ response:
80
+ status:
81
+ code: 200
82
+ message: OK
83
+ headers:
84
+ X-Amz-Id-2:
85
+ - gb3zxwkIkWVc4EJpcmG7KhhSw6wJt3E0zHPz0RSBCFsU8AiBcwH0Lzz6KU7piZG7
86
+ X-Amz-Request-Id:
87
+ - EA2B758A6EE9EB13
88
+ Date:
89
+ - Thu, 05 Feb 2015 05:33:13 GMT
90
+ Etag:
91
+ - '"37b51d194a7513e45b56f6524f2d51f2"'
92
+ Content-Length:
93
+ - '0'
94
+ Server:
95
+ - AmazonS3
96
+ body:
97
+ encoding: UTF-8
98
+ string: ''
99
+ http_version:
100
+ recorded_at: Thu, 05 Feb 2015 05:33:10 GMT
101
+ - request:
102
+ method: get
103
+ uri: https://s3.amazonaws.com/jma-2014-test-bucket/
104
+ body:
105
+ encoding: US-ASCII
106
+ string: ''
107
+ headers:
108
+ Accept-Encoding:
109
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
110
+ Accept:
111
+ - "*/*"
112
+ User-Agent:
113
+ - Ruby
114
+ Date:
115
+ - Thu, 05 Feb 2015 05:33:10 GMT
116
+ Authorization:
117
+ - AWS AKIAICVNTIM4AWNLWR4Q:m5Vs2OFN1BBRBWpHuWbRuS8Zvpc=
118
+ response:
119
+ status:
120
+ code: 200
121
+ message: OK
122
+ headers:
123
+ X-Amz-Id-2:
124
+ - yj2ehoAoFIhj6FWpy6uCK2cshKRDRarjEGNUtFO6mCOWWZMvjG6ZvjtMqzPCfnva
125
+ X-Amz-Request-Id:
126
+ - 512DECCADABCFDC4
127
+ Date:
128
+ - Thu, 05 Feb 2015 05:33:14 GMT
129
+ Content-Type:
130
+ - application/xml
131
+ Transfer-Encoding:
132
+ - chunked
133
+ Server:
134
+ - AmazonS3
135
+ body:
136
+ encoding: UTF-8
137
+ string: |-
138
+ <?xml version="1.0" encoding="UTF-8"?>
139
+ <ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Name>jma-2014-test-bucket</Name><Prefix></Prefix><Marker></Marker><MaxKeys>1000</MaxKeys><IsTruncated>false</IsTruncated><Contents><Key>foo/bar</Key><LastModified>2015-02-05T05:33:13.000Z</LastModified><ETag>&quot;37b51d194a7513e45b56f6524f2d51f2&quot;</ETag><Size>3</Size><Owner><ID>5d307ea628ee26d90fe9b4b8500d17671fd927387d7d746ba636af2808b85e6a</ID><DisplayName>jma</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents><Contents><Key>other/bar</Key><LastModified>2015-02-05T05:33:12.000Z</LastModified><ETag>&quot;37b51d194a7513e45b56f6524f2d51f2&quot;</ETag><Size>3</Size><Owner><ID>5d307ea628ee26d90fe9b4b8500d17671fd927387d7d746ba636af2808b85e6a</ID><DisplayName>jma</DisplayName></Owner><StorageClass>STANDARD</StorageClass></Contents></ListBucketResult>
140
+ http_version:
141
+ recorded_at: Thu, 05 Feb 2015 05:33:10 GMT
142
+ - request:
143
+ method: delete
144
+ uri: https://s3.amazonaws.com/jma-2014-test-bucket/other/bar
145
+ body:
146
+ encoding: US-ASCII
147
+ string: ''
148
+ headers:
149
+ Accept-Encoding:
150
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
151
+ Accept:
152
+ - "*/*"
153
+ User-Agent:
154
+ - Ruby
155
+ Date:
156
+ - Thu, 05 Feb 2015 05:33:10 GMT
157
+ Authorization:
158
+ - AWS AKIAICVNTIM4AWNLWR4Q:pGtrqR35WDpohyBgUMoGWZK0A9Q=
159
+ response:
160
+ status:
161
+ code: 204
162
+ message: No Content
163
+ headers:
164
+ X-Amz-Id-2:
165
+ - SnFA1ekLIQT8i5g2W6tR7UuHxiq0RQfQqTBllic4T+4k5LCOjIWcO/Kw2GZqYut9
166
+ X-Amz-Request-Id:
167
+ - 27B6A7C588FF95AF
168
+ Date:
169
+ - Thu, 05 Feb 2015 05:33:15 GMT
170
+ Server:
171
+ - AmazonS3
172
+ body:
173
+ encoding: UTF-8
174
+ string: ''
175
+ http_version:
176
+ recorded_at: Thu, 05 Feb 2015 05:33:10 GMT
177
+ - request:
178
+ method: delete
179
+ uri: https://s3.amazonaws.com/jma-2014-test-bucket/foo/bar
180
+ body:
181
+ encoding: US-ASCII
182
+ string: ''
183
+ headers:
184
+ Accept-Encoding:
185
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
186
+ Accept:
187
+ - "*/*"
188
+ User-Agent:
189
+ - Ruby
190
+ Date:
191
+ - Thu, 05 Feb 2015 05:33:10 GMT
192
+ Authorization:
193
+ - AWS AKIAICVNTIM4AWNLWR4Q:VjH3wmbd3Ztu8koH8D6s9hgMjJ0=
194
+ response:
195
+ status:
196
+ code: 204
197
+ message: No Content
198
+ headers:
199
+ X-Amz-Id-2:
200
+ - jju19oNwfHbubf+Af19VBi5x6/cYmY4Zhdb0tr+++FpE5CmiEfMktfWcDabp4lSz
201
+ X-Amz-Request-Id:
202
+ - A56B0FF335F44668
203
+ Date:
204
+ - Thu, 05 Feb 2015 05:33:16 GMT
205
+ Server:
206
+ - AmazonS3
207
+ body:
208
+ encoding: UTF-8
209
+ string: ''
210
+ http_version:
211
+ recorded_at: Thu, 05 Feb 2015 05:33:10 GMT
212
+ recorded_with: VCR 2.9.3
@@ -44,4 +44,17 @@ describe HasBucket do
44
44
  subject.delete "foo/bar"
45
45
  subject.delete "foo/baz"
46
46
  end
47
+
48
+ it "#object_keys should return all object keys", :vcr do
49
+ subject["other/bar"] = "bar"
50
+ subject["foo/bar"] = "bar"
51
+
52
+ expect(subject.object_keys).to eq %w(
53
+ foo/bar
54
+ other/bar
55
+ )
56
+
57
+ subject.delete "other/bar"
58
+ subject.delete "foo/bar"
59
+ end
47
60
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_bucket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathon M. Abbott
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2015-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uri_config
@@ -156,6 +156,7 @@ files:
156
156
  - lib/has_bucket/facade.rb
157
157
  - lib/has_bucket/s3_config.rb
158
158
  - lib/has_bucket/version.rb
159
+ - spec/cassettes/HasBucket/_object_keys_should_return_all_object_keys.yml
159
160
  - spec/cassettes/HasBucket/_prefixed_with_should_allow_for_directory-like_keys.yml
160
161
  - spec/cassettes/HasBucket/should_allow_storage_of_blobs_on_S3.yml
161
162
  - spec/has_bucket_spec.rb
@@ -185,6 +186,7 @@ signing_key:
185
186
  specification_version: 4
186
187
  summary: i has an S3 bucket
187
188
  test_files:
189
+ - spec/cassettes/HasBucket/_object_keys_should_return_all_object_keys.yml
188
190
  - spec/cassettes/HasBucket/_prefixed_with_should_allow_for_directory-like_keys.yml
189
191
  - spec/cassettes/HasBucket/should_allow_storage_of_blobs_on_S3.yml
190
192
  - spec/has_bucket_spec.rb