cloudapp_api 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -154,9 +154,9 @@ Authentication is necessary for most actions, the only exceptions being when cre
154
154
  # or
155
155
  @gift.redeem
156
156
 
157
- ## To do
157
+ ## What's next on the to-do list?
158
158
 
159
- * Much better error handling
159
+ * Refactor the Client interface so can be used with all of the API
160
160
 
161
161
  ## Note on Patches/Pull Requests
162
162
 
data/Rakefile CHANGED
@@ -13,7 +13,7 @@ require 'jeweler'
13
13
  Jeweler::Tasks.new do |gem|
14
14
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
15
  gem.name = "cloudapp_api"
16
- gem.homepage = "http://github.com/aaronrussell/cloud_app"
16
+ gem.homepage = "http://github.com/aaronrussell/cloudapp_api"
17
17
  gem.summary = %Q{A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface.}
18
18
  gem.description = %Q{A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface.}
19
19
  gem.email = "aaron@gc4.co.uk"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
data/cloudapp_api.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cloudapp_api}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Russell"]
12
- s.date = %q{2011-05-08}
12
+ s.date = %q{2011-05-17}
13
13
  s.description = %q{A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface.}
14
14
  s.email = %q{aaron@gc4.co.uk}
15
15
  s.extra_rdoc_files = [
@@ -65,9 +65,9 @@ Gem::Specification.new do |s|
65
65
  "spec/stubs/gift_card/redeem",
66
66
  "spec/stubs/gift_card/show"
67
67
  ]
68
- s.homepage = %q{http://github.com/aaronrussell/cloud_app}
68
+ s.homepage = %q{http://github.com/aaronrussell/cloudapp_api}
69
69
  s.require_paths = ["lib"]
70
- s.rubygems_version = %q{1.3.7}
70
+ s.rubygems_version = %q{1.7.2}
71
71
  s.summary = %q{A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface.}
72
72
  s.test_files = [
73
73
  "spec/cloudapp_account_spec.rb",
@@ -82,7 +82,6 @@ Gem::Specification.new do |s|
82
82
  ]
83
83
 
84
84
  if s.respond_to? :specification_version then
85
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
86
85
  s.specification_version = 3
87
86
 
88
87
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
@@ -28,13 +28,16 @@ module CloudApp
28
28
 
29
29
  def parse_errors(errors)
30
30
  return case errors
31
- when Hash: errors.collect{|k,v| "#{k}: #{v}"}
32
- when String: [errors]
33
- when Array: errors
31
+ when Hash
32
+ errors.collect{|k,v| "#{k}: #{v}"}
33
+ when String
34
+ [errors]
35
+ when Array
36
+ errors
34
37
  else []
35
38
  end
36
39
  end
37
40
 
38
41
  end
39
42
 
40
- end
43
+ end
data/lib/cloudapp_api.rb CHANGED
@@ -10,7 +10,7 @@ end
10
10
  module CloudApp
11
11
 
12
12
  # Version number
13
- VERSION = "0.3.0"
13
+ VERSION = "0.3.1"
14
14
 
15
15
  # Sets the authentication credentials in a class variable
16
16
  #
@@ -42,8 +42,6 @@ describe CloudApp::ResponseError, "when item doesn't exist" do
42
42
  end
43
43
 
44
44
 
45
- # This test will currently fail. CloudApp shouldn't return a HTML response.
46
- # In fairness it shouldn't really return a 404 either.
47
45
  describe CloudApp::ResponseError, "when updating someone elses item" do
48
46
 
49
47
  before(:each) do
@@ -52,19 +50,22 @@ describe CloudApp::ResponseError, "when updating someone elses item" do
52
50
  end
53
51
 
54
52
  it "should raise a 404" do
55
- @error.should raise_error(CloudApp::ResponseError, "404 Not Found")
53
+ pending "CloudApp shouldn't return a HTML response (or a 404 for that matter)" do
54
+ @error.should raise_error(CloudApp::ResponseError, "404 Not Found")
55
+ end
56
56
  end
57
57
 
58
58
  it "should return a code and error messages" do
59
- @error.should raise_error{|e|
60
- e.code.should == 404
61
- }
59
+ pending "CloudApp shouldn't return a HTML response (or a 404 for that matter)" do
60
+ @error.should raise_error{|e|
61
+ e.code.should == 404
62
+ }
63
+ end
62
64
  end
63
65
 
64
66
  end
65
67
 
66
68
 
67
- # This test will currently fail. CloudApp shouldn't return a HTML response.
68
69
  describe "when recovering an unrecoverable item" do
69
70
 
70
71
  before(:each) do
@@ -73,13 +74,17 @@ describe "when recovering an unrecoverable item" do
73
74
  end
74
75
 
75
76
  it "should raise a 404" do
76
- @error.should raise_error(CloudApp::ResponseError, "404 Not Found")
77
+ pending "CloudApp shouldn't return a HTML response" do
78
+ @error.should raise_error(CloudApp::ResponseError, "404 Not Found")
79
+ end
77
80
  end
78
81
 
79
82
  it "should return a code and error messages" do
80
- @error.should raise_error{|e|
81
- e.code.should == 404
82
- }
83
+ pending "CloudApp shouldn't return a HTML response" do
84
+ @error.should raise_error{|e|
85
+ e.code.should == 404
86
+ }
87
+ end
83
88
  end
84
89
 
85
90
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudapp_api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
5
- prerelease: false
4
+ hash: 17
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aaron Russell
@@ -15,11 +15,10 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-08 00:00:00 +01:00
19
- default_executable:
18
+ date: 2011-05-17 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
22
  none: false
24
23
  requirements:
25
24
  - - ">="
@@ -30,12 +29,12 @@ dependencies:
30
29
  - 6
31
30
  - 0
32
31
  version: 0.6.0
33
- type: :runtime
34
32
  name: httparty
35
33
  prerelease: false
36
- version_requirements: *id001
34
+ type: :runtime
35
+ requirement: *id001
37
36
  - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
37
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
38
  none: false
40
39
  requirements:
41
40
  - - ">="
@@ -44,12 +43,12 @@ dependencies:
44
43
  segments:
45
44
  - 0
46
45
  version: "0"
47
- type: :runtime
48
46
  name: mime-types
49
47
  prerelease: false
50
- version_requirements: *id002
48
+ type: :runtime
49
+ requirement: *id002
51
50
  - !ruby/object:Gem::Dependency
52
- requirement: &id003 !ruby/object:Gem::Requirement
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
52
  none: false
54
53
  requirements:
55
54
  - - ~>
@@ -60,12 +59,12 @@ dependencies:
60
59
  - 1
61
60
  - 0
62
61
  version: 2.1.0
63
- type: :development
64
62
  name: rspec
65
63
  prerelease: false
66
- version_requirements: *id003
64
+ type: :development
65
+ requirement: *id003
67
66
  - !ruby/object:Gem::Dependency
68
- requirement: &id004 !ruby/object:Gem::Requirement
67
+ version_requirements: &id004 !ruby/object:Gem::Requirement
69
68
  none: false
70
69
  requirements:
71
70
  - - ">="
@@ -74,12 +73,12 @@ dependencies:
74
73
  segments:
75
74
  - 0
76
75
  version: "0"
77
- type: :development
78
76
  name: fakeweb
79
77
  prerelease: false
80
- version_requirements: *id004
78
+ type: :development
79
+ requirement: *id004
81
80
  - !ruby/object:Gem::Dependency
82
- requirement: &id005 !ruby/object:Gem::Requirement
81
+ version_requirements: &id005 !ruby/object:Gem::Requirement
83
82
  none: false
84
83
  requirements:
85
84
  - - ~>
@@ -90,12 +89,12 @@ dependencies:
90
89
  - 6
91
90
  - 0
92
91
  version: 0.6.0
93
- type: :development
94
92
  name: yard
95
93
  prerelease: false
96
- version_requirements: *id005
94
+ type: :development
95
+ requirement: *id005
97
96
  - !ruby/object:Gem::Dependency
98
- requirement: &id006 !ruby/object:Gem::Requirement
97
+ version_requirements: &id006 !ruby/object:Gem::Requirement
99
98
  none: false
100
99
  requirements:
101
100
  - - ">="
@@ -104,12 +103,12 @@ dependencies:
104
103
  segments:
105
104
  - 0
106
105
  version: "0"
107
- type: :development
108
106
  name: bluecloth
109
107
  prerelease: false
110
- version_requirements: *id006
108
+ type: :development
109
+ requirement: *id006
111
110
  - !ruby/object:Gem::Dependency
112
- requirement: &id007 !ruby/object:Gem::Requirement
111
+ version_requirements: &id007 !ruby/object:Gem::Requirement
113
112
  none: false
114
113
  requirements:
115
114
  - - ">="
@@ -118,12 +117,12 @@ dependencies:
118
117
  segments:
119
118
  - 0
120
119
  version: "0"
121
- type: :development
122
120
  name: cucumber
123
121
  prerelease: false
124
- version_requirements: *id007
122
+ type: :development
123
+ requirement: *id007
125
124
  - !ruby/object:Gem::Dependency
126
- requirement: &id008 !ruby/object:Gem::Requirement
125
+ version_requirements: &id008 !ruby/object:Gem::Requirement
127
126
  none: false
128
127
  requirements:
129
128
  - - ~>
@@ -134,12 +133,12 @@ dependencies:
134
133
  - 0
135
134
  - 0
136
135
  version: 1.0.0
137
- type: :development
138
136
  name: bundler
139
137
  prerelease: false
140
- version_requirements: *id008
138
+ type: :development
139
+ requirement: *id008
141
140
  - !ruby/object:Gem::Dependency
142
- requirement: &id009 !ruby/object:Gem::Requirement
141
+ version_requirements: &id009 !ruby/object:Gem::Requirement
143
142
  none: false
144
143
  requirements:
145
144
  - - ~>
@@ -150,12 +149,12 @@ dependencies:
150
149
  - 5
151
150
  - 1
152
151
  version: 1.5.1
153
- type: :development
154
152
  name: jeweler
155
153
  prerelease: false
156
- version_requirements: *id009
154
+ type: :development
155
+ requirement: *id009
157
156
  - !ruby/object:Gem::Dependency
158
- requirement: &id010 !ruby/object:Gem::Requirement
157
+ version_requirements: &id010 !ruby/object:Gem::Requirement
159
158
  none: false
160
159
  requirements:
161
160
  - - ">="
@@ -164,12 +163,12 @@ dependencies:
164
163
  segments:
165
164
  - 0
166
165
  version: "0"
167
- type: :development
168
166
  name: rcov
169
167
  prerelease: false
170
- version_requirements: *id010
168
+ type: :development
169
+ requirement: *id010
171
170
  - !ruby/object:Gem::Dependency
172
- requirement: &id011 !ruby/object:Gem::Requirement
171
+ version_requirements: &id011 !ruby/object:Gem::Requirement
173
172
  none: false
174
173
  requirements:
175
174
  - - ">="
@@ -180,12 +179,12 @@ dependencies:
180
179
  - 6
181
180
  - 0
182
181
  version: 0.6.0
183
- type: :runtime
184
182
  name: httparty
185
183
  prerelease: false
186
- version_requirements: *id011
184
+ type: :runtime
185
+ requirement: *id011
187
186
  - !ruby/object:Gem::Dependency
188
- requirement: &id012 !ruby/object:Gem::Requirement
187
+ version_requirements: &id012 !ruby/object:Gem::Requirement
189
188
  none: false
190
189
  requirements:
191
190
  - - ~>
@@ -196,12 +195,12 @@ dependencies:
196
195
  - 1
197
196
  - 0
198
197
  version: 2.1.0
199
- type: :development
200
198
  name: rspec
201
199
  prerelease: false
202
- version_requirements: *id012
200
+ type: :development
201
+ requirement: *id012
203
202
  - !ruby/object:Gem::Dependency
204
- requirement: &id013 !ruby/object:Gem::Requirement
203
+ version_requirements: &id013 !ruby/object:Gem::Requirement
205
204
  none: false
206
205
  requirements:
207
206
  - - ~>
@@ -212,10 +211,10 @@ dependencies:
212
211
  - 6
213
212
  - 0
214
213
  version: 0.6.0
215
- type: :development
216
214
  name: yard
217
215
  prerelease: false
218
- version_requirements: *id013
216
+ type: :development
217
+ requirement: *id013
219
218
  description: A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface.
220
219
  email: aaron@gc4.co.uk
221
220
  executables: []
@@ -273,8 +272,7 @@ files:
273
272
  - spec/stubs/error/422-bookmarks
274
273
  - spec/stubs/gift_card/redeem
275
274
  - spec/stubs/gift_card/show
276
- has_rdoc: true
277
- homepage: http://github.com/aaronrussell/cloud_app
275
+ homepage: http://github.com/aaronrussell/cloudapp_api
278
276
  licenses: []
279
277
 
280
278
  post_install_message:
@@ -303,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
303
301
  requirements: []
304
302
 
305
303
  rubyforge_project:
306
- rubygems_version: 1.3.7
304
+ rubygems_version: 1.7.2
307
305
  signing_key:
308
306
  specification_version: 3
309
307
  summary: A simple Ruby wrapper for the CloudApp API. Uses HTTParty with a simple ActiveResource-like interface.