koala 0.9.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. data/.autotest +12 -0
  2. data/.gitignore +5 -0
  3. data/.travis.yml +8 -0
  4. data/CHANGELOG +71 -7
  5. data/Gemfile +7 -0
  6. data/LICENSE +1 -1
  7. data/Manifest +10 -15
  8. data/Rakefile +13 -13
  9. data/autotest/discover.rb +1 -0
  10. data/koala.gemspec +36 -16
  11. data/lib/koala/batch_operation.rb +74 -0
  12. data/lib/koala/graph_api.rb +200 -134
  13. data/lib/koala/graph_batch_api.rb +87 -0
  14. data/lib/koala/graph_collection.rb +54 -0
  15. data/lib/koala/http_services/net_http_service.rb +92 -0
  16. data/lib/koala/http_services/typhoeus_service.rb +37 -0
  17. data/lib/koala/http_services.rb +22 -47
  18. data/lib/koala/oauth.rb +181 -0
  19. data/lib/koala/realtime_updates.rb +5 -14
  20. data/lib/koala/rest_api.rb +82 -10
  21. data/lib/koala/test_users.rb +85 -0
  22. data/lib/koala/uploadable_io.rb +175 -0
  23. data/lib/koala.rb +67 -229
  24. data/readme.md +71 -38
  25. data/spec/cases/api_base_spec.rb +101 -0
  26. data/spec/cases/graph_and_rest_api_spec.rb +31 -0
  27. data/spec/cases/graph_api_batch_spec.rb +609 -0
  28. data/spec/cases/graph_api_spec.rb +25 -0
  29. data/spec/cases/http_services/http_service_spec.rb +129 -0
  30. data/spec/cases/http_services/net_http_service_spec.rb +532 -0
  31. data/spec/cases/http_services/typhoeus_service_spec.rb +152 -0
  32. data/spec/cases/koala_spec.rb +55 -0
  33. data/spec/cases/oauth_spec.rb +409 -0
  34. data/spec/cases/realtime_updates_spec.rb +184 -0
  35. data/spec/cases/rest_api_spec.rb +25 -0
  36. data/spec/cases/test_users_spec.rb +221 -0
  37. data/spec/cases/uploadable_io_spec.rb +193 -0
  38. data/spec/fixtures/beach.jpg +0 -0
  39. data/spec/fixtures/cat.m4v +0 -0
  40. data/spec/{facebook_data.yml → fixtures/facebook_data.yml} +18 -14
  41. data/spec/fixtures/mock_facebook_responses.yml +409 -0
  42. data/spec/spec_helper.rb +19 -0
  43. data/spec/support/graph_api_shared_examples.rb +495 -0
  44. data/spec/support/json_testing_fix.rb +18 -0
  45. data/spec/support/live_testing_data_helper.rb +40 -0
  46. data/spec/support/mock_http_service.rb +96 -0
  47. data/spec/support/rest_api_shared_examples.rb +285 -0
  48. data/spec/support/setup_mocks_or_live.rb +51 -0
  49. data/spec/support/uploadable_io_shared_examples.rb +76 -0
  50. metadata +131 -59
  51. data/examples/oauth_playground/Capfile +0 -2
  52. data/examples/oauth_playground/LICENSE +0 -22
  53. data/examples/oauth_playground/Rakefile +0 -4
  54. data/examples/oauth_playground/config/deploy.rb +0 -39
  55. data/examples/oauth_playground/config/facebook.yml +0 -13
  56. data/examples/oauth_playground/config.ru +0 -27
  57. data/examples/oauth_playground/lib/load_facebook.rb +0 -3
  58. data/examples/oauth_playground/lib/oauth_playground.rb +0 -187
  59. data/examples/oauth_playground/readme.md +0 -8
  60. data/examples/oauth_playground/spec/oauth_playground_spec.rb +0 -35
  61. data/examples/oauth_playground/spec/spec_helper.rb +0 -36
  62. data/examples/oauth_playground/tmp/restart.txt +0 -0
  63. data/examples/oauth_playground/views/index.erb +0 -206
  64. data/examples/oauth_playground/views/layout.erb +0 -39
  65. data/init.rb +0 -2
  66. data/spec/koala/api_base_tests.rb +0 -95
  67. data/spec/koala/graph_and_rest_api/graph_and_rest_api_no_token_tests.rb +0 -10
  68. data/spec/koala/graph_and_rest_api/graph_and_rest_api_with_token_tests.rb +0 -11
  69. data/spec/koala/graph_api/graph_api_no_access_token_tests.rb +0 -114
  70. data/spec/koala/graph_api/graph_api_with_access_token_tests.rb +0 -150
  71. data/spec/koala/graph_api/graph_collection_tests.rb +0 -104
  72. data/spec/koala/live_testing_data_helper.rb +0 -15
  73. data/spec/koala/net_http_service_tests.rb +0 -181
  74. data/spec/koala/oauth/oauth_tests.rb +0 -440
  75. data/spec/koala/realtime_updates/realtime_updates_tests.rb +0 -187
  76. data/spec/koala/rest_api/rest_api_no_access_token_tests.rb +0 -94
  77. data/spec/koala/rest_api/rest_api_with_access_token_tests.rb +0 -36
  78. data/spec/koala_spec.rb +0 -18
  79. data/spec/koala_spec_helper.rb +0 -31
  80. data/spec/koala_spec_without_mocks.rb +0 -19
  81. data/spec/mock_facebook_responses.yml +0 -241
  82. data/spec/mock_http_service.rb +0 -81
@@ -0,0 +1,285 @@
1
+ shared_examples_for "Koala RestAPI" do
2
+ # REST_CALL
3
+ describe "when making a rest request" do
4
+ it "should use the proper path" do
5
+ method = stub('methodName')
6
+ @api.should_receive(:api).with(
7
+ "method/#{method}",
8
+ anything,
9
+ anything,
10
+ anything
11
+ )
12
+
13
+ @api.rest_call(method)
14
+ end
15
+
16
+ it "should always use the rest api" do
17
+ @api.should_receive(:api).with(
18
+ anything,
19
+ anything,
20
+ anything,
21
+ hash_including(:rest_api => true)
22
+ )
23
+
24
+ @api.rest_call('anything')
25
+ end
26
+
27
+ it "should set the read_only option to true if the method is listed in the read-only list" do
28
+ method = Koala::Facebook::RestAPI::READ_ONLY_METHODS.first
29
+
30
+ @api.should_receive(:api).with(
31
+ anything,
32
+ anything,
33
+ anything,
34
+ hash_including(:read_only => true)
35
+ )
36
+
37
+ @api.rest_call(method)
38
+ end
39
+
40
+ it "should set the read_only option to false if the method is not inthe read-only list" do
41
+ method = "I'm not a read-only method"
42
+
43
+ @api.should_receive(:api).with(
44
+ anything,
45
+ anything,
46
+ anything,
47
+ hash_including(:read_only => false)
48
+ )
49
+
50
+ @api.rest_call(method)
51
+ end
52
+
53
+
54
+ it "should take an optional hash of arguments" do
55
+ args = {:arg1 => 'arg1'}
56
+
57
+ @api.should_receive(:api).with(
58
+ anything,
59
+ hash_including(args),
60
+ anything,
61
+ anything
62
+ )
63
+
64
+ @api.rest_call('anything', args)
65
+ end
66
+
67
+ it "should always ask for JSON" do
68
+ @api.should_receive(:api).with(
69
+ anything,
70
+ hash_including('format' => 'json'),
71
+ anything,
72
+ anything
73
+ )
74
+
75
+ @api.rest_call('anything')
76
+ end
77
+
78
+ it "should pass any options provided to the API" do
79
+ options = {:a => 2}
80
+
81
+ @api.should_receive(:api).with(
82
+ anything,
83
+ hash_including('format' => 'json'),
84
+ anything,
85
+ hash_including(options)
86
+ )
87
+
88
+ @api.rest_call('anything', {}, options)
89
+ end
90
+
91
+ it "uses get by default" do
92
+ @api.should_receive(:api).with(
93
+ anything,
94
+ anything,
95
+ "get",
96
+ anything
97
+ )
98
+
99
+ @api.rest_call('anything')
100
+ end
101
+
102
+ it "allows you to specify other http methods as the last argument" do
103
+ method = 'bar'
104
+ @api.should_receive(:api).with(
105
+ anything,
106
+ anything,
107
+ method,
108
+ anything
109
+ )
110
+
111
+ @api.rest_call('anything', {}, {}, method)
112
+ end
113
+
114
+ it "should throw an APIError if the result hash has an error key" do
115
+ Koala.stub(:make_request).and_return(Koala::Response.new(500, {"error_code" => "An error occurred!"}, {}))
116
+ lambda { @api.rest_call("koppel", {}) }.should raise_exception(Koala::Facebook::APIError)
117
+ end
118
+
119
+ describe "when making a FQL request" do
120
+ it "should call fql.query method" do
121
+ @api.should_receive(:rest_call).with(
122
+ "fql.query", anything, anything
123
+ ).and_return(Koala::Response.new(200, "2", {}))
124
+
125
+ @api.fql_query stub('query string')
126
+ end
127
+
128
+ it "should pass a query argument" do
129
+ query = stub('query string')
130
+
131
+ @api.should_receive(:rest_call).with(
132
+ anything, hash_including(:query => query), anything
133
+ )
134
+
135
+ @api.fql_query(query)
136
+ end
137
+
138
+ it "should pass on any other arguments provided" do
139
+ args = {:a => 2}
140
+ @api.should_receive(:rest_call).with(anything, hash_including(args), anything)
141
+ @api.fql_query("a query", args)
142
+ end
143
+
144
+ it "should pass on any http options provided" do
145
+ opts = {:a => 2}
146
+ @api.should_receive(:rest_call).with(anything, anything, hash_including(opts))
147
+ @api.fql_query("a query", {}, opts)
148
+ end
149
+ end
150
+
151
+ describe "when making a FQL-multiquery request" do
152
+ it "should call fql.multiquery method" do
153
+ @api.should_receive(:rest_call).with(
154
+ "fql.multiquery", anything, anything
155
+ ).and_return({})
156
+
157
+ @api.fql_multiquery 'query string'
158
+ end
159
+
160
+ it "should pass a queries argument" do
161
+ queries = stub('query string')
162
+ queries_json = "some JSON"
163
+ MultiJson.stub(:encode).with(queries).and_return(queries_json)
164
+
165
+ @api.should_receive(:rest_call).with(
166
+ anything,
167
+ hash_including(:queries => queries_json),
168
+ anything
169
+ )
170
+
171
+ @api.fql_multiquery(queries)
172
+ end
173
+
174
+ it "simplifies the response format" do
175
+ raw_results = [
176
+ {"name" => "query1", "fql_result_set" => [1, 2, 3]},
177
+ {"name" => "query2", "fql_result_set" => [:a, :b, :c]}
178
+ ]
179
+ expected_results = {
180
+ "query1" => [1, 2, 3],
181
+ "query2" => [:a, :b, :c]
182
+ }
183
+
184
+ @api.stub(:rest_call).and_return(raw_results)
185
+ results = @api.fql_multiquery({:query => true})
186
+ results.should == expected_results
187
+ end
188
+
189
+ it "should pass on any other arguments provided" do
190
+ args = {:a => 2}
191
+ @api.should_receive(:rest_call).with(anything, hash_including(args), anything)
192
+ @api.fql_multiquery("a query", args)
193
+ end
194
+
195
+ it "should pass on any http options provided" do
196
+ opts = {:a => 2}
197
+ @api.should_receive(:rest_call).with(anything, anything, hash_including(opts))
198
+ @api.fql_multiquery("a query", {}, opts)
199
+ end
200
+ end
201
+ end
202
+ end
203
+
204
+ shared_examples_for "Koala RestAPI with an access token" do
205
+ # FQL
206
+ it "should be able to access public information via FQL" do
207
+ result = @api.fql_query('select first_name from user where uid = 216743')
208
+ result.size.should == 1
209
+ result.first['first_name'].should == 'Chris'
210
+ end
211
+
212
+ it "should be able to access public information via FQL.multiquery" do
213
+ result = @api.fql_multiquery(
214
+ :query1 => 'select first_name from user where uid = 216743',
215
+ :query2 => 'select first_name from user where uid = 2905623'
216
+ )
217
+ result.size.should == 2
218
+ result["query1"].first['first_name'].should == 'Chris'
219
+ result["query2"].first['first_name'].should == 'Alex'
220
+ end
221
+
222
+ it "should be able to access protected information via FQL" do
223
+ # Tests agains the permissions fql table
224
+
225
+ # get the current user's ID
226
+ # we're sneakily using the Graph API, which should be okay since it has its own tests
227
+ g = Koala::Facebook::GraphAPI.new(@token)
228
+ id = g.get_object("me", :fields => "id")["id"]
229
+
230
+ # now send a query about your permissions
231
+ result = @api.fql_query("select read_stream from permissions where uid = #{id}")
232
+
233
+ result.size.should == 1
234
+ # we've verified that you have read_stream permissions, so we can test against that
235
+ result.first["read_stream"].should == 1
236
+ end
237
+
238
+
239
+ it "should be able to access protected information via FQL.multiquery" do
240
+ result = @api.fql_multiquery(
241
+ :query1 => "select post_id from stream where source_id = me()",
242
+ :query2 => "select fromid from comment where post_id in (select post_id from #query1)",
243
+ :query3 => "select uid, name from user where uid in (select fromid from #query2)"
244
+ )
245
+ result.size.should == 3
246
+ result.keys.should include("query1", "query2", "query3")
247
+ end
248
+
249
+ end
250
+
251
+
252
+ shared_examples_for "Koala RestAPI without an access token" do
253
+ # FQL_QUERY
254
+ describe "when making a FQL request" do
255
+ it "should be able to access public information via FQL" do
256
+ @result = @api.fql_query("select first_name from user where uid = 216743")
257
+ @result.size.should == 1
258
+ @result.first["first_name"].should == "Chris"
259
+ end
260
+
261
+ it "should be able to access public information via FQL.multiquery" do
262
+ result = @api.fql_multiquery(
263
+ :query1 => 'select first_name from user where uid = 216743',
264
+ :query2 => 'select first_name from user where uid = 2905623'
265
+ )
266
+ result.size.should == 2
267
+ result["query1"].first['first_name'].should == 'Chris'
268
+ result["query2"].first['first_name'].should == 'Alex'
269
+ end
270
+
271
+ it "should not be able to access protected information via FQL" do
272
+ lambda { @api.fql_query("select read_stream from permissions where uid = 216743") }.should raise_error(Koala::Facebook::APIError)
273
+ end
274
+
275
+ it "should not be able to access protected information via FQL.multiquery" do
276
+ lambda {
277
+ @api.fql_multiquery(
278
+ :query1 => "select post_id from stream where source_id = me()",
279
+ :query2 => "select fromid from comment where post_id in (select post_id from #query1)",
280
+ :query3 => "select uid, name from user where uid in (select fromid from #query2)"
281
+ )
282
+ }.should raise_error(Koala::Facebook::APIError)
283
+ end
284
+ end
285
+ end
@@ -0,0 +1,51 @@
1
+ # small helper method for live testing
2
+ module KoalaTest
3
+ def self.validate_user_info(token)
4
+ print "Validating permissions for live testing..."
5
+ # make sure we have the necessary permissions
6
+ api = Koala::Facebook::GraphAndRestAPI.new(token)
7
+ perms = api.fql_query("select read_stream, publish_stream, user_photos, user_videos, read_insights from permissions where uid = me()")[0]
8
+ perms.each_pair do |perm, value|
9
+ if value == (perm == "read_insights" ? 1 : 0) # live testing depends on insights calls failing
10
+ puts "failed!\n" # put a new line after the print above
11
+ raise ArgumentError, "Your access token must have the read_stream, publish_stream, and user_photos permissions, and lack read_insights. You have: #{perms.inspect}"
12
+ end
13
+ end
14
+ puts "done!"
15
+ end
16
+ end
17
+
18
+
19
+ unless ENV['LIVE']
20
+ # By default the Koala specs are run using stubs for HTTP requests
21
+ #
22
+ # Valid OAuth token and code are not necessary to run these
23
+ # specs. Because of this, specs do not fail due to Facebook
24
+ # imposed rate-limits or server timeouts.
25
+ #
26
+ # However as a result they are more brittle since
27
+ # we are not testing the latest responses from the Facebook servers.
28
+ # Therefore, to be certain all specs pass with the current
29
+ # Facebook services, run koala_spec_without_mocks.rb.
30
+ Koala.http_service = Koala::MockHTTPService
31
+
32
+ $testing_data = Koala::MockHTTPService::TEST_DATA
33
+ else
34
+ # Runs Koala specs through the Facebook servers
35
+ #
36
+ # Note that you need a valid OAuth token and code for these
37
+ # specs to run. See facebook_data.yml for more information.
38
+
39
+ # load testing data (see note in readme.md)
40
+ $testing_data = YAML.load_file(File.join(File.dirname(__FILE__), '../fixtures/facebook_data.yml'))
41
+
42
+ unless $testing_data["oauth_token"]
43
+ puts "Access token tests will fail until you store a valid token in facebook_data.yml"
44
+ end
45
+
46
+ unless $testing_data["oauth_test_data"] && $testing_data["oauth_test_data"]["code"] && $testing_data["oauth_test_data"]["secret"]
47
+ puts "OAuth code tests will fail until you store valid data for the user's OAuth code and the app secret in facebook_data.yml"
48
+ end
49
+
50
+ KoalaTest.validate_user_info $testing_data["oauth_token"]
51
+ end
@@ -0,0 +1,76 @@
1
+ shared_examples_for "MIME::Types can't return results" do
2
+ {
3
+ "jpg" => "image/jpeg",
4
+ "jpeg" => "image/jpeg",
5
+ "png" => "image/png",
6
+ "gif" => "image/gif"
7
+ }.each_pair do |extension, mime_type|
8
+ it "should properly get content types for #{extension} using basic analysis" do
9
+ path = "filename.#{extension}"
10
+ if @koala_io_params[0].is_a?(File)
11
+ @koala_io_params[0].stub!(:path).and_return(path)
12
+ else
13
+ @koala_io_params[0] = path
14
+ end
15
+ Koala::UploadableIO.new(*@koala_io_params).content_type.should == mime_type
16
+ end
17
+
18
+ it "should get content types for #{extension} using basic analysis with file names with more than one dot" do
19
+ path = "file.name.#{extension}"
20
+ if @koala_io_params[0].is_a?(File)
21
+ @koala_io_params[0].stub!(:path).and_return(path)
22
+ else
23
+ @koala_io_params[0] = path
24
+ end
25
+ Koala::UploadableIO.new(*@koala_io_params).content_type.should == mime_type
26
+ end
27
+ end
28
+
29
+ describe "if the MIME type can't be determined" do
30
+ before :each do
31
+ path = "badfile.badextension"
32
+ if @koala_io_params[0].is_a?(File)
33
+ @koala_io_params[0].stub!(:path).and_return(path)
34
+ else
35
+ @koala_io_params[0] = path
36
+ end
37
+ end
38
+
39
+ it "should throw an exception if the MIME type can't be determined and the HTTP service requires content type" do
40
+ Koala.stub!(:multipart_requires_content_type?).and_return(true)
41
+ lambda { Koala::UploadableIO.new(*@koala_io_params) }.should raise_exception(Koala::KoalaError)
42
+ end
43
+
44
+ it "should just have @content_type == nil if the HTTP service doesn't require content type" do
45
+ Koala.stub!(:multipart_requires_content_type?).and_return(false)
46
+ Koala::UploadableIO.new(*@koala_io_params).content_type.should be_nil
47
+ end
48
+ end
49
+ end
50
+
51
+ shared_examples_for "determining a mime type" do
52
+ describe "if MIME::Types is available" do
53
+ it "should return an UploadIO with MIME::Types-determined type if the type exists" do
54
+ type_result = ["type"]
55
+ Koala::MIME::Types.stub(:type_for).and_return(type_result)
56
+ Koala::UploadableIO.new(*@koala_io_params).content_type.should == type_result.first
57
+ end
58
+ end
59
+
60
+ describe "if MIME::Types is unavailable" do
61
+ before :each do
62
+ # fake that MIME::Types doesn't exist
63
+ Koala::MIME::Types.stub(:type_for).and_raise(NameError)
64
+ end
65
+ it_should_behave_like "MIME::Types can't return results"
66
+ end
67
+
68
+ describe "if MIME::Types can't find the result" do
69
+ before :each do
70
+ # fake that MIME::Types doesn't exist
71
+ Koala::MIME::Types.stub(:type_for).and_return([])
72
+ end
73
+
74
+ it_should_behave_like "MIME::Types can't return results"
75
+ end
76
+ end
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koala
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 9
8
- - 0
9
- version: 0.9.0
4
+ prerelease:
5
+ version: 1.1.0
10
6
  platform: ruby
11
7
  authors:
12
8
  - Alex Koppel, Chris Baclig, Rafi Jacoby, Context Optional
@@ -14,69 +10,123 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2010-09-30 00:00:00 +02:00
13
+ date: 2011-07-18 00:00:00 +02:00
18
14
  default_executable:
19
- dependencies: []
20
-
21
- description: Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write access to the social graph via the Graph API and the older REST API, as well as support for realtime updates and OAuth and Facebook Connect authentication. Koala is fully tested and supports Net::HTTP and Typhoeus connections out of the box and can accept custom modules for other services.
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: multi_json
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: "1.0"
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: multipart-post
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: "1.0"
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: rspec
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: "2.5"
46
+ type: :development
47
+ prerelease: false
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: rake
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ version: 0.8.7
57
+ type: :development
58
+ prerelease: false
59
+ version_requirements: *id004
60
+ - !ruby/object:Gem::Dependency
61
+ name: typhoeus
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ~>
66
+ - !ruby/object:Gem::Version
67
+ version: 0.2.4
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: *id005
71
+ description: Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write access to the social graph via the Graph and REST APIs, as well as support for realtime updates and OAuth and Facebook Connect authentication. Koala is fully tested and supports Net::HTTP and Typhoeus connections out of the box and can accept custom modules for other services.
22
72
  email: alex@alexkoppel.com
23
73
  executables: []
24
74
 
25
75
  extensions: []
26
76
 
27
77
  extra_rdoc_files:
78
+ - readme.md
28
79
  - CHANGELOG
29
- - LICENSE
30
- - lib/koala.rb
31
- - lib/koala/graph_api.rb
32
- - lib/koala/http_services.rb
33
- - lib/koala/realtime_updates.rb
34
- - lib/koala/rest_api.rb
35
80
  files:
81
+ - .autotest
82
+ - .gitignore
83
+ - .travis.yml
36
84
  - CHANGELOG
85
+ - Gemfile
37
86
  - LICENSE
38
87
  - Manifest
39
88
  - Rakefile
40
- - examples/oauth_playground/Capfile
41
- - examples/oauth_playground/LICENSE
42
- - examples/oauth_playground/Rakefile
43
- - examples/oauth_playground/config.ru
44
- - examples/oauth_playground/config/deploy.rb
45
- - examples/oauth_playground/config/facebook.yml
46
- - examples/oauth_playground/lib/load_facebook.rb
47
- - examples/oauth_playground/lib/oauth_playground.rb
48
- - examples/oauth_playground/readme.md
49
- - examples/oauth_playground/spec/oauth_playground_spec.rb
50
- - examples/oauth_playground/spec/spec_helper.rb
51
- - examples/oauth_playground/tmp/restart.txt
52
- - examples/oauth_playground/views/index.erb
53
- - examples/oauth_playground/views/layout.erb
54
- - init.rb
89
+ - autotest/discover.rb
55
90
  - koala.gemspec
