carrierwave_backgrounder 1.0.0 → 1.0.2
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/CHANGELOG.md +11 -0
 - data/lib/backgrounder/version.rb +1 -1
 - data/lib/backgrounder/workers/process_asset_mixin.rb +1 -0
 - data/lib/carrierwave_backgrounder.rb +3 -3
 - data/spec/backgrounder/workers/process_asset_spec.rb +2 -0
 - data/spec/integrations/process_in_background_multi_upload_spec.rb +4 -2
 - data/spec/integrations/process_in_background_spec.rb +4 -2
 - data/spec/integrations/store_in_background_multi_upload_spec.rb +4 -2
 - data/spec/integrations/store_in_background_spec.rb +4 -2
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 9db3ebd17e2fba8538ee90f3f451f6d37738a9d833bc5ac9f6f8123a3f7a214a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 3ef48ab1f8ac80b9ea3e374fd4806b769927baec00cc8c6d7a19b9340cebe906
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 67965fc212f3fa08aa5936815b63a63215550780e2150759d6dc8d87683ca7be2d5614f8d7ba9b93a22e4c1537e6db9fcffb938649708e2e42508bb868835062
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 20c1a3d50441f061701e8ada2af4b2b26706794496f71fa707ff865338358c834ede9de39369e2448b39c149a9cfb6f8528f8a7daa126c3f51a4e7bc1767fe81
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,3 +1,14 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ## 1.0.2
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            ### bugfixes
         
     | 
| 
      
 4 
     | 
    
         
            +
              * [#317] Fixed an issue where #process_in_backfground would copy files but not create versions [Qqwy]
         
     | 
| 
      
 5 
     | 
    
         
            +
            ## 1.0.1
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            ### bugfixes
         
     | 
| 
      
 8 
     | 
    
         
            +
              * [#315] Fix an issue where the expectation was a string key for config [fero46]
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            ## 1.0.0
         
     | 
| 
      
 11 
     | 
    
         
            +
              * No Changes
         
     | 
| 
       1 
12 
     | 
    
         
             
            ## 1.0.0-beta.2
         
     | 
| 
       2 
13 
     | 
    
         | 
| 
       3 
14 
     | 
    
         
             
            ### enhancements
         
     | 
    
        data/lib/backgrounder/version.rb
    CHANGED
    
    
| 
         @@ -17,13 +17,13 @@ module CarrierWave 
     | 
|
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
                  case backend
         
     | 
| 
       19 
19 
     | 
    
         
             
                  when :active_job
         
     | 
| 
       20 
     | 
    
         
            -
                    @worker_klass =  
     | 
| 
      
 20 
     | 
    
         
            +
                    @worker_klass = 'CarrierWave::Workers::ActiveJob'
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
                    require 'active_job'
         
     | 
| 
       23 
23 
     | 
    
         
             
                    require 'backgrounder/workers/active_job/process_asset'
         
     | 
| 
       24 
24 
     | 
    
         
             
                    require 'backgrounder/workers/active_job/store_asset'
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                    queue_name = queue_options[ 
     | 
| 
      
 26 
     | 
    
         
            +
                    queue_name = queue_options[:queue] || 'carrierwave'
         
     | 
| 
       27 
27 
     | 
    
         | 
| 
       28 
28 
     | 
    
         
             
                    ::CarrierWave::Workers::ActiveJob::ProcessAsset.class_eval do
         
     | 
| 
       29 
29 
     | 
    
         
             
                      queue_as queue_name
         
     | 
| 
         @@ -32,7 +32,7 @@ module CarrierWave 
     | 
|
| 
       32 
32 
     | 
    
         
             
                      queue_as queue_name
         
     | 
| 
       33 
33 
     | 
    
         
             
                    end
         
     | 
| 
       34 
34 
     | 
    
         
             
                  when :sidekiq
         
     | 
| 
       35 
     | 
    
         
            -
                    @worker_klass =  
     | 
| 
      
 35 
     | 
    
         
            +
                    @worker_klass = 'CarrierWave::Workers'
         
     | 
| 
       36 
36 
     | 
    
         | 
| 
       37 
37 
     | 
    
         
             
                    require 'sidekiq'
         
     | 
| 
       38 
38 
     | 
    
         
             
                    ::CarrierWave::Workers::ProcessAsset.class_eval do
         
     | 
| 
         @@ -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? 
     | 
| 
      
 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? 
     | 
| 
      
 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? 
     | 
| 
      
 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? 
     | 
| 
      
 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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2023-10-13 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: carrierwave
         
     |