ruby-thumbor 2.0.1 → 4.0.2
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 +5 -5
- data/README.md +91 -0
- data/lib/ruby-thumbor.rb +2 -1
- data/lib/thumbor/cascade.rb +31 -27
- data/lib/thumbor/crypto_url.rb +154 -198
- data/lib/thumbor/version.rb +3 -1
- data/spec/spec_helper.rb +19 -3
- data/spec/thumbor/cascade_spec.rb +189 -366
- metadata +49 -71
- data/README.rdoc +0 -102
- data/spec/thumbor/crypto_url_spec.rb +0 -482
- data/spec/util/thumbor.rb +0 -7
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-thumbor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernardo Heynemann
|
@@ -9,144 +9,125 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ">="
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '0'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ">="
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '0'
|
28
|
-
- !ruby/object:Gem::Dependency
|
29
|
-
name: simplecov
|
30
|
-
requirement: !ruby/object:Gem::Requirement
|
31
|
-
requirements:
|
32
|
-
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
34
|
-
version: '0'
|
35
|
-
type: :development
|
36
|
-
prerelease: false
|
37
|
-
version_requirements: !ruby/object:Gem::Requirement
|
38
|
-
requirements:
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: '0'
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: guard-rspec
|
15
|
+
name: code-scanning-rubocop
|
44
16
|
requirement: !ruby/object:Gem::Requirement
|
45
17
|
requirements:
|
46
|
-
- - "
|
18
|
+
- - "~>"
|
47
19
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
20
|
+
version: 0.5.0
|
49
21
|
type: :development
|
50
22
|
prerelease: false
|
51
23
|
version_requirements: !ruby/object:Gem::Requirement
|
52
24
|
requirements:
|
53
|
-
- - "
|
25
|
+
- - "~>"
|
54
26
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
27
|
+
version: 0.5.0
|
56
28
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
29
|
+
name: rake
|
58
30
|
requirement: !ruby/object:Gem::Requirement
|
59
31
|
requirements:
|
60
32
|
- - "~>"
|
61
33
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0
|
34
|
+
version: '13.0'
|
63
35
|
type: :development
|
64
36
|
prerelease: false
|
65
37
|
version_requirements: !ruby/object:Gem::Requirement
|
66
38
|
requirements:
|
67
39
|
- - "~>"
|
68
40
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0
|
41
|
+
version: '13.0'
|
70
42
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
43
|
+
name: rspec
|
72
44
|
requirement: !ruby/object:Gem::Requirement
|
73
45
|
requirements:
|
74
46
|
- - "~>"
|
75
47
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
48
|
+
version: '3.10'
|
77
49
|
type: :development
|
78
50
|
prerelease: false
|
79
51
|
version_requirements: !ruby/object:Gem::Requirement
|
80
52
|
requirements:
|
81
53
|
- - "~>"
|
82
54
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
55
|
+
version: '3.10'
|
84
56
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
57
|
+
name: rubocop-rspec
|
86
58
|
requirement: !ruby/object:Gem::Requirement
|
87
59
|
requirements:
|
88
|
-
- - "
|
60
|
+
- - "~>"
|
89
61
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
62
|
+
version: 2.8.0
|
91
63
|
type: :development
|
92
64
|
prerelease: false
|
93
65
|
version_requirements: !ruby/object:Gem::Requirement
|
94
66
|
requirements:
|
95
|
-
- - "
|
67
|
+
- - "~>"
|
96
68
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
69
|
+
version: 2.8.0
|
98
70
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
71
|
+
name: simplecov
|
100
72
|
requirement: !ruby/object:Gem::Requirement
|
101
73
|
requirements:
|
102
|
-
- - "
|
74
|
+
- - "~>"
|
103
75
|
- !ruby/object:Gem::Version
|
104
|
-
version:
|
76
|
+
version: 0.21.2
|
105
77
|
type: :development
|
106
78
|
prerelease: false
|
107
79
|
version_requirements: !ruby/object:Gem::Requirement
|
108
80
|
requirements:
|
109
|
-
- - "
|
81
|
+
- - "~>"
|
110
82
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
83
|
+
version: 0.21.2
|
112
84
|
- !ruby/object:Gem::Dependency
|
113
|
-
name:
|
85
|
+
name: simplecov-lcov
|
114
86
|
requirement: !ruby/object:Gem::Requirement
|
115
87
|
requirements:
|
116
|
-
- - "
|
88
|
+
- - "~>"
|
117
89
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
90
|
+
version: 0.8.0
|
119
91
|
type: :development
|
120
92
|
prerelease: false
|
121
93
|
version_requirements: !ruby/object:Gem::Requirement
|
122
94
|
requirements:
|
123
|
-
- - "
|
95
|
+
- - "~>"
|
124
96
|
- !ruby/object:Gem::Version
|
125
|
-
version:
|
126
|
-
description: ruby-thumbor is the client to the thumbor imaging service (http://github.com/
|
97
|
+
version: 0.8.0
|
98
|
+
description: ruby-thumbor is the client to the thumbor imaging service (http://github.com/thumbor/thumbor).
|
127
99
|
email:
|
128
100
|
- heynemann@gmail.com
|
129
|
-
-
|
101
|
+
- guilherme@souza.tech
|
130
102
|
executables: []
|
131
103
|
extensions: []
|
132
|
-
extra_rdoc_files:
|
104
|
+
extra_rdoc_files:
|
105
|
+
- README.md
|
133
106
|
files:
|
134
|
-
- README.
|
107
|
+
- README.md
|
135
108
|
- lib/ruby-thumbor.rb
|
136
109
|
- lib/thumbor/cascade.rb
|
137
110
|
- lib/thumbor/crypto_url.rb
|
138
111
|
- lib/thumbor/version.rb
|
139
112
|
- spec/spec_helper.rb
|
140
113
|
- spec/thumbor/cascade_spec.rb
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
114
|
+
homepage: http://github.com/thumbor/ruby-thumbor
|
115
|
+
licenses:
|
116
|
+
- MIT
|
117
|
+
metadata:
|
118
|
+
bug_tracker_uri: https://github.com/thumbor/ruby-thumbor/issues
|
119
|
+
documentation_uri: https://www.rubydoc.info/gems/ruby-thumbor
|
120
|
+
homepage_uri: http://github.com/thumbor/ruby-thumbor
|
121
|
+
source_code_uri: https://github.com/thumbor/ruby-thumbor
|
146
122
|
post_install_message:
|
147
123
|
rdoc_options:
|
124
|
+
- "--title"
|
125
|
+
- Ruby-Thumbor
|
148
126
|
- "--main"
|
149
|
-
- README.
|
127
|
+
- README.md
|
128
|
+
- "--line-numbers"
|
129
|
+
- "--inline-source"
|
130
|
+
- "--quiet"
|
150
131
|
require_paths:
|
151
132
|
- lib
|
152
133
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -160,13 +141,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
141
|
- !ruby/object:Gem::Version
|
161
142
|
version: '0'
|
162
143
|
requirements: []
|
163
|
-
|
164
|
-
rubygems_version: 2.4.3
|
144
|
+
rubygems_version: 3.3.3
|
165
145
|
signing_key:
|
166
146
|
specification_version: 4
|
167
|
-
summary: ruby-thumbor is the client to the thumbor imaging service (http://github.com/
|
147
|
+
summary: ruby-thumbor is the client to the thumbor imaging service (http://github.com/thumbor/thumbor).
|
168
148
|
test_files:
|
169
149
|
- spec/spec_helper.rb
|
170
150
|
- spec/thumbor/cascade_spec.rb
|
171
|
-
- spec/thumbor/crypto_url_spec.rb
|
172
|
-
- spec/util/thumbor.rb
|
data/README.rdoc
DELETED
@@ -1,102 +0,0 @@
|
|
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] {<img src="https://coveralls.io/repos/thumbor/ruby-thumbor/badge.svg?branch=master&service=github" alt="Coverage Status" />}[https://coveralls.io/github/thumbor/ruby-thumbor?branch=master]
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
* http://github.com/thumbor/ruby-thumbor
|
6
|
-
|
7
|
-
== DESCRIPTION:
|
8
|
-
|
9
|
-
ruby-thumbor is the client to the thumbor imaging service (http://github.com/thumbor/thumbor).
|
10
|
-
|
11
|
-
== FEATURES:
|
12
|
-
|
13
|
-
* Generate thumbor encrypted URLs
|
14
|
-
* Obtain metadata from image operations in thumbor
|
15
|
-
|
16
|
-
== DEPENDENCIES
|
17
|
-
|
18
|
-
No dependencies required for regular usage.
|
19
|
-
|
20
|
-
* thumbor (http://github.com/thumbor/thumbor) for running ruby-thumbor tests.
|
21
|
-
|
22
|
-
== INSTALL:
|
23
|
-
|
24
|
-
gem install ruby-thumbor
|
25
|
-
|
26
|
-
gem 'ruby-thumbor'
|
27
|
-
|
28
|
-
== BREAKING CHANGE ON 2.0:
|
29
|
-
|
30
|
-
Thumbor::Cascade.new now gets key, image
|
31
|
-
|
32
|
-
== USAGE:
|
33
|
-
|
34
|
-
require 'ruby-thumbor'
|
35
|
-
|
36
|
-
crypto = Thumbor::CryptoURL.new 'my-security-key'
|
37
|
-
|
38
|
-
url = crypto.generate :width => 200, :height => 300, :image => 'my.server.com/path/to/image.jpg'
|
39
|
-
|
40
|
-
# url will contain something like:
|
41
|
-
# /2913921in321n3k2nj32hjhj3h22/my.server.com/path/to/image.jpg
|
42
|
-
|
43
|
-
or
|
44
|
-
|
45
|
-
require 'ruby-thumbor'
|
46
|
-
|
47
|
-
image = Thumbor::Cascade.new('my-security-key', 'my.server.com/path/to/image.jpg')
|
48
|
-
image.width(300).height(200).watermark_filter('http://my-server.com/image.png', 30).generate
|
49
|
-
|
50
|
-
Available arguments to the generate method:
|
51
|
-
|
52
|
-
:meta => bool - flag that indicates that thumbor should return only meta-data on the operations it would
|
53
|
-
otherwise perform;
|
54
|
-
|
55
|
-
:crop => [<int>, <int>, <int>, <int>] - Coordinates for manual cropping. The first item is the two arguments are
|
56
|
-
the coordinates for the left, top point and the last two are the coordinates
|
57
|
-
for the right, bottom point (thus forming the square to crop);
|
58
|
-
|
59
|
-
:width => <int> - the width for the thumbnail;
|
60
|
-
|
61
|
-
:height => <int> - the height for the thumbnail;
|
62
|
-
|
63
|
-
:flip => <bool> - flag that indicates that thumbor should flip horizontally (on the vertical axis) the image;
|
64
|
-
|
65
|
-
:flop => <bool> - flag that indicates that thumbor should flip vertically (on the horizontal axis) the image;
|
66
|
-
|
67
|
-
:halign => :left, :center or :right - horizontal alignment that thumbor should use for cropping;
|
68
|
-
|
69
|
-
:valign => :top, :middle or :bottom - horizontal alignment that thumbor should use for cropping;
|
70
|
-
|
71
|
-
:smart => <bool> - flag that indicates that thumbor should use smart cropping;
|
72
|
-
|
73
|
-
If you need more info on what each option does, check thumbor's documentation at https://github.com/thumbor/thumbor/wiki.
|
74
|
-
|
75
|
-
== CONTRIBUTIONS:
|
76
|
-
|
77
|
-
* Hugo Lopes (hugobr) - Fixes in the usage readme part of the docs.
|
78
|
-
|
79
|
-
== LICENSE:
|
80
|
-
|
81
|
-
(The MIT License)
|
82
|
-
|
83
|
-
Copyright (c) 2011 Bernardo Heynemann <heynemann@gmail.com>
|
84
|
-
|
85
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
86
|
-
a copy of this software and associated documentation files (the
|
87
|
-
'Software'), to deal in the Software without restriction, including
|
88
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
89
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
90
|
-
permit persons to whom the Software is furnished to do so, subject to
|
91
|
-
the following conditions:
|
92
|
-
|
93
|
-
The above copyright notice and this permission notice shall be
|
94
|
-
included in all copies or substantial portions of the Software.
|
95
|
-
|
96
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
97
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
98
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
99
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
100
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
101
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
102
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|