56
91
  - lib/koala.rb
92
+ - lib/koala/batch_operation.rb
57
93
  - lib/koala/graph_api.rb
94
+ - lib/koala/graph_batch_api.rb
95
+ - lib/koala/graph_collection.rb
58
96
  - lib/koala/http_services.rb
97
+ - lib/koala/http_services/net_http_service.rb
98
+ - lib/koala/http_services/typhoeus_service.rb
99
+ - lib/koala/oauth.rb
59
100
  - lib/koala/realtime_updates.rb
60
101
  - lib/koala/rest_api.rb
102
+ - lib/koala/test_users.rb
103
+ - lib/koala/uploadable_io.rb
61
104
  - readme.md
62
- - spec/facebook_data.yml
63
- - spec/koala/api_base_tests.rb
64
- - spec/koala/graph_and_rest_api/graph_and_rest_api_no_token_tests.rb
65
- - spec/koala/graph_and_rest_api/graph_and_rest_api_with_token_tests.rb
66
- - spec/koala/graph_api/graph_api_no_access_token_tests.rb
67
- - spec/koala/graph_api/graph_api_with_access_token_tests.rb
68
- - spec/koala/graph_api/graph_collection_tests.rb
69
- - spec/koala/live_testing_data_helper.rb
70
- - spec/koala/net_http_service_tests.rb
71
- - spec/koala/oauth/oauth_tests.rb
72
- - spec/koala/realtime_updates/realtime_updates_tests.rb
73
- - spec/koala/rest_api/rest_api_no_access_token_tests.rb
74
- - spec/koala/rest_api/rest_api_with_access_token_tests.rb
75
- - spec/koala_spec.rb
76
- - spec/koala_spec_helper.rb
77
- - spec/koala_spec_without_mocks.rb
78
- - spec/mock_facebook_responses.yml
79
- - spec/mock_http_service.rb
105
+ - spec/cases/api_base_spec.rb
106
+ - spec/cases/graph_and_rest_api_spec.rb
107
+ - spec/cases/graph_api_batch_spec.rb
108
+ - spec/cases/graph_api_spec.rb
109
+ - spec/cases/http_services/http_service_spec.rb
110
+ - spec/cases/http_services/net_http_service_spec.rb
111
+ - spec/cases/http_services/typhoeus_service_spec.rb
112
+ - spec/cases/koala_spec.rb
113
+ - spec/cases/oauth_spec.rb
114
+ - spec/cases/realtime_updates_spec.rb
115
+ - spec/cases/rest_api_spec.rb
116
+ - spec/cases/test_users_spec.rb
117
+ - spec/cases/uploadable_io_spec.rb
118
+ - spec/fixtures/beach.jpg
119
+ - spec/fixtures/cat.m4v
120
+ - spec/fixtures/facebook_data.yml
121
+ - spec/fixtures/mock_facebook_responses.yml
122
+ - spec/spec_helper.rb
123
+ - spec/support/graph_api_shared_examples.rb
124
+ - spec/support/json_testing_fix.rb
125
+ - spec/support/live_testing_data_helper.rb
126
+ - spec/support/mock_http_service.rb
127
+ - spec/support/rest_api_shared_examples.rb
128
+ - spec/support/setup_mocks_or_live.rb
129
+ - spec/support/uploadable_io_shared_examples.rb
80
130
  has_rdoc: true
