remote_files 3.7.1 → 3.8.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 +4 -4
- data/README.md +15 -1
- data/lib/remote_files/abstract_store.rb +4 -0
- data/lib/remote_files/configuration.rb +8 -4
- data/lib/remote_files/file.rb +5 -1
- data/lib/remote_files/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c39727707288e37ac7c218c24a5cf53610a4218c6a3abd5ad94432097c03f6
|
4
|
+
data.tar.gz: 9d1e38987fc418ef35ce61ccfcced05c0208988f3017bf4c88d0cc1431a5f66d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db8dd61258ac8defadfbf7bac6a00de6e1769df86515424acfdfded8a1dddfc1dcaebbe360ab3eab4627f051898239ee1161d06e386d61c41f8c899549ae31a
|
7
|
+
data.tar.gz: e62152c2b51b08e65a27b5b0cb0c949291773df732d64226e6e8e80b74fe139544553c57f0f384e8dba7d5722d7029c39837e6d0eb6d4b1d8f69df4a2309ffc4
|
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,
|
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
|
@@ -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
|
-
|
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
|
data/lib/remote_files/file.rb
CHANGED
@@ -55,7 +55,11 @@ module RemoteFiles
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def read_write_stores
|
58
|
-
stores.reject
|
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
|
data/lib/remote_files/version.rb
CHANGED
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.
|
4
|
+
version: 3.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mick Staugaard
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
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.
|
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
|