saviour 0.6.5 → 0.6.6

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: 8bca4d3cff0e6279633cfffc29a4d773766027a10cdf78476779184d9f280d00
4
- data.tar.gz: d386ff08897ea1241edad2f320e9c37e6384150a0f784cad9094156393f8722c
3
+ metadata.gz: e01220554bae6d136bace3b491f366aa5e5f8a8e6b853b1d19f5fe2ee194f7ac
4
+ data.tar.gz: cce3bf80da5aad0f7056422f9e30d9595f5c2b597f899346f09f0b615e0c5ce3
5
5
  SHA512:
6
- metadata.gz: d1488dfc1fc68bc7039d8bc37157002e0fb55e1f5acac50cdfa0f3f3c4abd02b56b06fd0688e1c7c686e949929a1c86878742698dc27c3dc4925d37aa3c37a83
7
- data.tar.gz: 79612867403b5856c642fdd69297f31e13006b08d9f998480b8f006e64d36f7555b699f44baaf0fc360fb811ff507157b08ca6ae2644c0b7571a2c92fafa442e
6
+ metadata.gz: 0b9b2682ffb7d3584853b3cb3ceca37cbae5f95a9802eabbe5d3df80a5de79810dbb3f26e5cb29fdfcf2acb128a9cd8d9f459458e0dc43bf93c47ec1274af303
7
+ data.tar.gz: 0a94d1526dcbb231bb27feb1b47cd913dd668ee127e6ce41961a67d2cd14ff646a7f52b856d5dc2b2758c1e3ca59b12473f2a8b9227c5c1078d17cd860a90bbe
@@ -49,7 +49,7 @@ module Saviour
49
49
  end
50
50
 
51
51
  @new_path = @file.write(
52
- before_write: ->(path) { dup_file.call if @current_path == path }
52
+ before_write: ->(path) { dup_file.call if @current_path == path }
53
53
  )
54
54
 
55
55
  return unless @new_path
@@ -124,17 +124,18 @@ module Saviour
124
124
  next unless @model.send(column).changed?
125
125
 
126
126
  klass.new(
127
- persistence_layer.read(column),
128
- @model.send(column),
129
- column,
130
- ActiveRecord::Base.connection
127
+ persistence_layer.read(column),
128
+ @model.send(column),
129
+ column,
130
+ ActiveRecord::Base.connection
131
131
  )
132
132
  end.compact
133
133
 
134
134
  pool = Concurrent::FixedThreadPool.new(Saviour::Config.concurrent_workers)
135
+
135
136
  futures = uploaders.map { |uploader|
136
137
  Concurrent::Future.execute(executor: pool) {
137
- if defined?(Rails)
138
+ if defined?(Rails) && Rails::VERSION::MAJOR < 6
138
139
  Rails.application.executor.wrap { uploader.upload }
139
140
  else
140
141
  uploader.upload
@@ -142,13 +143,19 @@ module Saviour
142
143
  }
143
144
  }
144
145
 
145
- result = ActiveSupport::Dependencies.interlock.permit_concurrent_loads do
146
+ work = -> {
146
147
  futures.map do |x|
147
148
  x.value.tap do
148
149
  raise(x.reason) if x.rejected?
149
150
  end
150
151
  end.compact
151
- end
152
+ }
153
+
154
+ result = if defined?(Rails) && Rails::VERSION::MAJOR < 6
155
+ ActiveSupport::Dependencies.interlock.permit_concurrent_loads(&work)
156
+ else
157
+ work.call
158
+ end
152
159
 
153
160
  pool.shutdown
154
161
  pool.wait_for_termination
@@ -1,3 +1,3 @@
1
1
  module Saviour
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  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.5
4
+ version: 0.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roger Campos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2019-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord