grin 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.
- data/lib/grin/album.rb +1 -1
- data/lib/grin/client.rb +4 -4
- data/test/test_grin.rb +2 -2
- metadata +3 -3
data/lib/grin/album.rb
CHANGED
data/lib/grin/client.rb
CHANGED
@@ -18,7 +18,7 @@ module Grin
|
|
18
18
|
|
19
19
|
def album(id)
|
20
20
|
album = get("albums/#{id}.json")
|
21
|
-
if album.respond_to?(:[]) && album['
|
21
|
+
if album.respond_to?(:[]) && album['result'] == 'failure'
|
22
22
|
return album
|
23
23
|
else
|
24
24
|
Album.new(album)
|
@@ -27,7 +27,7 @@ module Grin
|
|
27
27
|
|
28
28
|
def create_album(title, category_id = categories.first.id)
|
29
29
|
album = post("albums.json", { :album => { :title => title, :category_id => category_id } })
|
30
|
-
if album.respond_to?(:[]) && album['
|
30
|
+
if album.respond_to?(:[]) && album['result'] == 'failure'
|
31
31
|
return album
|
32
32
|
else
|
33
33
|
Album.new(album)
|
@@ -50,7 +50,7 @@ module Grin
|
|
50
50
|
|
51
51
|
def category(id)
|
52
52
|
category = get("categories/#{id}.json")
|
53
|
-
if category.respond_to?(:[]) && category['
|
53
|
+
if category.respond_to?(:[]) && category['result'] == 'failure'
|
54
54
|
return category
|
55
55
|
else
|
56
56
|
Category.new(category)
|
@@ -59,7 +59,7 @@ module Grin
|
|
59
59
|
|
60
60
|
def create_category(name)
|
61
61
|
category = post("categories.json", { :category => { :name => name } })
|
62
|
-
if category.respond_to?(:[]) && category['
|
62
|
+
if category.respond_to?(:[]) && category['result'] == 'failure'
|
63
63
|
return category
|
64
64
|
else
|
65
65
|
Category.new(category)
|
data/test/test_grin.rb
CHANGED
@@ -43,8 +43,8 @@ class TestGrin < Test::Unit::TestCase
|
|
43
43
|
should "delete the album followed by the category" do
|
44
44
|
album_response = @album.destroy
|
45
45
|
category_response = @category.destroy
|
46
|
-
assert_equal "
|
47
|
-
assert_equal "
|
46
|
+
assert_equal "success", album_response['result']
|
47
|
+
assert_equal "success", category_response['result']
|
48
48
|
end
|
49
49
|
|
50
50
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 1
|
9
|
+
version: 1.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- James Miller
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-09-
|
17
|
+
date: 2010-09-10 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|