remote_files 3.7.1 → 3.8.0.pre.1

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
  SHA256:
3
- metadata.gz: a90a9e0a3a68597fe4d197f4be6174047576b74976f905f73f67e23c16da9ff5
4
- data.tar.gz: f6abff5b286292c9e2ea078299cad33cf4d0e7edc6f6f742bf22fe2414c2098b
3
+ metadata.gz: 60ccff05ac3537fbcb60f5fb2e1b900cc0f88e191598bfc208efce1f717c8f5a
4
+ data.tar.gz: c9fafbed33eee35177df55c548c13c4799037e8ef0b9e30aab814d4db67d6781
5
5
  SHA512:
6
- metadata.gz: e188cdfee5667846fbaa221feb40380e1a98d337985ba2e68c4a884ba82c4c1aaaf1073f75eb8d4165a8954f7c2db4b928fd52bae2dcdbd9fd20e13dcc96d092
7
- data.tar.gz: 600721b36f2a2f0dec4536009da8d24089757671930e786d58b8d9fcda823e464e610c57bcb573fe23331f6153f178d47339ee3472e94b4920b82564c81b331c
6
+ metadata.gz: aefd4a5087bc7633f2683230f643ec5ade8fc1904d46fd9c0023a42a9a57f6ebebe24904e0d3422d0cc21fd999526e003a4f75ea772f9d06f76f71bc1a220b59
7
+ data.tar.gz: 85afca8032f05bb4da1b7afbf4946e7b6bfe1848fdcc2840b8754130873cc4e6dca45bf986060d84d76f32f741ac8c3bd02ef2038c973555916a18433e3f2482
data/README.md CHANGED
@@ -65,7 +65,7 @@ file.store!
65
65
  This will store the file on one of the stores and then asynchronously copy the file to the remaining stores.
66
66
  `RemoteFiles::File#store!` will raise a `RemoteFiles::Error` if all storage backends are down.
67
67
 
68
- If you just need to store the file in a single store, the you can use `RemoteFiles::File#store_once!`. It will
68
+ If you just need to store the file in a single store, then you can use `RemoteFiles::File#store_once!`. It will
69
69
  behave exactly like `RemoteFiles::File#store!`, but will not asynchronously copy the file to the other stores.
70
70
 
71
71
  ## Copyright and license
@@ -79,6 +79,20 @@ http://www.apache.org/licenses/LICENSE-2.0
79
79
 
80
80
  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
81
81
 
82
+ ### Releasing a new version
83
+ A new version is published to RubyGems.org every time a change to `version.rb` is pushed to the `main` branch.
84
+ In short, follow these steps:
85
+ 1. Update `version.rb`,
86
+ 2. merge this change into `main`, and
87
+ 3. look at [the action](https://github.com/zendesk/remote_files/actions/workflows/publish.yml) for output.
88
+
89
+ To create a pre-release from a non-main branch:
90
+ 1. change the version in `version.rb` to something like `1.2.0.pre.1` or `2.0.0.beta.2`,
91
+ 2. push this change to your branch,
92
+ 3. go to [Actions → “Publish to RubyGems.org” on GitHub](https://github.com/zendesk/remote_files/actions/workflows/publish.yml),
93
+ 4. click the “Run workflow” button,
94
+ 5. pick your branch from a dropdown.
95
+
82
96
  ## Contributing
83
97
 
84
98
  1. Fork it
@@ -54,6 +54,10 @@ module RemoteFiles
54
54
  options[:read_only] == true
55
55
  end
56
56
 
57
+ def read_delete_only?
58
+ options[:read_delete_only] == true
59
+ end
60
+
57
61
  def file_from_url(url, options = {})
58
62
  matched = url_matcher.match(url)
59
63
 
@@ -57,7 +57,11 @@ module RemoteFiles
57
57
  store = (options[:class] || FogStore).new(store_identifier)
58
58
  block.call(store) if block_given?
59
59
 
60
- store[:read_only] = options[:read_only] if options.key?(:read_only)
60
+ if options[:read_delete_only]
61
+ store[:read_delete_only] = true
62
+ elsif options[:read_only]
63
+ store[:read_only] = true
64
+ end
61
65
 
62
66
  if options[:primary]
63
67
  @stores.unshift(store)
@@ -83,7 +87,7 @@ module RemoteFiles
83
87
  end
84
88
 
85
89
  def read_write_stores
86
- stores.reject {|s| s.read_only?}
90
+ stores.reject {|s| s.read_only? || s.read_delete_only?}
87
91
  end
88
92
 
89
93
  def lookup_store(store_identifier)
@@ -130,7 +134,7 @@ module RemoteFiles
130
134
 
131
135
  def delete_now!(file, parallel: false)
132
136
  exceptions = []
133
- stores = file.read_write_stores
137
+ stores = file.read_write_stores + file.read_delete_only_stores
134
138
 
135
139
  raise "No stores configured" if stores.empty?
136
140
 
@@ -178,7 +182,7 @@ module RemoteFiles
178
182
 
179
183
  def synchronize!(file)
180
184
  file.missing_stores.each do |store|
181
- next if store.read_only?
185
+ next if store.read_only? || store.read_delete_only?
182
186
 
183
187
  store.store!(file)
184
188
  file.stored_in << store.identifier
@@ -55,7 +55,11 @@ module RemoteFiles
55
55
  end
56
56
 
57
57
  def read_write_stores
58
- stores.reject(&:read_only?)
58
+ stores.reject {|s| s.read_only? || s.read_delete_only? }
59
+ end
60
+
61
+ def read_delete_only_stores
62
+ stores.select(&:read_delete_only?)
59
63
  end
60
64
 
61
65
  def missing_stores
@@ -1,3 +1,3 @@
1
1
  module RemoteFiles
2
- VERSION = '3.7.1'
2
+ VERSION = '3.8.0.pre.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remote_files
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.8.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-22 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: fog-aws
@@ -75,7 +74,6 @@ homepage: https://github.com/zendesk/remote_files
75
74
  licenses:
76
75
  - Apache-2.0
77
76
  metadata: {}
78
- post_install_message:
79
77
  rdoc_options: []
80
78
  require_paths:
81
79
  - lib
@@ -90,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
88
  - !ruby/object:Gem::Version
91
89
  version: '0'
92
90
  requirements: []
93
- rubygems_version: 3.5.22
94
- signing_key:
91
+ rubygems_version: 3.6.7
95
92
  specification_version: 4
96
93
  summary: The purpose of the library is to implement a simple interface for uploading
97
94
  files to multiple backends and to keep the backends in sync, so that your app will