saviour 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saviour/integrator.rb +1 -1
- data/lib/saviour/local_storage.rb +1 -1
- data/lib/saviour/s3_storage.rb +4 -1
- data/lib/saviour/version.rb +1 -1
- data/lib/saviour.rb +2 -0
- data/spec/feature/crud_workflows_spec.rb +17 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f139cd5d0f7a94b708562c66d560bd070ad4905
|
4
|
+
data.tar.gz: d1723105df9ab846a9010b7b5eeb8714ab6bcd5f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb57633ae2b99c891564f8331f0630c025385f9f9dc644a0e46c5713be2ac08a6102e4e32189918d5c3983acf0d423ec6f9a0edd0eb991ae2e597985a887842f
|
7
|
+
data.tar.gz: 250807a0557c9683d0a4953cd666b8b54d988377367af5e2383ba93dd1ee09a79ffd649b636cc3dc50731611a96512be958de171923790b0019b37feacac671f
|
data/lib/saviour/integrator.rb
CHANGED
@@ -36,7 +36,7 @@ module Saviour
|
|
36
36
|
new_file = ::Saviour::File.new(uploader_klass, self, attach_as)
|
37
37
|
|
38
38
|
layer = persistence_klass.new(self)
|
39
|
-
new_file.set_path!(layer.read(attach_as))
|
39
|
+
new_file.set_path!(layer.read(attach_as))
|
40
40
|
|
41
41
|
instance_variable_set("@__uploader_#{attach_as}", new_file)
|
42
42
|
end
|
@@ -9,7 +9,7 @@ module Saviour
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def write(contents, path)
|
12
|
-
raise(RuntimeError, "The path you're trying to write already exists!") if @overwrite_protection && exists?(path)
|
12
|
+
raise(RuntimeError, "The path you're trying to write already exists! (#{path})") if @overwrite_protection && exists?(path)
|
13
13
|
|
14
14
|
dir = ::File.dirname(real_path(path))
|
15
15
|
FileUtils.mkdir_p(dir) unless ::File.directory?(dir)
|
data/lib/saviour/s3_storage.rb
CHANGED
data/lib/saviour/version.rb
CHANGED
data/lib/saviour.rb
CHANGED
@@ -140,4 +140,21 @@ describe "saving a new file" do
|
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|
143
|
+
|
144
|
+
describe "dupping" do
|
145
|
+
it "maintains file access" do
|
146
|
+
with_test_file("example.xml") do |example|
|
147
|
+
a = klass.create!
|
148
|
+
a.update_attributes(file: example)
|
149
|
+
|
150
|
+
expect(Saviour::Config.storage.exists?(a[:file])).to be_truthy
|
151
|
+
|
152
|
+
b = a.dup
|
153
|
+
expect(b).to_not be_persisted
|
154
|
+
|
155
|
+
expect(b.file?).to be true
|
156
|
+
expect(b.file.url).to eq a.file.url
|
157
|
+
end
|
158
|
+
end
|
159
|
+
end
|
143
160
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saviour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Campos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
214
|
version: '0'
|
215
215
|
requirements: []
|
216
216
|
rubyforge_project:
|
217
|
-
rubygems_version: 2.5.
|
217
|
+
rubygems_version: 2.5.2
|
218
218
|
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: File storage handler following active record model lifecycle
|