ruby-thumbor 1.2.0 → 1.2.1
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 +4 -4
- data/lib/thumbor/cascade.rb +3 -3
- data/lib/thumbor/crypto_url.rb +6 -6
- data/lib/thumbor/version.rb +1 -1
- data/spec/spec_helper.rb +5 -9
- data/spec/thumbor/crypto_url_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf79ac9182e85f40ddc5c7366b08cd62bc662ad5
|
4
|
+
data.tar.gz: 2473d2976870e9a63ca1beb976106a1d4ceb2f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e039b98cc404a999c945c515db22b8c81641b27186b035d77bcbd19d91a79f412f6273eb4ef9978b081a1393092cc7347d57e754ab172d7c43bb313b621cfe86
|
7
|
+
data.tar.gz: 9cabebf6eac09cca9129b667322809485c67282dae83f6450b242d1dd190b7caa6e84fb56560db5bba34dfb618459e4c34886459190a7b692ade3598e34f258d
|
data/lib/thumbor/cascade.rb
CHANGED
@@ -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({:
|
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({:
|
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
|
data/lib/thumbor/crypto_url.rb
CHANGED
@@ -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|
|
data/lib/thumbor/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,15 +1,11 @@
|
|
1
|
-
|
2
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
1
|
+
require 'simplecov'
|
3
2
|
|
4
|
-
|
5
|
-
|
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
|
-
|
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.
|
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:
|
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.
|
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).
|