81
131
  homepage: http://github.com/arsduo/koala
82
132
  licenses: []
@@ -87,31 +137,53 @@ rdoc_options:
87
137
  - --inline-source
88
138
  - --title
89
139
  - Koala
90
- - --main
91
- - readme.md
92
140
  require_paths:
93
141
  - lib
94
142
  required_ruby_version: !ruby/object:Gem::Requirement
143
+ none: false
95
144
  requirements:
96
145
  - - ">="
97
146
  - !ruby/object:Gem::Version
147
+ hash: -702788258280667645
98
148
  segments:
99
149
  - 0
100
150
  version: "0"
101
151
  required_rubygems_version: !ruby/object:Gem::Requirement
152
+ none: false
102
153
  requirements:
103
154
  - - ">="
104
155
  - !ruby/object:Gem::Version
105
- segments:
106
- - 1
107
- - 2
108
156
  version: "1.2"
109
157
  requirements: []
110
158
 
111
- rubyforge_project: koala
112
- rubygems_version: 1.3.6
159
+ rubyforge_project:
160
+ rubygems_version: 1.6.2
113
161
  signing_key:
114
162
  specification_version: 3
115
- summary: A lightweight, flexible library for Facebook with support for the Graph API, the old REST API, realtime updates, and OAuth validation.
116
- test_files: []
117
-
163
+ summary: A lightweight, flexible library for Facebook with support for the Graph API, the REST API, realtime updates, and OAuth authentication.
164
+ test_files:
165
+ - spec/cases/api_base_spec.rb
166
+ - spec/cases/graph_and_rest_api_spec.rb
167
+ - spec/cases/graph_api_batch_spec.rb
168
+ - spec/cases/graph_api_spec.rb
169
+ - spec/cases/http_services/http_service_spec.rb
170
+ - spec/cases/http_services/net_http_service_spec.rb
171
+ - spec/cases/http_services/typhoeus_service_spec.rb
172
+ - spec/cases/koala_spec.rb
173
+ - spec/cases/oauth_spec.rb
174
+ - spec/cases/realtime_updates_spec.rb
175
+ - spec/cases/rest_api_spec.rb
176
+ - spec/cases/test_users_spec.rb
177
+ - spec/cases/uploadable_io_spec.rb
178
+ - spec/fixtures/beach.jpg
179
+ - spec/fixtures/cat.m4v
180
+ - spec/fixtures/facebook_data.yml
181
+ - spec/fixtures/mock_facebook_responses.yml
182
+ - spec/spec_helper.rb
183
+ - spec/support/graph_api_shared_examples.rb
184
+ - spec/support/json_testing_fix.rb
185
+ - spec/support/live_testing_data_helper.rb
186
+ - spec/support/mock_http_service.rb
187
+ - spec/support/rest_api_shared_examples.rb
188
+ - spec/support/setup_mocks_or_live.rb
189
+ - spec/support/uploadable_io_shared_examples.rb
@@ -1,2 +0,0 @@
1
- load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2
- load 'config/deploy' # remove this line to skip loading any of the default tasks
@@ -1,22 +0,0 @@
1
- Copyright (c) 2010 Alex Koppel
2
-
3
- Permission is hereby granted, free of charge, to any person
4
- obtaining a copy of this software and associated documentation
5
- files (the "Software"), to deal in the Software without
6
- restriction, including without limitation the rights to use,
7
- copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the
9
- Software is furnished to do so, subject to the following
10
- conditions:
11
-
12
- The above copyright notice and this permission notice shall be
13
- included in all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
@@ -1,4 +0,0 @@
1
- namespace :oauth_playground do
2
-
3
-
4
- end