bucket_store 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c812fe38b957031d6fae686c11a3e615ac5a2575b563ebf96b8f0a019513d363
4
- data.tar.gz: 3165a65032fc35ca76ed983a7477f0cb1a13de62d1f2b68ad6cb24e4622a0eb4
3
+ metadata.gz: e251b7658b3f9e155f3e9e329d2022e6f4791e502de43bba2b8a0563634ba499
4
+ data.tar.gz: f66fbec21d4a07e2ff0feb0ad45383eccb71daa13d733cc92f2a0ae54d6cd9f4
5
5
  SHA512:
6
- metadata.gz: 3be0d30f1857185217c5f3b461809bf436ca2306426791af4051a2c725229d246d272ffd85aaef90792102e59c8100e66422f9c43ab9354cfb01ab4b7971e6fe
7
- data.tar.gz: 9ea6b6baadf89e29b0b74d00a9ca5c743088c50d75c1867348ba48ce14ac304160f205b881747ccf4f54b3dc50f631e27f2042443e2ffbfc69913e4f1703bbb2
6
+ metadata.gz: cb3aeab11c33767d349fb4c7efe744000c9a129131cfff3054c308de7971da12e1ea3c32fafeaa8722ddf07049d4e2f0e1cf6ba85b24d6c997ac1f3fe4eb14af
7
+ data.tar.gz: 5f2d1e70e8f0bc27ccfbf998ec3c4e1c89fb9ed0e179b8b2a808a7345bf4cda38dcc45fbadc842a142a0eb42d51fdb44247159c1fe58f5717cf302a6145ecff3
data/README.md CHANGED
@@ -13,7 +13,7 @@ in the given provider. A valid key example would be
13
13
  This library is distributed as a Ruby gem, and we recommend adding it to your Gemfile:
14
14
 
15
15
  ```ruby
16
- gem "bucket-store"
16
+ gem "bucket_store"
17
17
  ```
18
18
 
19
19
  Some attributes can be configured via `BucketStore.configure`. If using Rails, you want to
@@ -162,6 +162,6 @@ BucketStore.for("inmemory://bucket/path/file.xml").delete!
162
162
  ## License & Contributing
163
163
 
164
164
  * BucketStore is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
165
- * Bug reports and pull requests are welcome on GitHub at https://github.com/gocardless/file-storage.
165
+ * Bug reports and pull requests are welcome on GitHub at https://github.com/gocardless/bucket-store.
166
166
 
167
167
  GoCardless ♥ open source. If you do too, come [join us](https://gocardless.com/about/careers/).
@@ -143,6 +143,19 @@ module BucketStore
143
143
  true
144
144
  end
145
145
 
146
+ # Checks if the given key exists.
147
+ #
148
+ # This will only return true when the `key` exactly matches an object within the bucket
149
+ # and conversely it will return false when `key` matches an internal path to an object.
150
+ # For example if the bucket has a key named `prefix/file.txt`, it will only return
151
+ # `true` when `exists?` is called on `prefix/file.txt`. Any other combination
152
+ # (`prefix/`, `prefix/file`) will instead return `false`.
153
+ #
154
+ # @return [bool] `true` if the given key exists, `false` if not
155
+ def exists?
156
+ list.first == "#{adapter_type}://#{bucket}/#{key}"
157
+ end
158
+
146
159
  private
147
160
 
148
161
  attr_reader :adapter
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BucketStore
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bucket_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2021-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1'
19
+ version: '1.104'
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
- version: '1'
26
+ version: '1.104'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: google-cloud-storage
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.31'
33
+ version: '1.34'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '1.31'
40
+ version: '1.34'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: gc_ruboconfig
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '2.5'
139
139
  description: " A helper library to access cloud storage services such as Google
140
- Cloud Storage.\n"
140
+ Cloud Storage or S3.\n"
141
141
  email:
142
142
  - engineering@gocardless.com
143
143
  executables: []
@@ -156,7 +156,7 @@ files:
156
156
  - lib/bucket_store/timing.rb
157
157
  - lib/bucket_store/uri_builder.rb
158
158
  - lib/bucket_store/version.rb
159
- homepage: https://github.com/gocardless/file-storage
159
+ homepage: https://github.com/gocardless/bucket-store
160
160
  licenses:
161
161
  - MIT
162
162
  metadata: {}