imager 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +1 -1
- data/imager.gemspec +9 -8
- data/lib/imager/server_client.rb +3 -3
- data/lib/imager/server_interface.rb +41 -45
- data/lib/imager/version.rb +1 -1
- data/spec/fixtures/imagerserver_cassettes/invalid_album_and_collection_post.yml +17 -8498
- data/spec/fixtures/imagerserver_cassettes/no_image_delete.yml +21 -15
- data/spec/fixtures/imagerserver_cassettes/valid_delete.yml +19 -13
- data/spec/fixtures/imagerserver_cassettes/valid_post.yml +21 -8500
- data/spec/fixtures/imagerserver_cassettes/valid_post_with_file.yml +21 -8500
- data/spec/fixtures/imagerserver_cassettes/valid_post_with_io.yml +21 -8500
- data/spec/imager/link_helper_spec.rb +1 -1
- data/spec/imager/server_interface_spec.rb +7 -7
- data/spec/imager_spec.rb +5 -5
- data/spec/spec_helper.rb +3 -5
- metadata +133 -142
@@ -11,7 +11,7 @@ describe Imager::LinkHelper do
|
|
11
11
|
correct_link = "http://base_uri/images/testcollection/1/image/small.jpg"
|
12
12
|
result = described_class.link_for("testcollection", "1", "image", :small)
|
13
13
|
|
14
|
-
result.
|
14
|
+
expect(result).to eq correct_link
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
@@ -3,20 +3,20 @@ require 'spec_helper'
|
|
3
3
|
describe Imager::ServerInterface do
|
4
4
|
let(:some_image){ "spec/image.jpg" }
|
5
5
|
let(:some_image_file) { File.new(some_image) }
|
6
|
-
let(:some_image_io) {
|
6
|
+
let(:some_image_io) { Rack::Test::UploadedFile.new(some_image_file, "application/octet-stream") }
|
7
7
|
describe ".post" do
|
8
8
|
|
9
9
|
context "when params are valid" do
|
10
10
|
it "returns true" do
|
11
11
|
VCR.use_cassette('valid_post') do
|
12
|
-
described_class.post("test", "1", some_image, small: { width: 100 }).
|
12
|
+
expect(described_class.post("test", "1", some_image, small: { width: 100 })).to be_truthy
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
context "when image is a file" do
|
17
17
|
it "returns true" do
|
18
18
|
VCR.use_cassette('valid_post_with_file') do
|
19
|
-
described_class.post("test", "1", some_image_file, small: { width: 100 }).
|
19
|
+
expect(described_class.post("test", "1", some_image_file, small: { width: 100 })).to be_truthy
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -24,7 +24,7 @@ describe Imager::ServerInterface do
|
|
24
24
|
context "when image is a IO" do
|
25
25
|
it "returns true" do
|
26
26
|
VCR.use_cassette('valid_post_with_io') do
|
27
|
-
described_class.post("test", "1", some_image_io, small: { width: 100 }).
|
27
|
+
expect(described_class.post("test", "1", some_image_io, small: { width: 100 })).to be_truthy
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -43,7 +43,7 @@ describe Imager::ServerInterface do
|
|
43
43
|
it "raises an error" do
|
44
44
|
VCR.use_cassette('invalid_album_and_collection_post') do
|
45
45
|
expect {
|
46
|
-
described_class.post("", "",
|
46
|
+
described_class.post("", "", some_image_io, size: { width: 100 })
|
47
47
|
}.to raise_error Imager::ImagerError
|
48
48
|
end
|
49
49
|
end
|
@@ -55,10 +55,10 @@ describe Imager::ServerInterface do
|
|
55
55
|
|
56
56
|
it "returns true" do
|
57
57
|
VCR.use_cassette('valid_post') do
|
58
|
-
described_class.post("test", "1",
|
58
|
+
described_class.post("test", "1", some_image_io, small: { width: 100 })
|
59
59
|
end
|
60
60
|
VCR.use_cassette('valid_delete') do
|
61
|
-
described_class.delete("test", "1", "image").
|
61
|
+
expect(described_class.delete("test", "1", "image")).to be_truthy
|
62
62
|
end
|
63
63
|
end
|
64
64
|
end
|
data/spec/imager_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe Imager do
|
|
5
5
|
|
6
6
|
it "yields" do
|
7
7
|
described_class.configure do |c|
|
8
|
-
c.
|
8
|
+
expect(c).to be described_class
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -14,7 +14,7 @@ describe Imager do
|
|
14
14
|
c.base_uri = "http://baseuri.bla/"
|
15
15
|
end
|
16
16
|
|
17
|
-
described_class.base_uri.
|
17
|
+
expect(described_class.base_uri).to eq "http://baseuri.bla/"
|
18
18
|
end
|
19
19
|
|
20
20
|
it "sets manager_path" do
|
@@ -22,7 +22,7 @@ describe Imager do
|
|
22
22
|
c.manager_path = "manager_path"
|
23
23
|
end
|
24
24
|
|
25
|
-
described_class.manager_path.
|
25
|
+
expect(described_class.manager_path).to eq "manager_path"
|
26
26
|
end
|
27
27
|
|
28
28
|
it "sets collection_path" do
|
@@ -30,7 +30,7 @@ describe Imager do
|
|
30
30
|
c.collection_path = "your_collections_path"
|
31
31
|
end
|
32
32
|
|
33
|
-
described_class.collection_path.
|
33
|
+
expect(described_class.collection_path).to eq "your_collections_path"
|
34
34
|
end
|
35
35
|
|
36
36
|
it "sets auth_code" do
|
@@ -38,7 +38,7 @@ describe Imager do
|
|
38
38
|
c.auth_code = "your_auth_code"
|
39
39
|
end
|
40
40
|
|
41
|
-
described_class.auth_code.
|
41
|
+
expect(described_class.auth_code).to eq "your_auth_code"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,17 +2,15 @@ require 'imager'
|
|
2
2
|
|
3
3
|
#dependencies
|
4
4
|
require 'minitest/autorun'
|
5
|
-
require 'webmock/
|
5
|
+
require 'webmock/rspec'
|
6
6
|
require 'vcr'
|
7
7
|
require 'turn'
|
8
|
-
|
9
|
-
# Hack for HTTMultiParty And VCR
|
10
|
-
require 'support/httmultiparty'
|
8
|
+
require "rack/test"
|
11
9
|
|
12
10
|
RSpec.configure do |c|
|
13
11
|
c.before do
|
14
12
|
Imager.configure do |c|
|
15
|
-
c.base_uri = "http://
|
13
|
+
c.base_uri = "http://localhost/imagerserver"
|
16
14
|
c.auth_code = "ABCDE"
|
17
15
|
c.collection_path = "images"
|
18
16
|
c.manager_path = "manager"
|
metadata
CHANGED
@@ -1,149 +1,150 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: imager
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 5
|
10
|
-
version: 0.0.5
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.6
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Guilherme Otranto
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2019-06-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
21
14
|
name: bundler
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 2609263317959306961
|
29
|
-
segments:
|
30
|
-
- 1
|
31
|
-
- 3
|
32
|
-
version: "1.3"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
33
20
|
type: :development
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rake
|
37
21
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '12'
|
47
34
|
type: :development
|
48
|
-
version_requirements: *id002
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: rspec
|
51
35
|
prerelease: false
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.8'
|
61
48
|
type: :development
|
62
|
-
version_requirements: *id003
|
63
|
-
- !ruby/object:Gem::Dependency
|
64
|
-
name: webmock
|
65
49
|
prerelease: false
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.8'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.6'
|
75
62
|
type: :development
|
76
|
-
version_requirements: *id004
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
name: vcr
|
79
63
|
prerelease: false
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.6'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: vcr
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '5.0'
|
89
76
|
type: :development
|
90
|
-
|
91
|
-
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '5.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
92
84
|
name: turn
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.9'
|
90
|
+
type: :development
|
93
91
|
prerelease: false
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.9'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rack-test
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1.1'
|
103
104
|
type: :development
|
104
|
-
version_requirements: *id006
|
105
|
-
- !ruby/object:Gem::Dependency
|
106
|
-
name: httmultiparty
|
107
105
|
prerelease: false
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.1'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: httparty
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.17'
|
119
118
|
type: :runtime
|
120
|
-
version_requirements: *id007
|
121
|
-
- !ruby/object:Gem::Dependency
|
122
|
-
name: json
|
123
119
|
prerelease: false
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.17'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: json
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.2'
|
133
132
|
type: :runtime
|
134
|
-
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2.2'
|
135
139
|
description: A remote storange and resizer client for images.
|
136
|
-
email:
|
140
|
+
email:
|
137
141
|
- guilherme_otran@hotmail.com
|
138
142
|
executables: []
|
139
|
-
|
140
143
|
extensions: []
|
141
|
-
|
142
144
|
extra_rdoc_files: []
|
143
|
-
|
144
|
-
|
145
|
-
- .
|
146
|
-
- .travis.yml
|
145
|
+
files:
|
146
|
+
- ".gitignore"
|
147
|
+
- ".travis.yml"
|
147
148
|
- Gemfile
|
148
149
|
- LICENSE.txt
|
149
150
|
- README.md
|
@@ -168,39 +169,29 @@ files:
|
|
168
169
|
- spec/spec_helper.rb
|
169
170
|
- spec/support/httmultiparty.rb
|
170
171
|
homepage: https://github.com/guilherme-otran/Imager
|
171
|
-
licenses:
|
172
|
+
licenses:
|
172
173
|
- MIT
|
174
|
+
metadata: {}
|
173
175
|
post_install_message:
|
174
176
|
rdoc_options: []
|
175
|
-
|
176
|
-
require_paths:
|
177
|
+
require_paths:
|
177
178
|
- lib
|
178
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
179
|
-
|
180
|
-
requirements:
|
179
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
180
|
+
requirements:
|
181
181
|
- - ">="
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
version: "0"
|
187
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
|
-
none: false
|
189
|
-
requirements:
|
182
|
+
- !ruby/object:Gem::Version
|
183
|
+
version: '0'
|
184
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
|
+
requirements:
|
190
186
|
- - ">="
|
191
|
-
- !ruby/object:Gem::Version
|
192
|
-
|
193
|
-
segments:
|
194
|
-
- 0
|
195
|
-
version: "0"
|
187
|
+
- !ruby/object:Gem::Version
|
188
|
+
version: '0'
|
196
189
|
requirements: []
|
197
|
-
|
198
|
-
rubyforge_project:
|
199
|
-
rubygems_version: 1.8.25
|
190
|
+
rubygems_version: 3.0.1
|
200
191
|
signing_key:
|
201
|
-
specification_version:
|
192
|
+
specification_version: 4
|
202
193
|
summary: Imager Client API
|
203
|
-
test_files:
|
194
|
+
test_files:
|
204
195
|
- spec/fixtures/imagerserver_cassettes/invalid_album_and_collection_post.yml
|
205
196
|
- spec/fixtures/imagerserver_cassettes/no_image_delete.yml
|
206
197
|
- spec/fixtures/imagerserver_cassettes/valid_delete.yml
|