ruby-thumbor 1.2.1 → 1.3.0

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
  SHA1:
3
- metadata.gz: bf79ac9182e85f40ddc5c7366b08cd62bc662ad5
4
- data.tar.gz: 2473d2976870e9a63ca1beb976106a1d4ceb2f94
3
+ metadata.gz: 893a41411617f13eb886aa0623348b8465367c2f
4
+ data.tar.gz: 4f987bbd23926f386cc6e360a10156007dafb159
5
5
  SHA512:
6
- metadata.gz: e039b98cc404a999c945c515db22b8c81641b27186b035d77bcbd19d91a79f412f6273eb4ef9978b081a1393092cc7347d57e754ab172d7c43bb313b621cfe86
7
- data.tar.gz: 9cabebf6eac09cca9129b667322809485c67282dae83f6450b242d1dd190b7caa6e84fb56560db5bba34dfb618459e4c34886459190a7b692ade3598e34f258d
6
+ metadata.gz: a7534f13bd29cda443f7b9338bf70b411ae6f4ce2802928d5c83e603272a1e3531f88ce4dd369adca224b2d5b59c7a0cbf1889e5d6097c2ea94f42993f242d28
7
+ data.tar.gz: 3353dcafc369ea2695b3e2883b7b6400bd63f810ead8557018a4ac313c08cb7dafa6fa5f5e1e1b597980d3c5d2ff9494112b53242d1d843b63ebad8712405ef2
@@ -1,6 +1,6 @@
1
- = ruby-thumbor {<img src="https://secure.travis-ci.org/heynemann/ruby-thumbor.png?branch=master" alt="Build Status" />}[http://travis-ci.org/heynemann/ruby-thumbor] {<img src="https://gemnasium.com/heynemann/ruby-thumbor.png" alt="Dependency Status" />}[https://gemnasium.com/heynemann/ruby-thumbor]
1
+ = ruby-thumbor {<img src="https://secure.travis-ci.org/thumbor/ruby-thumbor.png?branch=master" alt="Build Status" />}[http://travis-ci.org/thumbor/ruby-thumbor] {<img src="https://gemnasium.com/thumbor/ruby-thumbor.png" alt="Dependency Status" />}[https://gemnasium.com/thumbor/ruby-thumbor] {<img src="https://badge.fury.io/rb/ruby-thumbor.svg" alt="Gem Version" />}[http://badge.fury.io/rb/ruby-thumbor]
2
2
 
3
- * http://github.com/heynemann/ruby-thumbor
3
+ * http://github.com/thumbor/ruby-thumbor
4
4
 
5
5
  == DESCRIPTION:
6
6
 
@@ -8,7 +8,14 @@ module Thumbor
8
8
  class Cascade
9
9
  attr_accessor :image, :old_crypto, :options, :filters
10
10
 
11
- @available_options = [:meta, :crop, :center, :original_width, :original_height, :width, :height, :flip,:flop, :halign, :valign, :smart, :fit_in, :old, :trim]
11
+ @available_options = [
12
+ :meta, :crop, :center,
13
+ :original_width, :original_height,
14
+ :width, :height, :flip,
15
+ :flop, :halign, :valign,
16
+ :smart, :fit_in, :adaptive_fit_in,
17
+ :full_fit_in, :adaptive_full_fit_in,
18
+ :old, :trim]
12
19
 
13
20
  extend Forwardable
14
21
 
@@ -160,8 +160,14 @@ module Thumbor
160
160
  end
161
161
  end
162
162
 
163
- if options[:fit_in]
164
- url_parts.push('fit-in')
163
+ [:fit_in, :adaptive_fit_in, :full_fit_in, :adaptive_full_fit_in].each do |fit|
164
+ if options[fit]
165
+ url_parts.push(fit.to_s.gsub('_','-'))
166
+ end
167
+ end
168
+
169
+ if options.include?(:fit_in) or options.include?(:full_fit_in) and not (options.include?(:width) or options.include?(:height))
170
+ raise ArgumentError, 'When using fit-in or full-fit-in, you must specify width and/or height.'
165
171
  end
166
172
 
167
173
  calculate_width_and_height(url_parts, options)
@@ -220,7 +226,7 @@ module Thumbor
220
226
  if Thumbor.key
221
227
  signature = url_safe_base64(OpenSSL::HMAC.digest('sha1', Thumbor.key, thumbor_path))
222
228
  thumbor_path.insert(0, "/#{signature}/")
223
- else
229
+ else
224
230
  thumbor_path.insert(0, "/unsafe/")
225
231
  end
226
232
  thumbor_path
@@ -1,3 +1,3 @@
1
1
  module Thumbor
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -8,4 +8,7 @@ end
8
8
  RSpec.configure do |c|
9
9
  c.filter_run :focus => true
10
10
  c.run_all_when_everything_filtered = true
11
+ c.expect_with :rspec do |config|
12
+ config.syntax = [:should, :expect]
13
+ end
11
14
  end
@@ -20,7 +20,7 @@ describe Thumbor::Cascade do
20
20
  end
21
21
 
22
22
  it "should create a new instance passing key and keep it" do
23
- subject.computed_key.should == 'my-security-keym'
23
+ expect(subject.computed_key).to eq 'my-security-keym'
24
24
  end
25
25
  end
26
26
 
@@ -32,7 +32,7 @@ describe Thumbor::Cascade do
32
32
 
33
33
  it "should return just the image hash if no arguments passed" do
34
34
  url = subject.url_for
35
- url.should == image_md5
35
+ expect(url).to eq image_md5
36
36
  end
37
37
 
38
38
  it "should raise if no image passed" do
@@ -41,172 +41,194 @@ describe Thumbor::Cascade do
41
41
 
42
42
  it "should return proper url for width-only" do
43
43
  url = subject.width(300).url_for
44
- url.should == '300x0/' << image_md5
44
+ expect(url).to eq '300x0/' << image_md5
45
45
  end
46
46
 
47
47
  it "should return proper url for height-only" do
48
48
  url = subject.height(300).url_for
49
- url.should == '0x300/' << image_md5
49
+ expect(url).to eq '0x300/' << image_md5
50
50
  end
51
51
 
52
52
  it "should return proper url for width and height" do
53
53
  url = subject.width(200).height(300).url_for
54
- url.should == '200x300/' << image_md5
54
+ expect(url).to eq '200x300/' << image_md5
55
55
  end
56
56
 
57
57
  it "should return proper smart url" do
58
58
  url = subject.width(200).height(300).smart(true).url_for
59
- url.should == '200x300/smart/' << image_md5
59
+ expect(url).to eq '200x300/smart/' << image_md5
60
60
  end
61
61
 
62
62
  it "should return proper fit-in url" do
63
63
  url = subject.width(200).height(300).fit_in(true).url_for
64
- url.should == 'fit-in/200x300/' << image_md5
64
+ expect(url).to eq 'fit-in/200x300/' << image_md5
65
+ end
66
+
67
+ it "should return proper adaptive-fit-in url" do
68
+ url = subject.width(200).height(300).adaptive_fit_in(true).url_for
69
+ expect(url).to eq 'adaptive-fit-in/200x300/' << image_md5
70
+ end
71
+
72
+ it "should return proper full-fit-in url" do
73
+ url = subject.width(200).height(300).full_fit_in(true).url_for
74
+ expect(url).to eq 'full-fit-in/200x300/' << image_md5
75
+ end
76
+
77
+ it "should return proper adaptive-full-fit-in url" do
78
+ url = subject.width(200).height(300).adaptive_full_fit_in(true).url_for
79
+ expect(url).to eq 'adaptive-full-fit-in/200x300/' << image_md5
80
+ end
81
+
82
+ [:fit_in, :full_fit_in].each do |fit|
83
+ it "should raise error when using #{fit} without width or height" do
84
+ subject.send(fit, true)
85
+ expect{subject.url_for}.to raise_error(ArgumentError)
86
+ end
65
87
  end
66
88
 
67
89
  it "should return proper flip url if no width and height" do
68
90
  url = subject.flip(true).url_for
69
- url.should == '-0x0/' << image_md5
91
+ expect(url).to eq '-0x0/' << image_md5
70
92
  end
71
93
 
72
94
  it "should return proper flop url if no width and height" do
73
95
  url = subject.flop(true).url_for
74
- url.should == '0x-0/' << image_md5
96
+ expect(url).to eq '0x-0/' << image_md5
75
97
  end
76
98
 
77
99
  it "should return proper flip-flop url if no width and height" do
78
100
  url = subject.flip(true).flop(true).url_for
79
- url.should == '-0x-0/' << image_md5
101
+ expect(url).to eq '-0x-0/' << image_md5
80
102
  end
81
103
 
82
104
  it "should return proper flip url if width" do
83
105
  url = subject.width(300).flip(true).url_for
84
- url.should == '-300x0/' << image_md5
106
+ expect(url).to eq '-300x0/' << image_md5
85
107
  end
86
108
 
87
109
  it "should return proper flop url if height" do
88
110
  url = subject.height(300).flop(true).url_for
89
- url.should == '0x-300/' << image_md5
111
+ expect(url).to eq '0x-300/' << image_md5
90
112
  end
91
113
 
92
114
  it "should return horizontal align" do
93
115
  url = subject.halign(:left).url_for
94
- url.should == 'left/' << image_md5
116
+ expect(url).to eq 'left/' << image_md5
95
117
  end
96
118
 
97
119
  it "should not return horizontal align if it is center" do
98
120
  url = subject.halign(:center).url_for
99
- url.should == image_md5
121
+ expect(url).to eq image_md5
100
122
  end
101
123
 
102
124
  it "should return vertical align" do
103
125
  url = subject.valign(:top).url_for
104
- url.should == 'top/' << image_md5
126
+ expect(url).to eq 'top/' << image_md5
105
127
  end
106
128
 
107
129
  it "should not return vertical align if it is middle" do
108
130
  url = subject.valign(:middle).url_for
109
- url.should == image_md5
131
+ expect(url).to eq image_md5
110
132
  end
111
133
 
112
134
  it "should return halign and valign properly" do
113
135
  url = subject.halign(:left).valign(:top).url_for
114
- url.should == 'left/top/' << image_md5
136
+ expect(url).to eq 'left/top/' << image_md5
115
137
  end
116
138
 
117
139
  it "should return meta properly" do
118
140
  url = subject.meta(true).url_for
119
- url.should == 'meta/' << image_md5
141
+ expect(url).to eq 'meta/' << image_md5
120
142
  end
121
143
 
122
144
  it "should return proper crop url when param is array" do
123
145
  url = subject.crop([10, 20, 30, 40]).url_for
124
- url.should == '10x20:30x40/' << image_md5
146
+ expect(url).to eq '10x20:30x40/' << image_md5
125
147
  end
126
148
 
127
149
  it "should return proper crop url" do
128
150
  url = subject.crop(10, 20, 30, 40).url_for
129
- url.should == '10x20:30x40/' << image_md5
151
+ expect(url).to eq '10x20:30x40/' << image_md5
130
152
  end
131
153
 
132
154
  it "should ignore crop if all zeros" do
133
155
  url = subject.crop(0, 0, 0, 0).url_for
134
- url.should == image_md5
156
+ expect(url).to eq image_md5
135
157
  end
136
158
 
137
159
  it "should have smart after halign and valign" do
138
160
  url = subject.halign(:left).valign(:top).smart(true).url_for
139
- url.should == 'left/top/smart/' << image_md5
161
+ expect(url).to eq 'left/top/smart/' << image_md5
140
162
  end
141
163
 
142
164
  it "should have quality filter" do
143
165
  url = subject.quality_filter(20).url_for
144
- url.should == 'filters:quality(20)/' << image_md5
166
+ expect(url).to eq 'filters:quality(20)/' << image_md5
145
167
  end
146
168
 
147
169
  it "should have brightness filter" do
148
170
  url = subject.brightness_filter(30).url_for
149
- url.should == 'filters:brightness(30)/' << image_md5
171
+ expect(url).to eq 'filters:brightness(30)/' << image_md5
150
172
  end
151
173
 
152
174
  it "should have 2 filters" do
153
175
  url = subject.brightness_filter(30).quality_filter(20).url_for
154
- url.should == 'filters:brightness(30):quality(20)/' << image_md5
176
+ expect(url).to eq 'filters:brightness(30):quality(20)/' << image_md5
155
177
  end
156
178
 
157
179
  it "should escape url args" do
158
180
  url = subject.watermark_filter('http://my-server.com/image.png', 30).quality_filter(20).url_for
159
- url.should == 'filters:watermark(http%3A%2F%2Fmy-server.com%2Fimage.png,30):quality(20)/' << image_md5
181
+ expect(url).to eq 'filters:watermark(http%3A%2F%2Fmy-server.com%2Fimage.png,30):quality(20)/' << image_md5
160
182
  end
161
183
 
162
184
  it "should have trim without params" do
163
185
  url = subject.trim.url_for
164
- url.should == 'trim/' << image_md5
186
+ expect(url).to eq 'trim/' << image_md5
165
187
  end
166
188
 
167
189
  it "should have trim with direction param" do
168
190
  url = subject.trim('bottom-right').url_for
169
- url.should == 'trim:bottom-right/' << image_md5
191
+ expect(url).to eq 'trim:bottom-right/' << image_md5
170
192
  end
171
193
 
172
194
  it "should have trim with direction and tolerance param" do
173
195
  url = subject.trim('bottom-right', 15).url_for
174
- url.should == 'trim:bottom-right:15/' << image_md5
196
+ expect(url).to eq 'trim:bottom-right:15/' << image_md5
175
197
  end
176
198
 
177
199
  it "should have the right crop when cropping horizontally and given a left center" do
178
200
  url = subject.original_width(100).original_height(100).width(40).height(50).center(0, 50).url_for
179
- url.should == '0x0:80x100/40x50/' << image_md5
201
+ expect(url).to eq '0x0:80x100/40x50/' << image_md5
180
202
  end
181
203
 
182
204
  it "should have the right crop when cropping horizontally and given a right center" do
183
205
  url = subject.original_width(100).original_height(100).width(40).height(50).center(100, 50).url_for
184
- url.should == '20x0:100x100/40x50/' << image_md5
206
+ expect(url).to eq '20x0:100x100/40x50/' << image_md5
185
207
  end
186
208
 
187
209
  it "should have the right crop when cropping horizontally and given the actual center" do
188
210
  url = subject.original_width(100).original_height(100).width(40).height(50).center(50, 50).url_for
189
- url.should == '10x0:90x100/40x50/' << image_md5
211
+ expect(url).to eq '10x0:90x100/40x50/' << image_md5
190
212
  end
191
213
 
192
214
  it "should have the right crop when cropping vertically and given a top center" do
193
215
  url = subject.original_width(100).original_height(100).width(50).height(40).center(50, 0).url_for
194
- url.should == '0x0:100x80/50x40/' << image_md5
216
+ expect(url).to eq '0x0:100x80/50x40/' << image_md5
195
217
  end
196
218
 
197
219
  it "should have the right crop when cropping vertically and given a bottom center" do
198
220
  url = subject.original_width(100).original_height(100).width(50).height(40).center(50, 100).url_for
199
- url.should == '0x20:100x100/50x40/' << image_md5
221
+ expect(url).to eq '0x20:100x100/50x40/' << image_md5
200
222
  end
201
223
 
202
224
  it "should have the right crop when cropping vertically and given the actual center" do
203
225
  url = subject.original_width(100).original_height(100).width(50).height(40).center(50, 50).url_for
204
- url.should == '0x10:100x90/50x40/' << image_md5
226
+ expect(url).to eq '0x10:100x90/50x40/' << image_md5
205
227
  end
206
228
 
207
229
  it "should have the no crop when not necessary" do
208
230
  url = subject.original_width(100).original_height(100).width(50).height(50).center(50, 0).url_for
209
- url.should == '50x50/' << image_md5
231
+ expect(url).to eq '50x50/' << image_md5
210
232
  end
211
233
 
212
234
  it "should blow up with a bad center" do
@@ -215,42 +237,42 @@ describe Thumbor::Cascade do
215
237
 
216
238
  it "should have no crop with a missing original_height" do
217
239
  url = subject.original_width(100).width(50).height(40).center(50, 0).url_for
218
- url.should == '50x40/' << image_md5
240
+ expect(url).to eq '50x40/' << image_md5
219
241
  end
220
242
 
221
243
  it "should have no crop with a missing original_width" do
222
244
  url = subject.original_height(100).width(50).height(40).center(50, 0).url_for
223
- url.should == '50x40/' << image_md5
245
+ expect(url).to eq '50x40/' << image_md5
224
246
  end
225
247
 
226
248
  it "should have no crop with out a width and height" do
227
249
  url = subject.original_width(100).original_height(100).center(50, 50).url_for
228
- url.should == image_md5
250
+ expect(url).to eq image_md5
229
251
  end
230
252
 
231
253
  it "should use the original width with a missing width" do
232
254
  url = subject.original_width(100).original_height(100).height(80).center(50, 50).url_for
233
- url.should == '0x10:100x90/0x80/' << image_md5
255
+ expect(url).to eq '0x10:100x90/0x80/' << image_md5
234
256
  end
235
257
 
236
258
  it "should use the original height with a missing height" do
237
259
  url = subject.original_width(100).original_height(100).width(80).center(50, 50).url_for
238
- url.should == '10x0:90x100/80x0/' << image_md5
260
+ expect(url).to eq '10x0:90x100/80x0/' << image_md5
239
261
  end
240
262
 
241
263
  it "should have the right crop with a negative width" do
242
264
  url = subject.original_width(100).original_height(100).width(-50).height(40).center(50, 50).url_for
243
- url.should == '0x10:100x90/-50x40/' << image_md5
265
+ expect(url).to eq '0x10:100x90/-50x40/' << image_md5
244
266
  end
245
267
 
246
268
  it "should have the right crop with a negative height" do
247
269
  url = subject.original_width(100).original_height(100).width(50).height(-40).center(50, 50).url_for
248
- url.should == '0x10:100x90/50x-40/' << image_md5
270
+ expect(url).to eq '0x10:100x90/50x-40/' << image_md5
249
271
  end
250
272
 
251
273
  it "should have the right crop with a negative height and width" do
252
274
  url = subject.original_width(100).original_height(100).width(-50).height(-40).center(50, 50).url_for
253
- url.should == '0x10:100x90/-50x-40/' << image_md5
275
+ expect(url).to eq '0x10:100x90/-50x-40/' << image_md5
254
276
  end
255
277
  end
256
278
 
@@ -261,7 +283,7 @@ describe Thumbor::Cascade do
261
283
 
262
284
  it "should create a new instance passing key and keep it" do
263
285
  url = subject.width(300).height(200).generate
264
- url.should == '/TQfyd3H36Z3srcNcLOYiM05YNO8=/300x200/my.domain.com/some/image/url.jpg'
286
+ expect(url).to eq '/TQfyd3H36Z3srcNcLOYiM05YNO8=/300x200/my.domain.com/some/image/url.jpg'
265
287
  end
266
288
 
267
289
  it "should be able to change the Thumbor key" do
@@ -269,37 +291,37 @@ describe Thumbor::Cascade do
269
291
  url1 = thumbor.generate
270
292
  Thumbor.key = 'another-thumbor-key'
271
293
  url2 = thumbor.generate
272
- url1.should_not == url2
294
+ expect(url1).not_to eq url2
273
295
  end
274
296
 
275
297
  it "should create a new instance passing key and keep it" do
276
298
  url = subject.width(300).height(200).meta(true).generate
277
- url.should == '/YBQEWd3g_WRMnVEG73zfzcr8Zj0=/meta/300x200/my.domain.com/some/image/url.jpg'
299
+ expect(url).to eq '/YBQEWd3g_WRMnVEG73zfzcr8Zj0=/meta/300x200/my.domain.com/some/image/url.jpg'
278
300
  end
279
301
 
280
302
  it "should create a new instance passing key and keep it" do
281
303
  url = subject.width(300).height(200).meta(true).smart(true).generate
282
- url.should == '/jP89J0qOWHgPlm_lOA28GtOh5GU=/meta/300x200/smart/my.domain.com/some/image/url.jpg'
304
+ expect(url).to eq '/jP89J0qOWHgPlm_lOA28GtOh5GU=/meta/300x200/smart/my.domain.com/some/image/url.jpg'
283
305
  end
284
306
 
285
307
  it "should create a new instance passing key and keep it" do
286
308
  url = subject.width(300).height(200).meta(true).smart(true).fit_in(true).generate
287
- url.should == '/zrrOh_TtTs4kiLLEQq1w4bcTYdc=/meta/fit-in/300x200/smart/my.domain.com/some/image/url.jpg'
309
+ expect(url).to eq '/zrrOh_TtTs4kiLLEQq1w4bcTYdc=/meta/fit-in/300x200/smart/my.domain.com/some/image/url.jpg'
288
310
  end
289
311
 
290
312
  it "should create a new instance passing key and keep it" do
291
313
  url = subject.width(300).height(200).meta(true).smart(true).fit_in(true).flip(true).generate
292
- url.should == '/4t1XK1KH43cOb1QJ9tU00-W2_k8=/meta/fit-in/-300x200/smart/my.domain.com/some/image/url.jpg'
314
+ expect(url).to eq '/4t1XK1KH43cOb1QJ9tU00-W2_k8=/meta/fit-in/-300x200/smart/my.domain.com/some/image/url.jpg'
293
315
  end
294
316
 
295
317
  it "should create a new instance passing key and keep it" do
296
318
  url = subject.width(300).height(200).meta(true).smart(true).fit_in(true).flip(true).flop(true).generate
297
- url.should == '/HJnvjZU69PkPOhyZGu-Z3Uc_W_A=/meta/fit-in/-300x-200/smart/my.domain.com/some/image/url.jpg'
319
+ expect(url).to eq '/HJnvjZU69PkPOhyZGu-Z3Uc_W_A=/meta/fit-in/-300x-200/smart/my.domain.com/some/image/url.jpg'
298
320
  end
299
321
 
300
322
  it "should create a new instance passing key and keep it" do
301
323
  url = subject.quality_filter(20).brightness_filter(10).generate
302
- url.should == '/q0DiFg-5-eFZIqyN3lRoCvg2K0s=/filters:quality(20):brightness(10)/my.domain.com/some/image/url.jpg'
324
+ expect(url).to eq '/q0DiFg-5-eFZIqyN3lRoCvg2K0s=/filters:quality(20):brightness(10)/my.domain.com/some/image/url.jpg'
303
325
  end
304
326
  end
305
327
 
@@ -312,7 +334,7 @@ describe Thumbor::Cascade do
312
334
 
313
335
  it "should create a new instance passing key and keep it" do
314
336
  url = subject.width(300).height(200).generate
315
- url.should == '/qkLDiIbvtiks0Up9n5PACtmpOfX6dPXw4vP4kJU-jTfyF6y1GJBJyp7CHYh1H3R2/' << image_url
337
+ expect(url).to eq '/qkLDiIbvtiks0Up9n5PACtmpOfX6dPXw4vP4kJU-jTfyF6y1GJBJyp7CHYh1H3R2/' << image_url
316
338
  end
317
339
 
318
340
  it "should allow thumbor to decrypt it properly" do
@@ -322,20 +344,20 @@ describe Thumbor::Cascade do
322
344
 
323
345
  decrypted = decrypt_in_thumbor(encrypted)
324
346
 
325
- decrypted["horizontal_flip"].should == false
326
- decrypted["vertical_flip"].should == false
327
- decrypted["smart"].should == false
328
- decrypted["meta"].should == false
329
- decrypted["fit_in"].should == false
330
- decrypted["crop"]["left"].should == 0
331
- decrypted["crop"]["top"].should == 0
332
- decrypted["crop"]["right"].should == 0
333
- decrypted["crop"]["bottom"].should == 0
334
- decrypted["valign"].should == 'middle'
335
- decrypted["halign"].should == 'center'
336
- decrypted["image_hash"].should == image_md5
337
- decrypted["width"].should == 300
338
- decrypted["height"].should == 200
347
+ expect(decrypted["horizontal_flip"]).to eq false
348
+ expect(decrypted["vertical_flip"]).to eq false
349
+ expect(decrypted["smart"]).to eq false
350
+ expect(decrypted["meta"]).to eq false
351
+ expect(decrypted["fit_in"]).to eq false
352
+ expect(decrypted["crop"]["left"]).to eq 0
353
+ expect(decrypted["crop"]["top"]).to eq 0
354
+ expect(decrypted["crop"]["right"]).to eq 0
355
+ expect(decrypted["crop"]["bottom"]).to eq 0
356
+ expect(decrypted["valign"]).to eq 'middle'
357
+ expect(decrypted["halign"]).to eq 'center'
358
+ expect(decrypted["image_hash"]).to eq image_md5
359
+ expect(decrypted["width"]).to eq 300
360
+ expect(decrypted["height"]).to eq 200
339
361
 
340
362
  end
341
363
 
@@ -346,10 +368,10 @@ describe Thumbor::Cascade do
346
368
 
347
369
  decrypted = decrypt_in_thumbor(encrypted)
348
370
 
349
- decrypted["meta"].should == true
350
- decrypted["image_hash"].should == image_md5
351
- decrypted["width"].should == 300
352
- decrypted["height"].should == 200
371
+ expect(decrypted["meta"]).to eq true
372
+ expect(decrypted["image_hash"]).to eq image_md5
373
+ expect(decrypted["width"]).to eq 300
374
+ expect(decrypted["height"]).to eq 200
353
375
 
354
376
  end
355
377
 
@@ -360,11 +382,11 @@ describe Thumbor::Cascade do
360
382
 
361
383
  decrypted = decrypt_in_thumbor(encrypted)
362
384
 
363
- decrypted["meta"].should == true
364
- decrypted["smart"].should == true
365
- decrypted["image_hash"].should == image_md5
366
- decrypted["width"].should == 300
367
- decrypted["height"].should == 200
385
+ expect(decrypted["meta"]).to eq true
386
+ expect(decrypted["smart"]).to eq true
387
+ expect(decrypted["image_hash"]).to eq image_md5
388
+ expect(decrypted["width"]).to eq 300
389
+ expect(decrypted["height"]).to eq 200
368
390
 
369
391
  end
370
392
 
@@ -375,10 +397,10 @@ describe Thumbor::Cascade do
375
397
 
376
398
  decrypted = decrypt_in_thumbor(encrypted)
377
399
 
378
- decrypted["fit_in"].should == true
379
- decrypted["image_hash"].should == image_md5
380
- decrypted["width"].should == 300
381
- decrypted["height"].should == 200
400
+ expect(decrypted["fit_in"]).to eq true
401
+ expect(decrypted["image_hash"]).to eq image_md5
402
+ expect(decrypted["width"]).to eq 300
403
+ expect(decrypted["height"]).to eq 200
382
404
 
383
405
  end
384
406
 
@@ -389,12 +411,12 @@ describe Thumbor::Cascade do
389
411
 
390
412
  decrypted = decrypt_in_thumbor(encrypted)
391
413
 
392
- decrypted["meta"].should == true
393
- decrypted["smart"].should == true
394
- decrypted["image_hash"].should == image_md5
395
- decrypted["width"].should == 300
396
- decrypted["height"].should == 200
397
- decrypted["flip_horizontally"] == true
414
+ expect(decrypted["meta"]).to eq true
415
+ expect(decrypted["smart"]).to eq true
416
+ expect(decrypted["image_hash"]).to eq image_md5
417
+ expect(decrypted["width"]).to eq 300
418
+ expect(decrypted["height"]).to eq 200
419
+ expect(decrypted["horizontal_flip"]).to eq true
398
420
 
399
421
  end
400
422
 
@@ -405,13 +427,13 @@ describe Thumbor::Cascade do
405
427
 
406
428
  decrypted = decrypt_in_thumbor(encrypted)
407
429
 
408
- decrypted["meta"].should == true
409
- decrypted["smart"].should == true
410
- decrypted["image_hash"].should == image_md5
411
- decrypted["width"].should == 300
412
- decrypted["height"].should == 200
413
- decrypted["flip_horizontally"] == true
414
- decrypted["flip_vertically"] == true
430
+ expect(decrypted["meta"]).to eq true
431
+ expect(decrypted["smart"]).to eq true
432
+ expect(decrypted["image_hash"]).to eq image_md5
433
+ expect(decrypted["width"]).to eq 300
434
+ expect(decrypted["height"]).to eq 200
435
+ expect(decrypted["horizontal_flip"]).to eq true
436
+ expect(decrypted["vertical_flip"]).to eq true
415
437
 
416
438
  end
417
439
 
@@ -423,14 +445,14 @@ describe Thumbor::Cascade do
423
445
 
424
446
  decrypted = decrypt_in_thumbor(encrypted)
425
447
 
426
- decrypted["meta"].should == true
427
- decrypted["smart"].should == true
428
- decrypted["image_hash"].should == image_md5
429
- decrypted["width"].should == 300
430
- decrypted["height"].should == 200
431
- decrypted["flip_horizontally"] == true
432
- decrypted["flip_vertically"] == true
433
- decrypted["halign"] == "left"
448
+ expect(decrypted["meta"]).to eq true
449
+ expect(decrypted["smart"]).to eq true
450
+ expect(decrypted["image_hash"]).to eq image_md5
451
+ expect(decrypted["width"]).to eq 300
452
+ expect(decrypted["height"]).to eq 200
453
+ expect(decrypted["horizontal_flip"]).to eq true
454
+ expect(decrypted["vertical_flip"]).to eq true
455
+ expect(decrypted["halign"]).to eq "left"
434
456
 
435
457
  end
436
458
 
@@ -442,15 +464,15 @@ describe Thumbor::Cascade do
442
464
 
443
465
  decrypted = decrypt_in_thumbor(encrypted)
444
466
 
445
- decrypted["meta"].should == true
446
- decrypted["smart"].should == true
447
- decrypted["image_hash"].should == image_md5
448
- decrypted["width"].should == 300
449
- decrypted["height"].should == 200
450
- decrypted["flip_horizontally"] == true
451
- decrypted["flip_vertically"] == true
452
- decrypted["halign"] == "left"
453
- decrypted["valign"] == "top"
467
+ expect(decrypted["meta"]).to eq true
468
+ expect(decrypted["smart"]).to eq true
469
+ expect(decrypted["image_hash"]).to eq image_md5
470
+ expect(decrypted["width"]).to eq 300
471
+ expect(decrypted["height"]).to eq 200
472
+ expect(decrypted["horizontal_flip"]).to eq true
473
+ expect(decrypted["vertical_flip"]).to eq true
474
+ expect(decrypted["halign"]).to eq "left"
475
+ expect(decrypted["valign"]).to eq "top"
454
476
 
455
477
  end
456
478
 
@@ -461,19 +483,19 @@ describe Thumbor::Cascade do
461
483
 
462
484
  decrypted = decrypt_in_thumbor(encrypted)
463
485
 
464
- decrypted["horizontal_flip"].should == false
465
- decrypted["vertical_flip"].should == false
466
- decrypted["smart"].should == false
467
- decrypted["meta"].should == false
468
- decrypted["crop"]["left"].should == 10
469
- decrypted["crop"]["top"].should == 20
470
- decrypted["crop"]["right"].should == 30
471
- decrypted["crop"]["bottom"].should == 40
472
- decrypted["valign"].should == 'middle'
473
- decrypted["halign"].should == 'center'
474
- decrypted["image_hash"].should == image_md5
475
- decrypted["width"].should == 300
476
- decrypted["height"].should == 200
486
+ expect(decrypted["horizontal_flip"]).to eq false
487
+ expect(decrypted["vertical_flip"]).to eq false
488
+ expect(decrypted["smart"]).to eq false
489
+ expect(decrypted["meta"]).to eq false
490
+ expect(decrypted["crop"]["left"]).to eq 10
491
+ expect(decrypted["crop"]["top"]).to eq 20
492
+ expect(decrypted["crop"]["right"]).to eq 30
493
+ expect(decrypted["crop"]["bottom"]).to eq 40
494
+ expect(decrypted["valign"]).to eq 'middle'
495
+ expect(decrypted["halign"]).to eq 'center'
496
+ expect(decrypted["image_hash"]).to eq image_md5
497
+ expect(decrypted["width"]).to eq 300
498
+ expect(decrypted["height"]).to eq 200
477
499
 
478
500
  end
479
501
 
@@ -484,7 +506,7 @@ describe Thumbor::Cascade do
484
506
 
485
507
  decrypted = decrypt_in_thumbor(encrypted)
486
508
 
487
- decrypted["filters"].should == "quality(20):brightness(10)"
509
+ expect(decrypted["filters"]).to eq "quality(20):brightness(10)"
488
510
  end
489
511
  end
490
512
  end
metadata CHANGED
@@ -1,41 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-thumbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo Heynemann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-24 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ! '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ! '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: simplecov
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: guard-rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rb-fsevent
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 0.9.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.9.1
69
+ - !ruby/object:Gem::Dependency
70
+ name: listen
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 1.3.1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 1.3.1
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ! '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
39
95
  - !ruby/object:Gem::Version
40
96
  version: '0'
41
97
  description: ruby-thumbor is the client to the thumbor imaging service (http://github.com/globocom/thumbor).
@@ -65,12 +121,12 @@ require_paths:
65
121
  - lib
66
122
  required_ruby_version: !ruby/object:Gem::Requirement
67
123
  requirements:
68
- - - '>='
124
+ - - ! '>='
69
125
  - !ruby/object:Gem::Version
70
126
  version: '0'
71
127
  required_rubygems_version: !ruby/object:Gem::Requirement
72
128
  requirements:
73
- - - '>='
129
+ - - ! '>='
74
130
  - !ruby/object:Gem::Version
75
131
  version: '0'
76
132
  requirements: []