big_door 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +72 -0
  3. data/README.rdoc +170 -0
  4. data/Rakefile +32 -0
  5. data/autotest/discover.rb +1 -0
  6. data/big_door.gemspec +56 -0
  7. data/bin/example.rb +93 -0
  8. data/features/resources/attribute.feature +41 -0
  9. data/features/resources/currency_type.feature +12 -0
  10. data/features/resources/end_user.feature +92 -0
  11. data/features/resources/named_award_collection.feature +42 -0
  12. data/features/resources/named_good_collection.feature +40 -0
  13. data/features/resources/named_level_collection.feature +44 -0
  14. data/features/resources/url.feature +41 -0
  15. data/features/step_definitions/resources_steps.rb +370 -0
  16. data/features/support/env.rb +9 -0
  17. data/lib/big_door/attribute.rb +21 -0
  18. data/lib/big_door/award.rb +24 -0
  19. data/lib/big_door/client.rb +281 -0
  20. data/lib/big_door/currency.rb +26 -0
  21. data/lib/big_door/currency_balance.rb +27 -0
  22. data/lib/big_door/currency_type.rb +29 -0
  23. data/lib/big_door/end_user.rb +32 -0
  24. data/lib/big_door/good.rb +32 -0
  25. data/lib/big_door/leaderboard.rb +41 -0
  26. data/lib/big_door/level.rb +25 -0
  27. data/lib/big_door/named_award.rb +24 -0
  28. data/lib/big_door/named_award_collection.rb +21 -0
  29. data/lib/big_door/named_good.rb +24 -0
  30. data/lib/big_door/named_good_collection.rb +22 -0
  31. data/lib/big_door/named_level.rb +26 -0
  32. data/lib/big_door/named_level_collection.rb +23 -0
  33. data/lib/big_door/named_transaction.rb +21 -0
  34. data/lib/big_door/named_transaction_group.rb +74 -0
  35. data/lib/big_door/profile.rb +28 -0
  36. data/lib/big_door/resource.rb +204 -0
  37. data/lib/big_door/resource_end_user.rb +84 -0
  38. data/lib/big_door/resource_with_association.rb +37 -0
  39. data/lib/big_door/resource_with_parent.rb +43 -0
  40. data/lib/big_door/url.rb +21 -0
  41. data/lib/big_door.rb +40 -0
  42. data/script/console +10 -0
  43. data/script/destroy +14 -0
  44. data/script/generate +14 -0
  45. data/spec/big_door/attribute_spec.rb +18 -0
  46. data/spec/big_door/award_spec.rb +19 -0
  47. data/spec/big_door/client_spec.rb +163 -0
  48. data/spec/big_door/currency_balance_spec.rb +14 -0
  49. data/spec/big_door/currency_spec.rb +81 -0
  50. data/spec/big_door/currency_type_spec.rb +21 -0
  51. data/spec/big_door/end_user_spec.rb +23 -0
  52. data/spec/big_door/good_spec.rb +14 -0
  53. data/spec/big_door/leaderboard_spec.rb +15 -0
  54. data/spec/big_door/level_spec.rb +19 -0
  55. data/spec/big_door/named_award_collection_spec.rb +23 -0
  56. data/spec/big_door/named_award_spec.rb +23 -0
  57. data/spec/big_door/named_good_collection_spec.rb +23 -0
  58. data/spec/big_door/named_good_spec.rb +23 -0
  59. data/spec/big_door/named_level_collection_spec.rb +23 -0
  60. data/spec/big_door/named_level_spec.rb +24 -0
  61. data/spec/big_door/named_transaction_group_spec.rb +29 -0
  62. data/spec/big_door/named_transaction_spec.rb +23 -0
  63. data/spec/big_door/profile_spec.rb +19 -0
  64. data/spec/big_door/resource_end_user_spec.rb +22 -0
  65. data/spec/big_door/resource_spec.rb +22 -0
  66. data/spec/big_door/resource_with_association_spec.rb +23 -0
  67. data/spec/big_door/resource_with_parent_spec.rb +22 -0
  68. data/spec/big_door/url_spec.rb +23 -0
  69. data/spec/spec.opts +1 -0
  70. data/spec/spec_helper.rb +17 -0
  71. data/tasks/cucumber.rake +5 -0
  72. data/tasks/rspec.rake +29 -0
  73. metadata +263 -0
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module BigDoor
4
+ describe ResourceWithParent do
5
+ before(:each) do
6
+ @client = BigDoor::Client.new( TEST_APP_SECRET, TEST_APP_KEY )
7
+ end
8
+ context "ResourceWithParent class" do
9
+ it "Should respond to :all" do
10
+ BigDoor::ResourceWithParent.should respond_to(:all).with(1).arguments
11
+ end
12
+ subject { BigDoor::ResourceWithParent.new( {} ) }
13
+ it { should be }
14
+ it { should be_instance_of BigDoor::ResourceWithParent}
15
+ it { should respond_to(:save).with(1).arguments}
16
+ it { should respond_to(:load).with(1).arguments}
17
+ it { should respond_to(:load).with(2).arguments}
18
+ it { should respond_to(:delete).with(1).arguments}
19
+ it { should respond_to(:delete).with(2).arguments}
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ module BigDoor
4
+ describe URL do
5
+ before(:each) do
6
+ @client = BigDoor::Client.new( TEST_APP_SECRET, TEST_APP_KEY )
7
+ end
8
+ context "URL class" do
9
+ it "Should respond to :all" do
10
+ BigDoor::URL.should respond_to(:all).with(1).arguments
11
+ end
12
+ it "Should load Array of URLs at the beginning" do
13
+ currency_types = BigDoor::URL.all( @client )
14
+ currency_types.should be_a_instance_of( Array )
15
+ end
16
+ end
17
+ context "fresh URL object" do
18
+ subject { BigDoor::URL.new }
19
+ it { should be }
20
+ it { should be_a_instance_of( BigDoor::URL )}
21
+ end
22
+ end
23
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,17 @@
1
+ begin
2
+ require 'rspec'
3
+ rescue LoadError
4
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
5
+ gem 'rspec'
6
+ require 'rspec'
7
+ end
8
+
9
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
10
+ require 'big_door'
11
+
12
+ FAKE_APP_KEY = '28d3da80bf36fad415ab57b3130c6cb6'
13
+ FAKE_APP_SECRET = 'B66F956ED83AE218612CB0FBAC2EF01C'
14
+
15
+ TEST_APP_KEY = ENV['BIGDOOR_API_KEY'] || FAKE_APP_KEY
16
+ TEST_APP_SECRET = ENV['BIGDOOR_API_SECRET'] || FAKE_APP_SECRET
17
+
@@ -0,0 +1,5 @@
1
+ require 'cucumber/rake/task'
2
+ Cucumber::Rake::Task.new(:features) do |t|
3
+ t.cucumber_opts = "--format pretty"
4
+ t.rcov = true
5
+ end
data/tasks/rspec.rake ADDED
@@ -0,0 +1,29 @@
1
+ begin
2
+ require 'rspec'
3
+ rescue LoadError
4
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
5
+ require 'rspec'
6
+ end
7
+ begin
8
+ require 'rspec/core/rake_task'
9
+ rescue LoadError
10
+ puts <<-EOS
11
+ To use rspec for testing you must install rspec gem:
12
+ gem install rspec
13
+ EOS
14
+ exit(0)
15
+ end
16
+
17
+ desc "Run all examples"
18
+ RSpec::Core::RakeTask.new(:spec) do |t|
19
+ t.rspec_opts = %w[--color]
20
+ t.verbose = false
21
+ end
22
+
23
+ namespace :spec do
24
+ desc "Run rspec with RCov"
25
+ RSpec::Core::RakeTask.new('rcov') do |t|
26
+ t.rcov = true
27
+ t.rcov_opts = ['--exclude', '/home/alexd/.gems']
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,263 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: big_door
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Alex L. Demidov
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-26 00:00:00 +03:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rest-client
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ segments:
29
+ - 1
30
+ - 0
31
+ version: "1.0"
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: addressable
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 2
44
+ - 0
45
+ version: "2.0"
46
+ type: :runtime
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: json
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ segments:
57
+ - 1
58
+ - 0
59
+ version: "1.0"
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ - !ruby/object:Gem::Dependency
63
+ name: uuidtools
64
+ prerelease: false
65
+ requirement: &id004 !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ~>
69
+ - !ruby/object:Gem::Version
70
+ segments:
71
+ - 2
72
+ - 0
73
+ version: "2.0"
74
+ type: :runtime
75
+ version_requirements: *id004
76
+ - !ruby/object:Gem::Dependency
77
+ name: cucumber
78
+ prerelease: false
79
+ requirement: &id005 !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ~>
83
+ - !ruby/object:Gem::Version
84
+ segments:
85
+ - 0
86
+ - 10
87
+ version: "0.10"
88
+ type: :development
89
+ version_requirements: *id005
90
+ - !ruby/object:Gem::Dependency
91
+ name: rspec
92
+ prerelease: false
93
+ requirement: &id006 !ruby/object:Gem::Requirement
94
+ none: false
95
+ requirements:
96
+ - - ~>
97
+ - !ruby/object:Gem::Version
98
+ segments:
99
+ - 2
100
+ - 4
101
+ version: "2.4"
102
+ type: :development
103
+ version_requirements: *id006
104
+ - !ruby/object:Gem::Dependency
105
+ name: hoe
106
+ prerelease: false
107
+ requirement: &id007 !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ segments:
113
+ - 2
114
+ - 8
115
+ - 0
116
+ version: 2.8.0
117
+ type: :development
118
+ version_requirements: *id007
119
+ description: |-
120
+ Client library for the BigDoor REST API (http://bigdoor.com). This package
121
+ provides both low-level procedural (BigDoor::Client) and object-oriented
122
+ (BigDoor::Resource object hierarchy) interfaces to BigDoor REST API.
123
+ email:
124
+ - alexeydemidov@gmail.com
125
+ executables:
126
+ - example.rb
127
+ extensions: []
128
+
129
+ extra_rdoc_files:
130
+ - History.txt
131
+ - Manifest.txt
132
+ files:
133
+ - History.txt
134
+ - Manifest.txt
135
+ - README.rdoc
136
+ - Rakefile
137
+ - autotest/discover.rb
138
+ - big_door.gemspec
139
+ - bin/example.rb
140
+ - features/resources/attribute.feature
141
+ - features/resources/currency_type.feature
142
+ - features/resources/end_user.feature
143
+ - features/resources/named_award_collection.feature
144
+ - features/resources/named_good_collection.feature
145
+ - features/resources/named_level_collection.feature
146
+ - features/resources/url.feature
147
+ - features/step_definitions/resources_steps.rb
148
+ - features/support/env.rb
149
+ - lib/big_door.rb
150
+ - lib/big_door/attribute.rb
151
+ - lib/big_door/award.rb
152
+ - lib/big_door/client.rb
153
+ - lib/big_door/currency.rb
154
+ - lib/big_door/currency_balance.rb
155
+ - lib/big_door/currency_type.rb
156
+ - lib/big_door/end_user.rb
157
+ - lib/big_door/good.rb
158
+ - lib/big_door/leaderboard.rb
159
+ - lib/big_door/level.rb
160
+ - lib/big_door/named_award.rb
161
+ - lib/big_door/named_award_collection.rb
162
+ - lib/big_door/named_good.rb
163
+ - lib/big_door/named_good_collection.rb
164
+ - lib/big_door/named_level.rb
165
+ - lib/big_door/named_level_collection.rb
166
+ - lib/big_door/named_transaction.rb
167
+ - lib/big_door/named_transaction_group.rb
168
+ - lib/big_door/profile.rb
169
+ - lib/big_door/resource.rb
170
+ - lib/big_door/resource_end_user.rb
171
+ - lib/big_door/resource_with_association.rb
172
+ - lib/big_door/resource_with_parent.rb
173
+ - lib/big_door/url.rb
174
+ - script/console
175
+ - script/destroy
176
+ - script/generate
177
+ - spec/big_door/attribute_spec.rb
178
+ - spec/big_door/award_spec.rb
179
+ - spec/big_door/client_spec.rb
180
+ - spec/big_door/currency_balance_spec.rb
181
+ - spec/big_door/currency_spec.rb
182
+ - spec/big_door/currency_type_spec.rb
183
+ - spec/big_door/end_user_spec.rb
184
+ - spec/big_door/good_spec.rb
185
+ - spec/big_door/leaderboard_spec.rb
186
+ - spec/big_door/level_spec.rb
187
+ - spec/big_door/named_award_collection_spec.rb
188
+ - spec/big_door/named_award_spec.rb
189
+ - spec/big_door/named_good_collection_spec.rb
190
+ - spec/big_door/named_good_spec.rb
191
+ - spec/big_door/named_level_collection_spec.rb
192
+ - spec/big_door/named_level_spec.rb
193
+ - spec/big_door/named_transaction_group_spec.rb
194
+ - spec/big_door/named_transaction_spec.rb
195
+ - spec/big_door/profile_spec.rb
196
+ - spec/big_door/resource_end_user_spec.rb
197
+ - spec/big_door/resource_spec.rb
198
+ - spec/big_door/resource_with_association_spec.rb
199
+ - spec/big_door/resource_with_parent_spec.rb
200
+ - spec/big_door/url_spec.rb
201
+ - spec/spec.opts
202
+ - spec/spec_helper.rb
203
+ - tasks/cucumber.rake
204
+ - tasks/rspec.rake
205
+ has_rdoc: true
206
+ homepage: http://bitbucket.org/AlexeyDemidov/bigdoorkit-ruby/
207
+ licenses: []
208
+
209
+ post_install_message:
210
+ rdoc_options:
211
+ - --main
212
+ - README.rdoc
213
+ require_paths:
214
+ - lib
215
+ required_ruby_version: !ruby/object:Gem::Requirement
216
+ none: false
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ segments:
221
+ - 0
222
+ version: "0"
223
+ required_rubygems_version: !ruby/object:Gem::Requirement
224
+ none: false
225
+ requirements:
226
+ - - ">="
227
+ - !ruby/object:Gem::Version
228
+ segments:
229
+ - 0
230
+ version: "0"
231
+ requirements: []
232
+
233
+ rubyforge_project: big_door
234
+ rubygems_version: 1.3.7
235
+ signing_key:
236
+ specification_version: 3
237
+ summary: Client library for the BigDoor REST API (http://bigdoor.com)
238
+ test_files:
239
+ - spec/big_door/attribute_spec.rb
240
+ - spec/big_door/award_spec.rb
241
+ - spec/big_door/client_spec.rb
242
+ - spec/big_door/currency_balance_spec.rb
243
+ - spec/big_door/currency_spec.rb
244
+ - spec/big_door/currency_type_spec.rb
245
+ - spec/big_door/end_user_spec.rb
246
+ - spec/big_door/good_spec.rb
247
+ - spec/big_door/leaderboard_spec.rb
248
+ - spec/big_door/level_spec.rb
249
+ - spec/big_door/named_award_collection_spec.rb
250
+ - spec/big_door/named_award_spec.rb
251
+ - spec/big_door/named_good_collection_spec.rb
252
+ - spec/big_door/named_good_spec.rb
253
+ - spec/big_door/named_level_collection_spec.rb
254
+ - spec/big_door/named_level_spec.rb
255
+ - spec/big_door/named_transaction_group_spec.rb
256
+ - spec/big_door/named_transaction_spec.rb
257
+ - spec/big_door/profile_spec.rb
258
+ - spec/big_door/resource_end_user_spec.rb
259
+ - spec/big_door/resource_spec.rb
260
+ - spec/big_door/resource_with_association_spec.rb
261
+ - spec/big_door/resource_with_parent_spec.rb
262
+ - spec/big_door/url_spec.rb
263
+ - spec/spec_helper.rb