carrierwave 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of carrierwave might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0092635d7d29c1b3f6b16b2589e48ba6919ff0b9
4
- data.tar.gz: c19c7734e547d39cfec1d90aa48fb28bd3d99b2a
3
+ metadata.gz: 815b971ebb21afd416f1de7f2d5d35a67c7231bf
4
+ data.tar.gz: 59b36c18c02eefb0f81438b54200c5f857759589
5
5
  SHA512:
6
- metadata.gz: d4cce1995281a15422ac6c35b82b19b54e6ba0f5d0efffcbf6c9d3e7f81ae462efa8f313a84ba707bdf4a5e4938e7b367fae90789e18dc24421b023b64c77506
7
- data.tar.gz: 5b103922747f4fb1f1c2a172408e9904a39930eda9cd1769ca0b9ba16ee7bbed4dbb9aa1d3a24ac8e61a19ead8491e4ed5b4bca852224f33e6b8b02a90f7d7da
6
+ metadata.gz: 40f40f2cdd4e0657843260e6830e39e87465fd3b9e881e2dc3f1298479272cb0accbf7a9d4262f1c8df5d7573de4e7c49776b484ec7ad84fa7ad01462455676f
7
+ data.tar.gz: b967fe877468cb9c26bc7fdc7c861f37692ceaf2293457c3e4fe7f9faf773abda94243dceef9ef38c4fdad979853ecac47b22df0b36ae945af0dfb830bbdeed9
@@ -62,6 +62,8 @@ module CarrierWave
62
62
 
63
63
  included do
64
64
  begin
65
+ require "rmagick"
66
+ rescue LoadError
65
67
  require "RMagick"
66
68
  rescue LoadError => e
67
69
  e.message << " (You may need to install the rmagick gem)"
@@ -8,15 +8,27 @@ module CarrierWave
8
8
  end
9
9
  end
10
10
 
11
+ class CacheCounter
12
+ @@counter = 0
13
+
14
+ def self.increment
15
+ @@counter += 1
16
+ end
17
+ end
18
+
11
19
  ##
12
20
  # Generates a unique cache id for use in the caching system
13
21
  #
14
22
  # === Returns
15
23
  #
16
- # [String] a cache id in the format TIMEINT-PID-RND
24
+ # [String] a cache id in the format TIMEINT-PID-COUNTER-RND
17
25
  #
18
26
  def self.generate_cache_id
19
- Time.now.utc.to_i.to_s + '-' + Process.pid.to_s + '-' + ("%04d" % rand(9999))
27
+ [Time.now.utc.to_i,
28
+ Process.pid,
29
+ '%04d' % (CarrierWave::CacheCounter.increment % 1000),
30
+ '%04d' % rand(9999)
31
+ ].map(&:to_s).join('-')
20
32
  end
21
33
 
22
34
  module Uploader
@@ -91,7 +103,7 @@ module CarrierWave
91
103
  #
92
104
  # === Returns
93
105
  #
94
- # [String] a cache name, in the format YYYYMMDD-HHMM-PID-RND/filename.txt
106
+ # [String] a cache name, in the format TIMEINT-PID-COUNTER-RND/filename.txt
95
107
  #
96
108
  def cache_name
97
109
  File.join(cache_id, full_original_filename) if cache_id and original_filename
@@ -165,7 +177,9 @@ module CarrierWave
165
177
  alias_method :full_original_filename, :original_filename
166
178
 
167
179
  def cache_id=(cache_id)
168
- raise CarrierWave::InvalidParameter, "invalid cache id" unless cache_id =~ /\A[\d]+\-[\d]+\-[\d]{4}\z/
180
+ # Earlier version used 3 part cache_id. Thus we should allow for
181
+ # the cache_id to have both 3 part and 4 part formats.
182
+ raise CarrierWave::InvalidParameter, "invalid cache id" unless cache_id =~ /\A[\d]+\-[\d]+(\-[\d]{4})?\-[\d]{4}\z/
169
183
  @cache_id = cache_id
170
184
  end
171
185
 
@@ -1,3 +1,3 @@
1
1
  module CarrierWave
2
- VERSION = "0.10.0"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-26 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.16'
69
69
  - !ruby/object:Gem::Dependency
70
- name: mysql2
70
+ name: pg
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -138,18 +138,46 @@ dependencies:
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: fog
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: 1.20.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.20.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: unf
141
155
  requirement: !ruby/object:Gem::Requirement
142
156
  requirements:
143
157
  - - ">="
144
158
  - !ruby/object:Gem::Version
145
- version: 1.3.1
159
+ version: '0'
146
160
  type: :development
147
161
  prerelease: false
148
162
  version_requirements: !ruby/object:Gem::Requirement
149
163
  requirements:
150
164
  - - ">="
151
165
  - !ruby/object:Gem::Version
152
- version: 1.3.1
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: net-ssh
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 2.9.0
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: 2.9.0
153
181
  - !ruby/object:Gem::Dependency
154
182
  name: mini_magick
155
183
  requirement: !ruby/object:Gem::Requirement
@@ -304,7 +332,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
332
  version: '0'
305
333
  requirements: []
306
334
  rubyforge_project: carrierwave
307
- rubygems_version: 2.2.0
335
+ rubygems_version: 2.4.3
308
336
  signing_key:
309
337
  specification_version: 3
310
338
  summary: Ruby file upload library