imaginary 0.0.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/imaginary-client.gemspec +1 -0
- data/lib/imaginary.rb +2 -2
- data/lib/imaginary/version.rb +1 -1
- data/spec/client_spec.rb +2 -2
- metadata +18 -3
data/imaginary-client.gemspec
CHANGED
data/lib/imaginary.rb
CHANGED
@@ -18,7 +18,7 @@ module Imaginary
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def add_image_from_file(file, name = nil)
|
21
|
-
r = post("#{@base_url}
|
21
|
+
r = post("#{@base_url}buckets/#{@bucket}/images.json", body: { image: {
|
22
22
|
name: name,
|
23
23
|
image: file
|
24
24
|
}})
|
@@ -31,7 +31,7 @@ module Imaginary
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def add_image_from_url(url, name = nil)
|
34
|
-
r = post("#{@base_url}
|
34
|
+
r = post("#{@base_url}buckets/#{@bucket}/images.json", body: { image: {
|
35
35
|
name: name,
|
36
36
|
image_url: url
|
37
37
|
}})
|
data/lib/imaginary/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -16,7 +16,7 @@ describe Imaginary::Client do
|
|
16
16
|
describe '#add_image_from_url' do
|
17
17
|
it "should add the image to the server and return its name" do
|
18
18
|
FakeWeb.register_uri :post,
|
19
|
-
"http://some_user:123secret@imaginary.test.org
|
19
|
+
"http://some_user:123secret@imaginary.test.org/buckets/some_bucket/images.json",
|
20
20
|
body: '{"name": "kitten"}',
|
21
21
|
content_type: 'application/json; charset=utf-8'
|
22
22
|
|
@@ -27,7 +27,7 @@ describe Imaginary::Client do
|
|
27
27
|
describe '#add_image_from_file' do
|
28
28
|
it "should add the image to the server and return its name" do
|
29
29
|
FakeWeb.register_uri :post,
|
30
|
-
"http://some_user:123secret@imaginary.test.org
|
30
|
+
"http://some_user:123secret@imaginary.test.org/buckets/some_bucket/images.json",
|
31
31
|
body: '{"name": "hmans"}',
|
32
32
|
content_type: 'application/json; charset=utf-8'
|
33
33
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imaginary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httmultiparty
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: 0.3.8
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: httparty
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.10.0
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.10.0
|
30
46
|
- !ruby/object:Gem::Dependency
|
31
47
|
name: rspec
|
32
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,4 +122,3 @@ test_files:
|
|
106
122
|
- spec/client_spec.rb
|
107
123
|
- spec/files/hmans.jpg
|
108
124
|
- spec/spec_helper.rb
|
109
|
-
has_rdoc:
|