resizor 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/resizor/asset.rb +1 -1
- data/lib/resizor/version.rb +1 -1
- data/test/asset_test.rb +4 -0
- metadata +62 -69
data/lib/resizor/asset.rb
CHANGED
@@ -8,7 +8,7 @@ module Resizor
|
|
8
8
|
|
9
9
|
def url(options={})
|
10
10
|
options = {:size => '200', :format => 'jpg'}.merge(options)
|
11
|
-
"#{Resizor.api_url(true)}/assets/#{id}.#{options[:format]}?size=#{options[:size]}&token=#{resize_token_for(options)}"
|
11
|
+
"#{Resizor.api_url(true)}/assets/#{id}.#{options[:format]}?size=#{options[:size]}#{"&cutout="+options[:cutout] if options[:cutout]}&token=#{resize_token_for(options)}"
|
12
12
|
end
|
13
13
|
|
14
14
|
def resize_token_for(options={})
|
data/lib/resizor/version.rb
CHANGED
data/test/asset_test.rb
CHANGED
@@ -32,6 +32,10 @@ class ResizorAssetTest < Test::Unit::TestCase
|
|
32
32
|
assert_equal 'b8bb7c4c7c4fc1006c904f011f32f50f69730e5e', @asset.resize_token_for(:size => 'c200x300', :format => 'jpg')
|
33
33
|
end
|
34
34
|
|
35
|
+
should 'generate url for size c200x300 with cutout 300x200-30x40' do
|
36
|
+
assert_equal 'http://resizor.test:80/assets/10.jpg?size=c200x300&cutout=300x200-30x40&token=b8bb7c4c7c4fc1006c904f011f32f50f69730e5e', @asset.url(:size => 'c200x300', :cutout => '300x200-30x40')
|
37
|
+
end
|
38
|
+
|
35
39
|
context 'when saving to resizor' do
|
36
40
|
setup do
|
37
41
|
@jpg_file = Tempfile.new('image.jpg')
|
metadata
CHANGED
@@ -1,94 +1,91 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: resizor
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.9
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.8
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Winston Design
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2011-06-15 00:00:00 +02:00
|
12
|
+
date: 2011-07-08 00:00:00.000000000 +02:00
|
14
13
|
default_executable:
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
17
16
|
name: bundler
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
17
|
+
requirement: &2154323140 !ruby/object:Gem::Requirement
|
20
18
|
none: false
|
21
|
-
requirements:
|
22
|
-
- -
|
23
|
-
- !ruby/object:Gem::Version
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
24
22
|
version: 1.0.0
|
25
23
|
type: :development
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: shoulda
|
29
24
|
prerelease: false
|
30
|
-
|
25
|
+
version_requirements: *2154323140
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: shoulda
|
28
|
+
requirement: &2154322660 !ruby/object:Gem::Requirement
|
31
29
|
none: false
|
32
|
-
requirements:
|
33
|
-
- -
|
34
|
-
- !ruby/object:Gem::Version
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
35
33
|
version: 2.11.3
|
36
34
|
type: :development
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: webmock
|
40
35
|
prerelease: false
|
41
|
-
|
36
|
+
version_requirements: *2154322660
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: webmock
|
39
|
+
requirement: &2154322140 !ruby/object:Gem::Requirement
|
42
40
|
none: false
|
43
|
-
requirements:
|
44
|
-
- -
|
45
|
-
- !ruby/object:Gem::Version
|
41
|
+
requirements:
|
42
|
+
- - ! '>='
|
43
|
+
- !ruby/object:Gem::Version
|
46
44
|
version: 1.6.2
|
47
45
|
type: :development
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: activerecord
|
51
46
|
prerelease: false
|
52
|
-
|
47
|
+
version_requirements: *2154322140
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: activerecord
|
50
|
+
requirement: &2154321640 !ruby/object:Gem::Requirement
|
53
51
|
none: false
|
54
|
-
requirements:
|
52
|
+
requirements:
|
55
53
|
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
54
|
+
- !ruby/object:Gem::Version
|
57
55
|
version: 3.0.0
|
58
56
|
type: :development
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: rest-client
|
62
57
|
prerelease: false
|
63
|
-
|
58
|
+
version_requirements: *2154321640
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: rest-client
|
61
|
+
requirement: &2154321140 !ruby/object:Gem::Requirement
|
64
62
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
68
66
|
version: 1.4.2
|
69
67
|
type: :runtime
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: json
|
73
68
|
prerelease: false
|
74
|
-
|
69
|
+
version_requirements: *2154321140
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: json
|
72
|
+
requirement: &2154320600 !ruby/object:Gem::Requirement
|
75
73
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version:
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.2'
|
80
78
|
type: :runtime
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *2154320600
|
81
|
+
description: Lets you easily interface with Resizor.com's REST API. Includes Rails
|
82
|
+
helpers.
|
83
|
+
email:
|
84
84
|
- hello@resizor.com
|
85
85
|
executables: []
|
86
|
-
|
87
86
|
extensions: []
|
88
|
-
|
89
87
|
extra_rdoc_files: []
|
90
|
-
|
91
|
-
files:
|
88
|
+
files:
|
92
89
|
- test/asset_test.rb
|
93
90
|
- test/database.yml
|
94
91
|
- test/debug.log
|
@@ -111,30 +108,26 @@ files:
|
|
111
108
|
has_rdoc: true
|
112
109
|
homepage: http://github.org/winstondesign/resizor-gem
|
113
110
|
licenses: []
|
114
|
-
|
115
111
|
post_install_message:
|
116
112
|
rdoc_options: []
|
117
|
-
|
118
|
-
require_paths:
|
113
|
+
require_paths:
|
119
114
|
- lib
|
120
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
116
|
none: false
|
122
|
-
requirements:
|
123
|
-
- -
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version:
|
126
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
|
+
requirements:
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
121
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
127
122
|
none: false
|
128
|
-
requirements:
|
129
|
-
- -
|
130
|
-
- !ruby/object:Gem::Version
|
123
|
+
requirements:
|
124
|
+
- - ! '>='
|
125
|
+
- !ruby/object:Gem::Version
|
131
126
|
version: 1.3.6
|
132
127
|
requirements: []
|
133
|
-
|
134
128
|
rubyforge_project:
|
135
129
|
rubygems_version: 1.6.2
|
136
130
|
signing_key:
|
137
131
|
specification_version: 3
|
138
132
|
summary: Client for Resizor.com API
|
139
133
|
test_files: []
|
140
|
-
|