From 52f6fbd01b73fdee632b9c87048981651f91d267 Mon Sep 17 00:00:00 2001 From: Dani Date: Sat, 7 Jun 2014 17:18:42 +0100 Subject: [PATCH 1/2] Image upload should return an Image object After calling upload, it tries to call the method gallery_images on the client, which doesn't exist. Wrap the response hash to become an Image instead. --- lib/imgur/models/image.rb | 2 +- lib/imgur/models/images.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/imgur/models/image.rb b/lib/imgur/models/image.rb index 0dc5117..6829779 100644 --- a/lib/imgur/models/image.rb +++ b/lib/imgur/models/image.rb @@ -24,6 +24,6 @@ def delete def add_to_gallery(options = {}) data = connection.add_to_gallery(id, options).body['data'] - connection.gallery_images.new(data) + new(data) end end diff --git a/lib/imgur/models/images.rb b/lib/imgur/models/images.rb index 1b097b3..fc6109c 100644 --- a/lib/imgur/models/images.rb +++ b/lib/imgur/models/images.rb @@ -27,7 +27,7 @@ def upload(options={}) raise ArgumentError, "Invalid image value" end data = connection.upload_image(options).body["data"] - connection.gallery_images.new(data) + new(data) end private From 8bdfb78a7f0f094140b60f800e06cd2921f3d2e3 Mon Sep 17 00:00:00 2001 From: Dani Date: Sat, 7 Jun 2014 17:19:16 +0100 Subject: [PATCH 2/2] Bump version --- lib/imgur/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/imgur/version.rb b/lib/imgur/version.rb index b9cecef..e5b6017 100644 --- a/lib/imgur/version.rb +++ b/lib/imgur/version.rb @@ -1,3 +1,3 @@ module Imgur - VERSION = "0.04" + VERSION = '0.05' end