mage-hand 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -10,7 +10,7 @@ The Obsidian Portal API is new and in a lot of flux. mage-hand is also new and i
10
10
 
11
11
  You can install mage-hand with the usual
12
12
 
13
- sudo install mage-handler
13
+ sudo gem install mage-hand
14
14
 
15
15
  or you can add mage-hand to your gemfile with the following...
16
16
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
data/lib/mage-hand.rb CHANGED
@@ -6,7 +6,7 @@ require 'ob_port/base'
6
6
  require 'ob_port/user'
7
7
  require 'ob_port/campaign'
8
8
  require 'ob_port/wiki_page'
9
-
9
+ require 'ob_port/errors'
10
10
  module MageHand
11
11
  def self.set_app_keys(app_key, app_secret)
12
12
  Client.set_app_keys(app_key, app_secret)
@@ -38,6 +38,8 @@ module MageHand
38
38
  end
39
39
 
40
40
  def consumer
41
+ raise(OAuthConfigurationError, "Need to set application key and secret before initializing a consumer.") unless
42
+ @@key && @@secret
41
43
  @consumer ||= OAuth::Consumer.new( @@key, @@secret, {
42
44
  :site => 'http://api.obsidianportal.com',
43
45
  :request_token_url => 'https://www.obsidianportal.com/oauth/request_token',
@@ -62,6 +64,8 @@ module MageHand
62
64
  protected
63
65
 
64
66
  def self.reset_client
67
+ @@key = nil
68
+ @@secret = nil
65
69
  @@client = nil
66
70
  end
67
71
  end
@@ -0,0 +1,2 @@
1
+ class OAuthConfigurationError < StandardError
2
+ end
data/lib/ob_port/user.rb CHANGED
@@ -7,7 +7,7 @@ module MageHand
7
7
 
8
8
  alias :is_ascendant? :is_ascendant
9
9
 
10
- attr_array :campaigns #, :class_name => 'Campaign'
10
+ attr_array :campaigns, :class_name => 'Campaign'
11
11
  inflate_if_nil :campaigns
12
12
 
13
13
  private
data/mage-hand.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mage-hand}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steven Hammond"]
12
- s.date = %q{2011-06-07}
12
+ s.date = %q{2011-10-24}
13
13
  s.description = %q{mage-hand is a ghostly hand that reaches across the internet to access the Obsidian Portal API.}
14
14
  s.email = %q{shammond@northpub.com}
15
15
  s.extra_rdoc_files = [
@@ -30,6 +30,7 @@ Gem::Specification.new do |s|
30
30
  "lib/ob_port/base.rb",
31
31
  "lib/ob_port/campaign.rb",
32
32
  "lib/ob_port/client.rb",
33
+ "lib/ob_port/errors.rb",
33
34
  "lib/ob_port/user.rb",
34
35
  "lib/ob_port/wiki_page.rb",
35
36
  "mage-hand.gemspec",
@@ -41,7 +42,7 @@ Gem::Specification.new do |s|
41
42
  s.homepage = %q{http://github.com/shammond42/mage-hand}
42
43
  s.licenses = ["MIT"]
43
44
  s.require_paths = ["lib"]
44
- s.rubygems_version = %q{1.3.7}
45
+ s.rubygems_version = %q{1.3.6}
45
46
  s.summary = %q{Ruby wrapper around the Obsidian Portal API}
46
47
  s.test_files = [
47
48
  "test/helper.rb",
@@ -54,7 +55,7 @@ Gem::Specification.new do |s|
54
55
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
55
56
  s.specification_version = 3
56
57
 
57
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
58
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
58
59
  s.add_runtime_dependency(%q<oauth>, [">= 0.4.4"])
59
60
  s.add_runtime_dependency(%q<json>, [">= 0"])
60
61
  s.add_runtime_dependency(%q<i18n>, [">= 0"])
data/test/test_client.rb CHANGED
@@ -5,6 +5,13 @@ class TestClient < Test::Unit::TestCase
5
5
  should "configure correctly with a key and secret" do
6
6
  assert_nothing_raised {MageHand::Client.set_app_keys('asdfasdf','asdfasdfasdfasdfasdf')}
7
7
  end
8
+ should "raise an exception when the app keys are not set" do
9
+ assert_raise(OAuthConfigurationError) do
10
+ # @request_token = stub('request token')
11
+ MageHand::Client.send(:reset_client)
12
+ MageHand::get_client
13
+ end
14
+ end
8
15
  end
9
16
 
10
17
  context "An instance of the client" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mage-hand
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 3
9
- - 1
10
- version: 0.3.1
8
+ - 2
9
+ segments_generated: true
10
+ version: 0.3.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steven Hammond
@@ -15,189 +15,177 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-07 00:00:00 -04:00
18
+ date: 2011-10-24 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  prerelease: false
23
+ type: :runtime
24
+ name: oauth
23
25
  version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
28
- hash: 7
29
29
  segments:
30
30
  - 0
31
31
  - 4
32
32
  - 4
33
+ segments_generated: true
33
34
  version: 0.4.4
34
- name: oauth
35
35
  requirement: *id001
36
- type: :runtime
37
36
  - !ruby/object:Gem::Dependency
38
37
  prerelease: false
38
+ type: :runtime
39
+ name: json
39
40
  version_requirements: &id002 !ruby/object:Gem::Requirement
40
- none: false
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
- hash: 3
45
44
  segments:
46
45
  - 0
46
+ segments_generated: true
47
47
  version: "0"
48
- name: json
49
48
  requirement: *id002
50
- type: :runtime
51
49
  - !ruby/object:Gem::Dependency
52
50
  prerelease: false
51
+ type: :runtime
52
+ name: i18n
53
53
  version_requirements: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
54
  requirements:
56
55
  - - ">="
57
56
  - !ruby/object:Gem::Version
58
- hash: 3
59
57
  segments:
60
58
  - 0
59
+ segments_generated: true
61
60
  version: "0"
62
- name: i18n
63
61
  requirement: *id003
64
- type: :runtime
65
62
  - !ruby/object:Gem::Dependency
66
63
  prerelease: false
64
+ type: :runtime
65
+ name: activesupport
67
66
  version_requirements: &id004 !ruby/object:Gem::Requirement
68
- none: false
69
67
  requirements:
70
68
  - - ">="
71
69
  - !ruby/object:Gem::Version
72
- hash: 3
73
70
  segments:
74
71
  - 0
72
+ segments_generated: true
75
73
  version: "0"
76
- name: activesupport
77
74
  requirement: *id004
78
- type: :runtime
79
75
  - !ruby/object:Gem::Dependency
80
76
  prerelease: false
77
+ type: :development
78
+ name: shoulda
81
79
  version_requirements: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
80
  requirements:
84
81
  - - ">="
85
82
  - !ruby/object:Gem::Version
86
- hash: 3
87
83
  segments:
88
84
  - 0
85
+ segments_generated: true
89
86
  version: "0"
90
- name: shoulda
91
87
  requirement: *id005
92
- type: :development
93
88
  - !ruby/object:Gem::Dependency
94
89
  prerelease: false
90
+ type: :development
91
+ name: bundler
95
92
  version_requirements: &id006 !ruby/object:Gem::Requirement
96
- none: false
97
93
  requirements:
98
94
  - - ~>
99
95
  - !ruby/object:Gem::Version
100
- hash: 23
101
96
  segments:
102
97
  - 1
103
98
  - 0
104
99
  - 0
100
+ segments_generated: true
105
101
  version: 1.0.0
106
- name: bundler
107
102
  requirement: *id006
108
- type: :development
109
103
  - !ruby/object:Gem::Dependency
110
104
  prerelease: false
105
+ type: :development
106
+ name: jeweler
111
107
  version_requirements: &id007 !ruby/object:Gem::Requirement
112
- none: false
113
108
  requirements:
114
109
  - - ~>
115
110
  - !ruby/object:Gem::Version
116
- hash: 1
117
111
  segments:
118
112
  - 1
119
113
  - 5
120
114
  - 1
115
+ segments_generated: true
121
116
  version: 1.5.1
122
- name: jeweler
123
117
  requirement: *id007
124
- type: :development
125
118
  - !ruby/object:Gem::Dependency
126
119
  prerelease: false
120
+ type: :development
121
+ name: rcov
127
122
  version_requirements: &id008 !ruby/object:Gem::Requirement
128
- none: false
129
123
  requirements:
130
124
  - - ">="
131
125
  - !ruby/object:Gem::Version
132
- hash: 3
133
126
  segments:
134
127
  - 0
128
+ segments_generated: true
135
129
  version: "0"
136
- name: rcov
137
130
  requirement: *id008
138
- type: :development
139
131
  - !ruby/object:Gem::Dependency
140
132
  prerelease: false
133
+ type: :development
134
+ name: mocha
141
135
  version_requirements: &id009 !ruby/object:Gem::Requirement
142
- none: false
143
136
  requirements:
144
137
  - - ">="
145
138
  - !ruby/object:Gem::Version
146
- hash: 43
147
139
  segments:
148
140
  - 0
149
141
  - 9
150
142
  - 8
143
+ segments_generated: true
151
144
  version: 0.9.8
152
- name: mocha
153
145
  requirement: *id009
154
- type: :development
155
146
  - !ruby/object:Gem::Dependency
156
147
  prerelease: false
148
+ type: :development
149
+ name: redgreen
157
150
  version_requirements: &id010 !ruby/object:Gem::Requirement
158
- none: false
159
151
  requirements:
160
152
  - - ">="
161
153
  - !ruby/object:Gem::Version
162
- hash: 3
163
154
  segments:
164
155
  - 0
156
+ segments_generated: true
165
157
  version: "0"
166
- name: redgreen
167
158
  requirement: *id010
168
- type: :development
169
159
  - !ruby/object:Gem::Dependency
170
160
  prerelease: false
161
+ type: :development
162
+ name: webmock
171
163
  version_requirements: &id011 !ruby/object:Gem::Requirement
172
- none: false
173
164
  requirements:
174
165
  - - ">="
175
166
  - !ruby/object:Gem::Version
176
- hash: 11
177
167
  segments:
178
168
  - 1
179
169
  - 6
180
170
  - 2
171
+ segments_generated: true
181
172
  version: 1.6.2
182
- name: webmock
183
173
  requirement: *id011
184
- type: :development
185
174
  - !ruby/object:Gem::Dependency
186
175
  prerelease: false
176
+ type: :runtime
177
+ name: oauth
187
178
  version_requirements: &id012 !ruby/object:Gem::Requirement
188
- none: false
189
179
  requirements:
190
180
  - - ">="
191
181
  - !ruby/object:Gem::Version
192
- hash: 7
193
182
  segments:
194
183
  - 0
195
184
  - 4
196
185
  - 4
186
+ segments_generated: true
197
187
  version: 0.4.4
198
- name: oauth
199
188
  requirement: *id012
200
- type: :runtime
201
189
  description: mage-hand is a ghostly hand that reaches across the internet to access the Obsidian Portal API.
202
190
  email: shammond@northpub.com
203
191
  executables: []
@@ -221,6 +209,7 @@ files:
221
209
  - lib/ob_port/base.rb
222
210
  - lib/ob_port/campaign.rb
223
211
  - lib/ob_port/client.rb
212
+ - lib/ob_port/errors.rb
224
213
  - lib/ob_port/user.rb
225
214
  - lib/ob_port/wiki_page.rb
226
215
  - mage-hand.gemspec
@@ -238,27 +227,25 @@ rdoc_options: []
238
227
  require_paths:
239
228
  - lib
240
229
  required_ruby_version: !ruby/object:Gem::Requirement
241
- none: false
242
230
  requirements:
243
231
  - - ">="
244
232
  - !ruby/object:Gem::Version
245
- hash: 3
246
233
  segments:
247
234
  - 0
235
+ segments_generated: true
248
236
  version: "0"
249
237
  required_rubygems_version: !ruby/object:Gem::Requirement
250
- none: false
251
238
  requirements:
252
239
  - - ">="
253
240
  - !ruby/object:Gem::Version
254
- hash: 3
255
241
  segments:
256
242
  - 0
243
+ segments_generated: true
257
244
  version: "0"
258
245
  requirements: []
259
246
 
260
247
  rubyforge_project:
261
- rubygems_version: 1.3.7
248
+ rubygems_version: 1.3.6
262
249
  signing_key:
263
250
  specification_version: 3
264
251
  summary: Ruby wrapper around the Obsidian Portal API