ruby-thumbor 1.2.0 → 1.2.1

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: ed4ebe8f3b222814e1c6657501b576742203490a
4
- data.tar.gz: b7d93fdda95026dbde9d01a2ae6943ffbe9be526
3
+ metadata.gz: bf79ac9182e85f40ddc5c7366b08cd62bc662ad5
4
+ data.tar.gz: 2473d2976870e9a63ca1beb976106a1d4ceb2f94
5
5
  SHA512:
6
- metadata.gz: 3bb31b237dd4fe02e625d81f4b803e98df02fa16a019c96d9831984a27b64ec95513312c8e193cac4614b56de875ced3d265d81c10420c60f18310bd7241d269
7
- data.tar.gz: 616b5aa7ac01e9c3f0380d65528ba5d18fc590b971353b4ec1102ff0dd0d9b4f2e9765a879615a348a2c3c142d40efb5cc4c6793ee8d25be3cfd2757476453ed
6
+ metadata.gz: e039b98cc404a999c945c515db22b8c81641b27186b035d77bcbd19d91a79f412f6273eb4ef9978b081a1393092cc7347d57e754ab172d7c43bb313b621cfe86
7
+ data.tar.gz: 9cabebf6eac09cca9129b667322809485c67282dae83f6450b242d1dd190b7caa6e84fb56560db5bba34dfb618459e4c34886459190a7b692ade3598e34f258d
@@ -30,11 +30,11 @@ module Thumbor
30
30
  end
31
31
 
32
32
  def url_for
33
- @old_crypto.url_for prepare_options(@options).merge({:image => @image, :filters => @filters})
33
+ @old_crypto.url_for prepare_options(@options).merge({image: @image, filters: @filters})
34
34
  end
35
35
 
36
36
  def generate
37
- @old_crypto.generate prepare_options(@options).merge({:image => @image, :filters => @filters})
37
+ @old_crypto.generate prepare_options(@options).merge({image: @image, filters: @filters})
38
38
  end
39
39
 
40
40
  def method_missing(m, *args)
@@ -67,4 +67,4 @@ module Thumbor
67
67
  end
68
68
  end
69
69
  end
70
- end
70
+ end
@@ -136,6 +136,12 @@ module Thumbor
136
136
 
137
137
  url_parts = Array.new
138
138
 
139
+ if options[:trim]
140
+ trim_options = ['trim']
141
+ trim_options << options[:trim] unless options[:trim] == true or options[:trim][0] == true
142
+ url_parts.push(trim_options.join(':'))
143
+ end
144
+
139
145
  if options[:meta]
140
146
  url_parts.push('meta')
141
147
  end
@@ -172,12 +178,6 @@ module Thumbor
172
178
  url_parts.push('smart')
173
179
  end
174
180
 
175
- if options[:trim]
176
- trim_options = ['trim']
177
- trim_options << options[:trim] unless options[:trim] == true or options[:trim][0] == true
178
- url_parts.push(trim_options.join(':'))
179
- end
180
-
181
181
  if options[:filters] && !options[:filters].empty?
182
182
  filter_parts = []
183
183
  options[:filters].each do |filter|
@@ -1,3 +1,3 @@
1
1
  module Thumbor
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
@@ -1,15 +1,11 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
- $LOAD_PATH.unshift(File.dirname(__FILE__))
1
+ require 'simplecov'
3
2
 
4
- if /^1\.9/ === RUBY_VERSION
5
- require 'simplecov'
6
-
7
- SimpleCov.start do
8
- add_filter '/spec/'
9
- end
3
+ SimpleCov.start do
4
+ add_filter '/spec/'
10
5
  end
11
6
 
12
- RSpec.configure do |c|
7
+
8
+ RSpec.configure do |c|
13
9
  c.filter_run :focus => true
14
10
  c.run_all_when_everything_filtered = true
15
11
  end
@@ -142,6 +142,13 @@ describe Thumbor::CryptoURL do
142
142
  url.should == 'trim:bottom-right:15/' << image_md5
143
143
  end
144
144
 
145
+ it "should have the trim option as the first one" do
146
+ url = subject.url_for :image => image_url, :smart => true, :trim => true
147
+
148
+ url.should == 'trim/smart/f33af67e41168e80fcc5b00f8bd8061a'
149
+ end
150
+
151
+
145
152
  it "should have the right crop when cropping horizontally and given a left center" do
146
153
  url = subject.url_for :image => image_url, :original_width => 100, :original_height => 100, :width => 40, :height => 50, :center => [0, 50]
147
154
  url.should == '0x0:80x100/40x50/' << image_md5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-thumbor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernardo Heynemann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-02 00:00:00.000000000 Z
11
+ date: 2014-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 2.0.6
78
+ rubygems_version: 2.1.11
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: ruby-thumbor is the client to the thumbor imaging service (http://github.com/globocom/thumbor).