carrierwave-crop-on-fly 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cffee5c482ce6e6def457c4e9902ec0241b3345
4
- data.tar.gz: bea44c74f578ab4342e59e7141b54f409b9993fb
3
+ metadata.gz: ae1c3a2e5a28db8ec8637636e47c30ce399cec08
4
+ data.tar.gz: 774ed5cf3dcea2d7449ecf19b4182d3d3cee036b
5
5
  SHA512:
6
- metadata.gz: 53101d90297b31747da89f2aae820c2a8d712ece725a5f004a9c9f21534e904e7505534049a58a463915cdaa70e848e532e6bb034deb455651a9826a7973230a
7
- data.tar.gz: 340de4fcbbd26e0a82b68d1dd26213fd531d5a641904671e0c336ce86ac891e4ec3e35280975b558b4fc37635acec4a6ec9bcfb940a6742d6dab1244666c59e8
6
+ metadata.gz: 984cf12d64ed99cecd102d500c7158629b765046fc90b6c353736eb79b553fc9e5e3e1443a8866353f0cc44066fd39241a8af3299f29fafac5369195d437edb4
7
+ data.tar.gz: 7b6dd94b32cc06e866c83a276664b910dceaf9a7c7590ab8691ce71e640410c4b8c73b7f7e5583aaef9e47dfb5d745470fe7bd4ab6596577a6250c5bac9ff8d3
@@ -1,29 +1,19 @@
1
- module CarrierWave
2
- module Crop
3
- module ExtensionCropData
4
- extend ActiveSupport::Concern
5
-
6
- included do
7
- before :cache, :remember_crop_data
1
+ if defined? CarrierWave::Uploader::Base
2
+ class CarrierWave::Uploader::Base
8
3
 
9
- attr_accessor :crop_x, :crop_y, :crop_w, :crop_h
10
- end
4
+ attr_accessor :crop_x, :crop_y, :crop_w, :crop_h
11
5
 
12
- private
6
+ alias_method :old_cache!, :cache!
13
7
 
14
- def remember_crop_data(file)
15
- self.crop_x = file.file.crop_x if file.file.respond_to?(:crop_x)
16
- self.crop_y = file.file.crop_y if file.file.respond_to?(:crop_y)
17
- self.crop_w = file.file.crop_w if file.file.respond_to?(:crop_w)
18
- self.crop_h = file.file.crop_h if file.file.respond_to?(:crop_h)
8
+ def cache!(file)
9
+ if file.is_a?(ActionDispatch::Http::UploadedFile)
10
+ self.crop_x = file.crop_x
11
+ self.crop_y = file.crop_y
12
+ self.crop_w = file.crop_w
13
+ self.crop_h = file.crop_h
19
14
  end
20
15
 
16
+ old_cache!(file)
21
17
  end
22
18
  end
23
- end
24
-
25
- if defined? CarrierWave::Uploader::Base
26
- CarrierWave::Uploader::Base.class_eval do
27
- include ::CarrierWave::Crop::ExtensionCropData
28
- end
29
19
  end
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Crop
3
- VERSION = '0.0.3'
3
+ VERSION = '0.0.4'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-crop-on-fly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - evg2108