carrierwave_reupload_fix 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8b05bf6cc0d7ac031128aecd71d717deec253c24
4
+ data.tar.gz: e394c3f622c4f792fae2f4c72070e866cafb07a5
5
+ SHA512:
6
+ metadata.gz: f2545c6f746d0577f5630c211276bb645cfc3e2fb3a34a0fc93e34305893612b68aafc1d96e5e095284fff6315b0f1a1f79b0f3da5c924bd2230845432b3deec
7
+ data.tar.gz: 16ca8cbed540980e2a98337664e5c483b892a621394cda894e123b17f5866eda20150da86f93affdd14edd5400fd5b9aeafdb5cf3b3941f1a8049c0d7476c3b7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 0.4.0
2
+
3
+ Add #carrierwave_reupload_fix method to handle reupload fix easily without #update
4
+
1
5
  # Version 0.3.0
2
6
 
3
7
  Alias #update_attributes to #update
data/README.md CHANGED
@@ -118,6 +118,12 @@ Restart your application and enjoy.
118
118
  Works also with #update_attributes method.
119
119
  ```
120
120
 
121
+ If you don't use ``` update ``` (eg. assigning attributes and saving separately), you may use ``` carrierwave_reupload_fix ``` method:
122
+
123
+ ```ruby
124
+ DummyModel.find(id).carrierwave_reupload_fix
125
+ ```
126
+
121
127
  ## Contributing
122
128
 
123
129
  1. Fork it
@@ -42,7 +42,7 @@ module CarrierwaveReuploadFix
42
42
 
43
43
  def update(attributes)
44
44
  if original_update(attributes)
45
- ReuploadFixer.new(self, VersionsRecreator.new, ExtensionsAssigner.new).fix
45
+ carrierwave_reupload_fix
46
46
  true
47
47
  else
48
48
  false
@@ -51,5 +51,9 @@ module CarrierwaveReuploadFix
51
51
 
52
52
  alias :update_attributes :update
53
53
 
54
+ def carrierwave_reupload_fix
55
+ ReuploadFixer.new(self, VersionsRecreator.new, ExtensionsAssigner.new).fix
56
+ end
57
+
54
58
  end
55
59
  end
@@ -1,3 +1,3 @@
1
1
  module CarrierwaveReuploadFix
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -60,7 +60,7 @@ describe CarrierwaveReuploadFix do
60
60
 
61
61
  it "calls fixer on update if update returns true and the entire" do
62
62
  model_instance = DummyMainModel.new
63
- perform_update(model_instance)
63
+ expect_fixer_to_be_called_with_model(model_instance)
64
64
  model_instance.update({})
65
65
  end
66
66
 
@@ -87,11 +87,19 @@ describe CarrierwaveReuploadFix do
87
87
  end
88
88
  end
89
89
 
90
+ describe "#carrierwave_reupload_fix" do
91
+ it "calls fixer" do
92
+ model_instance = DummyMainModel.new
93
+ expect_fixer_to_be_called_with_model(model_instance)
94
+ model_instance.update({})
95
+ end
96
+ end
97
+
90
98
  describe "#update_attributes" do
91
99
 
92
100
  it "works as #update" do
93
101
  model_instance = DummyMainModel.new
94
- perform_update(model_instance)
102
+ expect_fixer_to_be_called_with_model(model_instance)
95
103
  model_instance.update_attributes({})
96
104
  end
97
105
 
@@ -99,7 +107,7 @@ describe CarrierwaveReuploadFix do
99
107
 
100
108
  end
101
109
 
102
- def perform_update(model_instance)
110
+ def expect_fixer_to_be_called_with_model(model_instance)
103
111
  model_instance.stub(:original_update) { true }
104
112
  fixer = double(:fixer)
105
113
  recreator = double(:recreator)
metadata CHANGED
@@ -1,105 +1,95 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_reupload_fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Azdaroth
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-09 00:00:00.000000000 Z
11
+ date: 2014-10-04 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.3'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: carrierwave
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rails
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '3.0'
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '3.0'
94
- description: ! "Extension for fixing processing images with Carrierwave on reupload\n
95
- \ when file extension changes"
83
+ description: |-
84
+ Extension for fixing processing images with Carrierwave on reupload
85
+ when file extension changes
96
86
  email:
97
87
  - azdaroth@gmail.com
98
88
  executables: []
99
89
  extensions: []
100
90
  extra_rdoc_files: []
101
91
  files:
102
- - .gitignore
92
+ - ".gitignore"
103
93
  - CHANGELOG.md
104
94
  - Gemfile
105
95
  - LICENSE.txt
@@ -119,27 +109,26 @@ files:
119
109
  homepage: https://github.com/Azdaroth/carrierwave_reupload_fix
120
110
  licenses:
121
111
  - MIT
112
+ metadata: {}
122
113
  post_install_message:
123
114
  rdoc_options: []
124
115
  require_paths:
125
116
  - lib
126
117
  required_ruby_version: !ruby/object:Gem::Requirement
127
- none: false
128
118
  requirements:
129
- - - ! '>='
119
+ - - ">="
130
120
  - !ruby/object:Gem::Version
131
121
  version: '0'
132
122
  required_rubygems_version: !ruby/object:Gem::Requirement
133
- none: false
134
123
  requirements:
135
- - - ! '>='
124
+ - - ">="
136
125
  - !ruby/object:Gem::Version
137
126
  version: '0'
138
127
  requirements: []
139
128
  rubyforge_project:
140
- rubygems_version: 1.8.25
129
+ rubygems_version: 2.2.2
141
130
  signing_key:
142
- specification_version: 3
131
+ specification_version: 4
143
132
  summary: Extension for fixing processing images with Carrierwave
144
133
  test_files:
145
134
  - spec/carrierwave_reupload_fix/extenions_assigner_spec.rb