giddy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- giddy (0.1.1)
4
+ giddy (0.1.2)
5
5
  httparty (>= 0.11.0)
6
6
  json (>= 1.8.0)
7
7
 
@@ -7,4 +7,7 @@ module Giddy
7
7
 
8
8
  class InvalidUsernameOrPassword < RuntimeError
9
9
  end
10
+
11
+ class ImageDownloadError < RuntimeError
12
+ end
10
13
  end
@@ -23,7 +23,9 @@ module Giddy
23
23
  def download(size)
24
24
  sizekey = size[:size_key]
25
25
  result = downloader.get_image_download_authorizations(@attrs[:image_id], [sizekey])
26
- download_request result[sizekey][:authorizations].first[:download_token]
26
+ auths = result[sizekey][:authorizations]
27
+ raise ImageDownloadError, "No authorizations available." if auths.length == 0
28
+ download_request auths.first[:download_token]
27
29
  end
28
30
 
29
31
  def largest_available
@@ -1,3 +1,3 @@
1
1
  module Giddy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: giddy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Brian Muller
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2013-10-09 00:00:00 Z
13
+ date: 2013-10-14 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
@@ -97,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
97
  requirements:
98
98
  - - ">="
99
99
  - !ruby/object:Gem::Version
100
- hash: 1215534461732048951
100
+ hash: 1178430877288164185
101
101
  segments:
102
102
  - 0
103
103
  version: "0"
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="
108
108
  - !ruby/object:Gem::Version
109
- hash: 1215534461732048951
109
+ hash: 1178430877288164185
110
110
  segments:
111
111
  - 0
112
112
  version: "0"