saviour 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/saviour/life_cycle.rb +2 -4
- data/lib/saviour/s3_storage.rb +7 -1
- data/lib/saviour/uploader/processors_runner.rb +1 -1
- data/lib/saviour/version.rb +1 -1
- data/saviour.gemspec +2 -1
- data/spec/feature/memory_usage_spec.rb +1 -2
- metadata +23 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94654aa75977e1fc1b51ac4635cf62d99daacfe0c63b94b27132176e1a89b2f8
|
4
|
+
data.tar.gz: 72c77578ddfc92a494b4397a11ee55d5427075158939a3ab82d46fa620dada04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1261335b9ae8af1929e708769cbcb115cb73e05f458241467a8a93124b198cbb1c7e2faec51a70b79dd068cab016277f84d4478d323bd7b83b25419a4a883ef7
|
7
|
+
data.tar.gz: f9012382aacb98104c4e83fe7049c554dad19ee2fae77f6f9524c43b03f4a531ea432fbd615211b0f2c2dcf7fc6669b3cdf2908a653db2e6aac37c6b7c7cc2e6
|
data/.gitignore
CHANGED
data/lib/saviour/life_cycle.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Saviour
|
2
2
|
class LifeCycle
|
3
|
-
SHOULD_USE_INTERLOCK = defined?(Rails)
|
3
|
+
SHOULD_USE_INTERLOCK = defined?(Rails) && !Rails.env.test?
|
4
4
|
|
5
5
|
class FileCreator
|
6
6
|
def initialize(current_path, file, column, connection)
|
@@ -96,9 +96,7 @@ module Saviour
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
-
|
100
|
-
futures.each(&:value!)
|
101
|
-
end
|
99
|
+
futures.each(&:value!)
|
102
100
|
end
|
103
101
|
end
|
104
102
|
|
data/lib/saviour/s3_storage.rb
CHANGED
@@ -3,6 +3,8 @@ begin
|
|
3
3
|
rescue LoadError
|
4
4
|
end
|
5
5
|
|
6
|
+
require 'marcel'
|
7
|
+
|
6
8
|
module Saviour
|
7
9
|
class S3Storage
|
8
10
|
MissingPublicUrlPrefix = Class.new(StandardError)
|
@@ -27,8 +29,12 @@ module Saviour
|
|
27
29
|
raise(KeyTooLarge, "The key in S3 must be at max 1024 bytes, this key is too big: #{path}")
|
28
30
|
end
|
29
31
|
|
32
|
+
mime_type = Marcel::MimeType.for file_or_contents
|
33
|
+
|
30
34
|
# TODO: Use multipart api
|
31
|
-
client.put_object(@create_options.merge(
|
35
|
+
client.put_object(@create_options.merge(
|
36
|
+
body: file_or_contents, bucket: @bucket, key: path, content_type: mime_type
|
37
|
+
))
|
32
38
|
end
|
33
39
|
|
34
40
|
def write_from_file(file, path)
|
data/lib/saviour/version.rb
CHANGED
data/saviour.gemspec
CHANGED
@@ -15,10 +15,11 @@ Gem::Specification.new do |spec|
|
|
15
15
|
|
16
16
|
spec.required_ruby_version = ">= 2.5.0"
|
17
17
|
|
18
|
-
spec.add_dependency "activerecord", ">= 5.1"
|
18
|
+
spec.add_dependency "activerecord", ">= 5.1", "< 7.0.0"
|
19
19
|
spec.add_dependency "activesupport", ">= 5.1"
|
20
20
|
spec.add_dependency "concurrent-ruby", ">= 1.0.5"
|
21
21
|
spec.add_dependency "concurrent-ruby-edge", ">= 0.6.0"
|
22
|
+
spec.add_dependency "marcel", ">= 1.0.0"
|
22
23
|
|
23
24
|
spec.add_development_dependency "bundler"
|
24
25
|
spec.add_development_dependency "rspec"
|
@@ -56,8 +56,7 @@ describe "memory usage" do
|
|
56
56
|
|
57
57
|
a.update! file: f
|
58
58
|
|
59
|
-
|
60
|
-
expect(GetProcessMem.new.mb - base_line).to be < size_to_test / 10
|
59
|
+
expect(GetProcessMem.new.mb - base_line).to be < 3
|
61
60
|
end
|
62
61
|
end
|
63
62
|
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.6.
|
4
|
+
version: 0.6.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Campos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '5.1'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 7.0.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '5.1'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 7.0.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: activesupport
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +72,20 @@ dependencies:
|
|
66
72
|
- - ">="
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: 0.6.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: marcel
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.0.0
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.0.0
|
69
89
|
- !ruby/object:Gem::Dependency
|
70
90
|
name: bundler
|
71
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -255,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
275
|
- !ruby/object:Gem::Version
|
256
276
|
version: '0'
|
257
277
|
requirements: []
|
258
|
-
rubygems_version: 3.
|
278
|
+
rubygems_version: 3.1.6
|
259
279
|
signing_key:
|
260
280
|
specification_version: 4
|
261
281
|
summary: File storage handler following active record model lifecycle
|