carrierwave_backgrounder 1.0.1 → 1.0.2

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: f6e8ff06c13487a9d2cc4b62f2384e664f5071890b2ab3f84c8c4af51fe1d3aa
4
- data.tar.gz: 2bc907bba296cf9c7a9007ca4a345911def1c88a3e1d6646c1a3dbd998598e3b
3
+ metadata.gz: 9db3ebd17e2fba8538ee90f3f451f6d37738a9d833bc5ac9f6f8123a3f7a214a
4
+ data.tar.gz: 3ef48ab1f8ac80b9ea3e374fd4806b769927baec00cc8c6d7a19b9340cebe906
5
5
  SHA512:
6
- metadata.gz: 1129e8d192664e21f53a20b5ad3de4801c363bdaab8bb15e4b009b2f20f178631c1b731587686e2c70ea42723f57e6cea3de16a1154cc57d81e394194b58a6b5
7
- data.tar.gz: add77ebea2c899b22c6ed8d8047b83286372adc360a7bd46b394f653d9e28d9dc24d9367067e5573765af99bbc41e467ee1b0c9f30aed009b20148a8df601248
6
+ metadata.gz: 67965fc212f3fa08aa5936815b63a63215550780e2150759d6dc8d87683ca7be2d5614f8d7ba9b93a22e4c1537e6db9fcffb938649708e2e42508bb868835062
7
+ data.tar.gz: 20c1a3d50441f061701e8ada2af4b2b26706794496f71fa707ff865338358c834ede9de39369e2448b39c149a9cfb6f8528f8a7daa126c3f51a4e7bc1767fe81
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.0.2
2
+
3
+ ### bugfixes
4
+ * [#317] Fixed an issue where #process_in_backfground would copy files but not create versions [Qqwy]
1
5
  ## 1.0.1
2
6
 
3
7
  ### bugfixes
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Backgrounder
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -11,6 +11,7 @@ module CarrierWave
11
11
 
12
12
  def perform(*args)
13
13
  record = super(*args)
14
+ record.send(:"process_#{column}_upload=", true)
14
15
  asset = record.send(:"#{column}")
15
16
 
16
17
  return unless record && asset_present?(asset)
@@ -24,6 +24,7 @@ RSpec.describe CarrierWave::Workers::ProcessAsset do
24
24
  allow(user).to receive(:find).with('22').and_return(user).once
25
25
  allow(user).to receive(:image).thrice.and_return(image)
26
26
 
27
+ expect(user).to receive(:process_image_upload=).with(true).once
27
28
  expect(image).to receive(:recreate_versions!).once.and_return(true)
28
29
  expect(image).to receive(:file).and_return(image)
29
30
  end
@@ -51,6 +52,7 @@ RSpec.describe CarrierWave::Workers::ProcessAsset do
51
52
  allow(admin).to receive(:avatar).twice.and_return(avatar)
52
53
 
53
54
  expect(admin).to receive(:respond_to?).with(:avatar_processing).once.and_return(false)
55
+ expect(admin).to receive(:process_avatar_upload=).with(true).once
54
56
  expect(avatar).to receive(:recreate_versions!).once.and_return(true)
55
57
  expect(avatar).to receive(:file).and_return(avatar)
56
58
 
@@ -32,7 +32,9 @@ RSpec.describe '::process_in_background multi-upload support', clear_images: tru
32
32
 
33
33
  it 'creates the versions' do
34
34
  version_paths = AvatarUploader.versions.keys.map { |key| admin.images.map { |i| i.send(key).current_path } }.flatten
35
- version_paths.each { |path| expect(File.exist? path).to be(true) }
35
+ version_paths.each { |path| expect(File.exist?(path)).to be(true) }
36
+ file_sizes = version_paths.map { |path| File.size(path) }
37
+ expect(file_sizes.uniq.count).to be(4)
36
38
  end
37
39
 
38
40
  it 'removes the files tmp directory' do
@@ -78,4 +80,4 @@ RSpec.describe '::process_in_background multi-upload support', clear_images: tru
78
80
  expect(Sidekiq::Queues["carrierwave"].size).to be(0)
79
81
  end
80
82
  end
81
- end
83
+ end
@@ -32,7 +32,9 @@ RSpec.describe '::process_in_background', clear_images: true do
32
32
 
33
33
  it 'creates the versions' do
34
34
  version_paths = admin.avatar.versions.keys.map { |key| admin.avatar.send(key).current_path }
35
- version_paths.each { |path| expect(File.exist? path).to be(true) }
35
+ version_paths.each { |path| expect(File.exist?(path)).to be(true) }
36
+ file_sizes = version_paths.map { |path| File.size(path) }
37
+ expect(file_sizes.uniq.count).to be(4)
36
38
  end
37
39
 
38
40
  it 'removes the files tmp directory' do
@@ -72,4 +74,4 @@ RSpec.describe '::process_in_background', clear_images: true do
72
74
  expect(admin.avatar.file.nil?).to be(true)
73
75
  end
74
76
  end
75
- end
77
+ end
@@ -33,7 +33,9 @@ RSpec.describe '::store_in_background multi-upload support', clear_images: true
33
33
 
34
34
  it 'creates the versions' do
35
35
  version_paths = AvatarUploader.versions.keys.map { |key| user.images.map { |i| i.send(key).current_path } }.flatten
36
- version_paths.each { |path| expect(File.exist? path).to be(true) }
36
+ version_paths.each { |path| expect(File.exist?(path)).to be(true) }
37
+ file_sizes = version_paths.map { |path| File.size(path) }
38
+ expect(file_sizes.uniq.count).to be(4)
37
39
  end
38
40
 
39
41
  it 'sets the <column>_tmp to nil' do
@@ -84,4 +86,4 @@ RSpec.describe '::store_in_background multi-upload support', clear_images: true
84
86
  end
85
87
 
86
88
  end
87
- end
89
+ end
@@ -33,7 +33,9 @@ RSpec.describe '::store_in_background', clear_images: true do
33
33
 
34
34
  it 'creates the versions' do
35
35
  version_paths = user.avatar.versions.keys.map { |key| user.avatar.send(key).current_path }
36
- version_paths.each { |path| expect(File.exist? path).to be(true) }
36
+ version_paths.each { |path| expect(File.exist?(path)).to be(true) }
37
+ file_sizes = version_paths.map { |path| File.size(path) }
38
+ expect(file_sizes.uniq.count).to be(4)
37
39
  end
38
40
 
39
41
  it 'sets the <column>_tmp to nil' do
@@ -83,4 +85,4 @@ RSpec.describe '::store_in_background', clear_images: true do
83
85
  expect(Sidekiq::Queues["carrierwave"].size).to be(0)
84
86
  end
85
87
  end
86
- end
88
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_backgrounder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Larry Sprock
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-15 00:00:00.000000000 Z
11
+ date: 2023-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave