koala 0.4 → 3.7.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 (71) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/test.yml +32 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +1 -0
  5. data/.yardopts +3 -0
  6. data/Gemfile +25 -0
  7. data/ISSUE_TEMPLATE +25 -0
  8. data/LICENSE +22 -0
  9. data/Manifest +32 -5
  10. data/PULL_REQUEST_TEMPLATE +11 -0
  11. data/Rakefile +12 -12
  12. data/changelog.md +781 -0
  13. data/code_of_conduct.md +74 -0
  14. data/koala.gemspec +28 -24
  15. data/lib/koala/api/batch_operation.rb +86 -0
  16. data/lib/koala/api/graph_api_methods.rb +504 -0
  17. data/lib/koala/api/graph_batch_api.rb +167 -0
  18. data/lib/koala/api/graph_collection.rb +129 -0
  19. data/lib/koala/api/graph_error_checker.rb +72 -0
  20. data/lib/koala/api.rb +159 -0
  21. data/lib/koala/configuration.rb +56 -0
  22. data/lib/koala/errors.rb +126 -0
  23. data/lib/koala/http_service/request.rb +133 -0
  24. data/lib/koala/http_service/response.rb +20 -0
  25. data/lib/koala/http_service/uploadable_io.rb +183 -0
  26. data/lib/koala/http_service.rb +108 -0
  27. data/lib/koala/oauth.rb +342 -0
  28. data/lib/koala/realtime_updates.rb +151 -0
  29. data/lib/koala/test_users.rb +189 -0
  30. data/lib/koala/utils.rb +41 -0
  31. data/lib/koala/version.rb +3 -0
  32. data/lib/koala.rb +51 -291
  33. data/readme.md +269 -21
  34. data/spec/cases/api_spec.rb +362 -0
  35. data/spec/cases/configuration_spec.rb +11 -0
  36. data/spec/cases/error_spec.rb +143 -0
  37. data/spec/cases/graph_api_batch_spec.rb +788 -0
  38. data/spec/cases/graph_api_spec.rb +76 -0
  39. data/spec/cases/graph_collection_spec.rb +192 -0
  40. data/spec/cases/graph_error_checker_spec.rb +147 -0
  41. data/spec/cases/http_service/request_spec.rb +250 -0
  42. data/spec/cases/http_service/response_spec.rb +24 -0
  43. data/spec/cases/http_service_spec.rb +280 -0
  44. data/spec/cases/koala_spec.rb +57 -0
  45. data/spec/cases/koala_test_spec.rb +5 -0
  46. data/spec/cases/oauth_spec.rb +647 -0
  47. data/spec/cases/realtime_updates_spec.rb +327 -0
  48. data/spec/cases/test_users_spec.rb +383 -0
  49. data/spec/cases/uploadable_io_spec.rb +266 -0
  50. data/spec/cases/utils_spec.rb +55 -0
  51. data/spec/fixtures/beach.jpg +0 -0
  52. data/spec/fixtures/cat.m4v +0 -0
  53. data/spec/fixtures/facebook_data.yml +63 -0
  54. data/spec/fixtures/mock_facebook_responses.yml +483 -0
  55. data/spec/fixtures/vcr_cassettes/app_test_accounts.yml +97 -0
  56. data/spec/fixtures/vcr_cassettes/friend_list_next_page.yml +121 -0
  57. data/spec/integration/graph_collection_spec.rb +24 -0
  58. data/spec/spec_helper.rb +25 -0
  59. data/spec/support/custom_matchers.rb +28 -0
  60. data/spec/support/graph_api_shared_examples.rb +534 -0
  61. data/spec/support/koala_test.rb +251 -0
  62. data/spec/support/mock_http_service.rb +140 -0
  63. data/spec/support/uploadable_io_shared_examples.rb +70 -0
  64. metadata +206 -62
  65. data/CHANGELOG +0 -24
  66. data/init.rb +0 -2
  67. data/lib/http_services.rb +0 -60
  68. data/test/facebook_data.yml +0 -5
  69. data/test/koala/facebook_no_access_token_tests.rb +0 -119
  70. data/test/koala/facebook_with_access_token_tests.rb +0 -106
  71. data/test/koala_tests.rb +0 -30
data/changelog.md ADDED
@@ -0,0 +1,781 @@
1
+ Unreleased
2
+ ==========
3
+
4
+ **Key breaking changes:**
5
+
6
+ New features:
7
+
8
+ Updated features:
9
+
10
+ Removed features:
11
+
12
+ Internal improvements:
13
+
14
+ Testing improvements:
15
+
16
+ Others:
17
+
18
+ v3.7.0 (2025-08-27)
19
+ ==========
20
+
21
+ Internal improvements:
22
+
23
+ * explicitly require ostruct for ruby >= 3.3.5 ([694](https://github.com/arsduo/koala/pull/694))
24
+ * explicitly require cgi for ruby >= 3.5.0 ([702](https://github.com/arsduo/koala/pull/702))
25
+
26
+ Testing improvements:
27
+
28
+ * Add ruby 3.4 to CI ([696](https://github.com/arsduo/koala/pull/696))
29
+ * Fix json assertions in CI ([701](https://github.com/arsduo/koala/pull/701))
30
+ * Fix ruby 3.5 CI ([702](https://github.com/arsduo/koala/pull/702))
31
+
32
+ v3.6.0 (2024-06-27)
33
+ ==========
34
+
35
+ Updated features:
36
+
37
+ * Add fbtrace_id, x-fb-rev, x-fb-debug to error messages and error class ([#668](https://github.com/arsduo/koala/pull/686))
38
+ * Handles the invalid JSON response from Facebook when the request's http_options[:http_component] is set to ':response' ([#689](https://github.com/arsduo/koala/pull/689))
39
+
40
+ Internal improvements:
41
+
42
+ * Require base64 for ruby 3.4 support ([#688](https://github.com/arsduo/koala/pull/688))
43
+
44
+ Testing improvements:
45
+
46
+ * Fix CI for ruby 3.4 ([#688](https://github.com/arsduo/koala/pull/688))
47
+ * Add latest rubies to CI ([#687](https://github.com/arsduo/koala/pull/687))
48
+ * Bump GHA action plugins to avoid deprecation warnings ([#689](https://github.com/arsduo/koala/pull/689))
49
+
50
+ v3.5.0 (2023-08-23)
51
+ ======
52
+
53
+ Internal improvements:
54
+ * Raise ClientError instead of NoMethodError when body is 'null' ([#673](https://github.com/arsduo/koala/issues/673))
55
+
56
+ v3.4.0 (2023-01-05)
57
+ ======
58
+
59
+ Updated features:
60
+
61
+ * Force use by default of HTTPS (instead of HTTP) when there is no access token.
62
+ HTTP can still be used by passing :use_ssl => false in the options hash for an api call ([#678](https://github.com/arsduo/koala/pull/678/files))
63
+
64
+ v3.3.0 (2022-09-27)
65
+ ======
66
+
67
+ Updated features:
68
+
69
+ * Removed restriction on faraday < 2 ([#666](https://github.com/arsduo/koala/pull/666))
70
+
71
+ Internal improvements:
72
+
73
+ * Remove multipart hack and use default faraday multipart middleware ([#664](https://github.com/arsduo/koala/pull/664))
74
+
75
+ Testing improvements:
76
+
77
+ * Fix tests with ruby-head ([#674](https://github.com/arsduo/koala/pull/674))
78
+ * Keep supported rubies (non EOL) for CI ([#675](https://github.com/arsduo/koala/pull/675))
79
+
80
+ v3.2.0 (2022-05-27)
81
+ ======
82
+
83
+ New features:
84
+
85
+ * Exposes limiting headers(`x-business-use-case-usage, x-ad-account-usage, x-app-usage`) to APIError ([#668](https://github.com/arsduo/koala/pull/668))
86
+ * Add `rate_limit_hook` configuration to get rate limiting headers (`x-business-use-case-usage, x-ad-account-usage, x-app-usage`) ([#670](https://github.com/arsduo/koala/pull/670))
87
+
88
+ Testing improvements:
89
+
90
+ * Fix builds for ruby 3.x
91
+
92
+ v3.1.0 (2022-01-18)
93
+ ======
94
+
95
+ New features:
96
+
97
+ * mask_tokens config (default: true) to mask tokens in logs
98
+
99
+ Updated features:
100
+
101
+ * Log before and after sending request
102
+
103
+ Internal improvements:
104
+
105
+ * Lock Faraday to < 2
106
+ * Compatibility with ruby 3.x
107
+
108
+ Testing improvements:
109
+
110
+ * Use Github actions for CI
111
+ * Run CI on latest rubies
112
+
113
+ v3.0.0 (2017-03-17)
114
+ ======
115
+
116
+ Most users should not see any difference upgrading from 2.x to 3.0. Most of the changes are
117
+ internal to how requests go from a graph method (like `get_connections`) through the API to the
118
+ HTTP layer and back. If you're not using API#api or HTTPService.make_request directly, upgrading
119
+ should (in theory) require no code changes. (Let me know if you run into any issues.)
120
+
121
+ **Key breaking changes:**
122
+
123
+ * Koala now requires Ruby 2.1+ (or equivalent for JRuby, etc.)
124
+ * API#api now returns a Koala::HTTPService::Response object; graph_call handles further processing
125
+ * GraphBatchAPI no longer inherits from API (the interface is otherwise unchanged)
126
+ * Empty response bodies in batch API calls will raise a JSON::ParserError rather than returning nil
127
+ * HTTPService.make_request now requires an HTTPService::Request object (Koala.make_request does
128
+ not)
129
+ * HTTPService behavior *should not* change, but in edge cases might. (If so, please let me know.)
130
+ * API#search now requires a "type"/:type argument, matching Facebook's behavior (improving their
131
+ cryptic error message)
132
+
133
+ New features:
134
+
135
+ * Koala now supports global configuration for tokens, secrets, etc! See the readme.
136
+ * GraphCollection now exposes #headers, allowing access to etag/rate limiting/etc. info (thanks,
137
+ pawandubey and jessieay!) (#589)
138
+
139
+ Updated features:
140
+
141
+ * Koala.config now uses a dedicated Koala::Configuration object
142
+ * TestUser#befriend will provide the appsecret_proof if a secret is set (thanks, kwasimensah!)
143
+ * API#search now requires an object type parameter to be included, matching Facebook's API (#575)
144
+ * RealtimeUpdates will now only fetch the app access token if necessary, avoiding unnecessary calls
145
+
146
+ Removed features:
147
+
148
+ * Removed support for the Rest API, since Facebook removed support for it (#568)
149
+ * Removed support for FQL, which Facebook removed on August 8, 2016 (#569)
150
+ * Removed legacy duplication of serveral constants in the Koala module (#569)
151
+ * Removed API#get_comments_for_urls, which pointed to a no-longer-extant endpoint(#570)
152
+
153
+ Internal improvements:
154
+
155
+ * Completely rewrote HTTPService.make_request and several others, extracting most logic into
156
+ HTTPService::Request (#566)
157
+ * API#api now returns a Koala::HTTPService::Response object (#584)
158
+ * GraphBatchAPI no longer inherits from API (#580)
159
+ * GraphBatchAPI has been refactored to be simpler and more readable (thanks, acuppy!) (#551)
160
+ * Use the more secure JSON.parse instead of JSON.load (thanks, lautis!) (#567)
161
+ * Use JSON's quirks_mode option to remove hacky JSON hack (#573 -- thanks sakuro for the
162
+ suggestion!)
163
+ * The gemspec now allows both JSON 1.8 and 2.0 (#596) (thanks, pawandubey!)
164
+ * Remove Autotest and Guard references (no longer used/needed)
165
+
166
+ Testing improvements:
167
+
168
+ * Fixed a bunch of failing mocked specs
169
+
170
+ Others:
171
+
172
+ * Added an issue and pull request template
173
+ * Updated Code of Conduct to 1.4
174
+
175
+ v2.5.0 (2017-02-17)
176
+ ======
177
+
178
+ New features:
179
+
180
+ * API#get_object_metadata provides a convenient accessor to an object's graph metadata (thanks, sancopanco!)
181
+
182
+ Documentation improvements:
183
+
184
+ * Add explicit require to examples in readme.md (thanks, dwkns!)
185
+
186
+ Internal improvements:
187
+
188
+ * Remove MultiJson dependency (thanks, sakuro!)
189
+
190
+ v2.4.0 (2016-07-08)
191
+ ======
192
+
193
+ **Note:** Koala is no longer officially supported on Ruby 1.9.3 (which was [end-of-lifed back in
194
+ 2015](https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/)). Versions may
195
+ still work (until version 3.0, when we may start using keyword arguments), but will not be tested
196
+ on 1.9.3.
197
+
198
+ Updated features:
199
+
200
+ * Batch API requests will now properly calculate appsecret_proofs for multiple access tokens
201
+ (thanks, mwpastore!)
202
+
203
+ Internal improvements:
204
+
205
+ * Koala now explicitly depends on MultiJson >= 1.3.0, since it uses methods introduced in that
206
+ version
207
+
208
+ Testing improvements:
209
+
210
+ * Test Koala against Ruby 2.3.0 (thanks, thedrow!)
211
+
212
+
213
+ v2.3.0 (2016-04-10)
214
+ ======
215
+
216
+ Updated features:
217
+
218
+ * API#get_user_picture_data is now API#get_picture_data. The old method and API#get_picture both
219
+ remain with deprecation warnings. (Thanks noahsilas for earlier work on this!)
220
+ * Koala::Facebook::APIError now includes [debug and trace
221
+ info](https://github.com/arsduo/koala/blob/master/lib/koala/errors.rb) provided by Facebook in the headers
222
+ (thanks, @elhu!)
223
+
224
+ Internal Improvements:
225
+
226
+ * Graph API error handling is now done via the GraphErrorChecker class
227
+
228
+ Testing improvements:
229
+
230
+ * Upgraded RSpec to 3.3.0
231
+ * Removed pended specs that were no longer relevant
232
+ * Improved https regex in test suite (thanks, lucaskds!)
233
+
234
+ v2.2.0 (2015-08-11)
235
+ ======
236
+
237
+ Updated features:
238
+
239
+ * Restore API#search, since Facebook still supports that for certain usecases (thanks, vhoof!)
240
+ * You can now specify format: :json in http_options to make Content-Type application/json requests (thanks, adparlor!)
241
+ * Koala now supports uploading videos by URL (thanks, filipegiusti!)
242
+ * GraphCollections now offer direct access to the collection summary data via #summary (thanks, vhoof!)
243
+
244
+ Internal Improvements:
245
+
246
+ * Use MultiJson::LoadError instead of the newer ParseError for backward compatibility (thanks, bunshin!)
247
+
248
+ Documentation improvements:
249
+
250
+ * modernize the hash syntax in the readme (thanks, st0012!)
251
+
252
+ v2.1.0
253
+ ======
254
+
255
+ Documentation improvements:
256
+
257
+ * extend/clean up code quality badges (thanks, jbender!)
258
+
259
+ v2.0.0
260
+ ======
261
+
262
+ Koala 2.0 is not a major refactor, but rather a set of small, mostly internal
263
+ refactors:
264
+
265
+ * BatchAPI now reads both access token and app secret from the original API
266
+ instance (thanks, lukeasrodgers!)
267
+ * Remove legacy interfaces (deprecated since 1.2)
268
+ * API#search (which Facebook doesn't support anymore)
269
+ * TestUser#graph\_api and RealtimeUpdates#graph\_api (use #api instead)
270
+ * Various HTTP options (see diff for deprecation warnings/upgrade
271
+ instructions for each method)
272
+ * NetHTTPService and TyphoeusHTTPService (see diff for deprecation
273
+ warnings/upgrade instructions)
274
+ * OAuth methods for dealing with session tokens (which Facebook stopped
275
+ providing)
276
+ * OAuth#get\_user\_from\_cookies (use get\_user\_info\_from\_cookies instead)
277
+ * Blocks passed to API#get_picture will work in the batch API (thanks, cwhetung!)
278
+ * Added API#get_user_picture_data to get data about a picture (thanks, morgoth!)
279
+
280
+ Other changes:
281
+
282
+ * Test against modern Ruby versions on Travis (thanks, nicolasleger!)
283
+ * Speed up Travis builds (thanks, morgoth!)
284
+
285
+ v.1.11.1
286
+ ========
287
+
288
+ Bug fixes:
289
+ * Properly import Facebook error attributes (thanks, isra17!)
290
+
291
+ v.1.11.0
292
+ ========
293
+
294
+ Updated features:
295
+ * OAuth now supports decoding the new JSON responses from the access token endpoints (thanks, ridiculous!)
296
+ * Batch API now accepts either symbols or strings for the access token (thanks, mattmueller!)
297
+ * Incorporate user message and title into error handling (thanks, richrines and isra17!)
298
+
299
+ Bug fixes:
300
+ * Fixed bug in GraphCollection URL versioning (thanks, deviousdodo and jankowy!)
301
+ * TestUsers#create\_network now properly handles options (thanks, crx!)
302
+
303
+ Documentation improvements:
304
+ * Updated gem version (thanks, thomasklemm!)
305
+
306
+
307
+ v.1.10.1
308
+ ========
309
+
310
+ Bug fixes:
311
+
312
+ * Facebook API version now works in all cases (thanks, markprzepiora!)
313
+ * Fixed a typo in an example (thanks, mktakuya!)
314
+
315
+ v.1.10.0
316
+ ========
317
+
318
+ New features:
319
+ * API versioning is now supported through global and per-options requests
320
+ (Koala.config.api_version and the :api_version key specified as a per-request
321
+ options)
322
+
323
+ Updated features:
324
+ * API calls won't modify argument hashes in place anymore (thanks, MSex!)
325
+ * OAuth#dialog_url now uses https rather than http
326
+
327
+ Testing improvements:
328
+ * Use the modern RSpec syntax (thanks, loganhasson!)
329
+
330
+ Documentation improvements:
331
+ * Properly document the timeout option (thanks, bachand!)
332
+ * The gemspec now includes the license (thanks, coreyhaines!)
333
+
334
+ v1.9.0
335
+ ======
336
+
337
+ Updated Methods:
338
+ * API#new now takes an optional access_token, which will be used to generate
339
+ the appsecret_proof parameters ([thanks,
340
+ nchelluri!](https://github.com/arsduo/koala/pull/323))
341
+
342
+ Testing Improvements:
343
+ * Add 2.1.0 to travis.yml and update specs to pass w/o deprecation on RSpec 3.0
344
+ ([thanks](https://github.com/arsduo/koala/pull/350),
345
+ [petergoldstein](https://github.com/arsduo/koala/pull/348)!)
346
+ * With 1.9.0+ only support, removed the OrderedHash patch
347
+
348
+ Documentation Improvements:
349
+ * Make it clear that connections take a singlar form in API#put_connection
350
+ (thanks, [josephdburdick](https://github.com/arsduo/koala/pull/349)!)
351
+
352
+ v1.8.0
353
+ =========
354
+
355
+ NOTE: Due to updates to underlying gems, new versions of Koala no longer work
356
+ with Ruby 1.8.x, rbx/jruby in 1.8 mode, and Ruby 1.9.2. Earlier versions will,
357
+ of course, continue to work, since the underlying Facebook API remains the
358
+ same.
359
+
360
+ If you, tragically, find yourself stuck using these old versions, you may be
361
+ able to get Koala to work by adding proper constraints to your Gemfile. Good
362
+ luck.
363
+
364
+ New methods:
365
+ * OAuth#generate_client_code lets you get long-lived user tokens for client apps (thanks, binarygeek!)
366
+
367
+ Updated methods:
368
+ * GraphCollection#next_page and #previous_page can now take additional
369
+ parameters ([thanks, gacha!](https://github.com/arsduo/koala/pull/330))
370
+
371
+ NOTE: the appsecret_proof update from nchelluri was originally listed in the
372
+ changelog for 1.8.0, but didn't make it in. It's now properly in the changelog
373
+ for 1.9.0.
374
+
375
+ Internal Improvements:
376
+ * FIXED: TestUser#delete_all will avoid infinite loops if the user hashes
377
+ change ([thanks, chunkerchunker!](https://github.com/arsduo/koala/pull/331))
378
+ * CHANGED: Koala now properly uploads Tempfiles like Files, detecting mime type (thanks, ys!)
379
+ * CHANGED: Koala now only passes valid Faraday options, improving compatibility with 0.9 (thanks, lsimoneau!)
380
+ * FIXED: RealtimeUpdates#validate_update now raise a proper error if secret is missing (thanks, theosp!)
381
+
382
+ Testing improvements:
383
+ * Fixed RSpec deprecations (thanks, sanemat!)
384
+
385
+ v1.7
386
+ ====
387
+
388
+ New methods:
389
+ * API#debug_token allows you to examine user tokens (thanks, Cyril-sf!)
390
+ * Koala.config allows you to set Facebook servers (to use proxies, etc.) (thanks, bnorton!)
391
+
392
+ Internal improvements:
393
+ * CHANGED: Parameters can now be Arrays of non-enumerable values, which get comma-separated (thanks, csaunders!)
394
+ * CHANGED: API#put_wall_post now automatically encodes parameters hashes as JSON
395
+ * CHANGED: GraphCollections returned by batch API calls retain individual access tokens (thanks, billvieux!)
396
+ * CHANGED: Gem version restrictions have been removed, and versions updated.
397
+ * CHANGED: How support files are loaded in spec_helper has been improved.
398
+ * FIXED: API#get_picture returns nil if FB returns no result, rather than error (thanks, mtparet!)
399
+ * FIXED: Koala now uses the right grant_type value for fetching app access tokens (thanks, miv!)
400
+ * FIXED: Koala now uses the modern OAuth endpoint for generating codes (thanks, jayeff!)
401
+ * FIXED: Misc small fixes, typos, etc. (thanks, Ortuna, Crunch09, sagarbommidi!)
402
+
403
+ Testing improvements:
404
+ * FIXED: MockHTTPService compares Ruby objects rather than strings.
405
+ * FIXED: Removed deprecated usage of should_not_receive.and_return (thanks, Cyril-sf!)
406
+ * FIXED: Test suite now supports Typhoeus 0.5 (thanks, Cyril-sf!)
407
+ * CHANGED: Koala now tests against Ruby 2.0 on Travis (thanks, sanemat!)
408
+
409
+ v1.6
410
+ ====
411
+
412
+ New methods:
413
+ * RealtimeUpdates#validate_update to validate the signature of a Facebook call (thanks, gaffo!)
414
+
415
+ Updated methods:
416
+ * Graph API methods now accepts a post processing block, see readme for examples (thanks, wolframarnold!)
417
+
418
+ Internal improvements:
419
+ * Koala now returns more specific and useful error classes (thanks, archfear!)
420
+ * Switched URL parsing to addressable, which can handle unusual FB URLs (thanks, bnorton!)
421
+ * Fixed Batch API bug that seems to have broken calls requiring post-processing
422
+ * Bump Faraday requirement to 0.8 (thanks, jarthod!)
423
+ * Picture and video URLs now support unicode characters (thanks, jayeff!)
424
+
425
+ Testing improvements:
426
+ * Cleaned up some test suites (thanks, bnorton!)
427
+
428
+ Documentation:
429
+ * Changelog is now markdown
430
+ * Code highlighting in readme (thanks, sfate!)
431
+ * Added Graph API explorer link in readme (thanks, jch!)
432
+ * Added permissions example for OAuth (thanks, sebastiandeutsch!)
433
+
434
+ v1.5
435
+ ====
436
+
437
+ New methods:
438
+ * Added Koala::Utils.logger to enable debugging (thanks, KentonWhite!)
439
+ * Expose fb_error_message and fb_error_code directly in APIError
440
+
441
+ Updated methods:
442
+ * GraphCollection.parse_page_url now uses the URI library and can parse any address (thanks, bnorton!)
443
+
444
+ Internal improvements:
445
+ * Update MultiJson dependency to support the Oj library (thanks, eckz and zinenko!)
446
+ * Loosened Faraday dependency (thanks, rewritten and romanbsd!)
447
+ * Fixed typos (thanks, nathanbertram!)
448
+ * Switched uses of put_object to the more semantically accurate put_connections
449
+ * Cleaned up gemspec
450
+ * Handle invalid batch API responses better
451
+
452
+ Documentation:
453
+ * Added HTTP Services description for Faraday 0.8/persistent connections (thanks, romanbsd!)
454
+ * Remove documentation of the old pre-1.2 HTTP Service options
455
+
456
+ v1.4.1
457
+ =======
458
+
459
+ * Update MultiJson to 1.3 and change syntax to silence warnings (thanks, eckz and masterkain!)
460
+
461
+ v1.4
462
+ ====
463
+
464
+ New methods:
465
+ * OAuth#exchange_access_token(_info) allows you to extend access tokens you receive (thanks, etiennebarrie!)
466
+
467
+ Updated methods:
468
+ * HTTPServices#encode_params sorts parameters to aid in URL comparison (thanks, sholden!)
469
+ * get_connections is now aliased as get_connection (use whichever makes sense to you)
470
+
471
+ Internal improvements:
472
+ * Fixed typos (thanks, brycethornton and jpemberthy!)
473
+ * RealtimeUpdates will no longer execute challenge block unnecessarily (thanks, iainbeeston!)
474
+
475
+ Testing improvements:
476
+ * Added parallel_tests to development gem file
477
+ * Fixed failing live tests
478
+ * Koala now tests against JRuby and Rubinius in 1.9 mode on Travis-CI
479
+
480
+ v1.3
481
+ ====
482
+
483
+ New methods:
484
+ * OAuth#url_for_dialog creates URLs for Facebook dialog pages
485
+ * API#set_app_restrictions handles JSON-encoding app restrictions
486
+ * GraphCollection.parse_page_url now exposes useful functionality for non-Rails apps
487
+ * RealtimeUpdates#subscription_path and TestUsers#test_user_accounts_path are now public
488
+
489
+ Updated methods:
490
+ * REST API methods are now deprecated (see http://developers.facebook.com/blog/post/616/)
491
+ * OAuth#url_for_access_token and #url_for_oauth_code now include any provided options as URL parameters
492
+ * APIError#raw_response allows access to the raw error response received from Facebook
493
+ * Utils.deprecate only prints each message once (no more spamming)
494
+ * API#get_page_access_token now accepts additional arguments and HTTP options (like other calls)
495
+ * TestUsers and RealtimeUpdates methods now take http_options arguments
496
+ * All methods with http_options can now take :http_component => :response for the complete response
497
+ * OAuth#get_user_info_from_cookies returns nil rather than an error if the cookies are expired (thanks, herzio)
498
+ * TestUsers#delete_all now uses the Batch API and is much faster
499
+
500
+ Internal improvements:
501
+ * FQL queries now use the Graph API behind-the-scenes
502
+ * Cleaned up file and class organization, with aliases for backward compatibility
503
+ * Added YARD documentation throughout
504
+ * Fixed bugs in RealtimeUpdates, TestUsers, elsewhere
505
+ * Reorganized file and class structure non-destructively
506
+
507
+ Testing improvements:
508
+ * Expanded/improved test coverage
509
+ * The test suite no longer users any hard-coded user IDs
510
+ * KoalaTest.test_user_api allows access to the TestUsers instance
511
+ * Configured tests to run in random order using RSpec 2.8.0rc1
512
+
513
+ v1.2.1
514
+ ======
515
+
516
+ New methods:
517
+ * RestAPI.set_app_properties handles JSON-encoding application properties
518
+
519
+ Updated methods:
520
+ * OAuth.get_user_from_cookie works with the new signed cookie format (thanks, gmccreight!)
521
+ * Beta server URLs are now correct
522
+ * OAuth.parse_signed_request now raises an informative error if the signed_request is malformed
523
+
524
+ Internal improvements:
525
+ * Koala::Multipart middleware properly encoding nested parameters (hashes) in POSTs
526
+ * Updated readme, changelog, etc.
527
+
528
+ Testing improvements:
529
+ * Live tests with test users now clean up all fake users they create
530
+ * Removed duplicate test cases
531
+ * Live tests with test users no longer delete each object they create, speeding things up
532
+
533
+ v1.2
534
+ ====
535
+
536
+ New methods:
537
+ * API is now the main API class, contains both Graph and REST methods
538
+ * Old classes are aliased with deprecation warnings (non-breaking change)
539
+ * TestUsers#update lets you update the name or password of an existing test user
540
+ * API.get_page_access_token lets you easily fetch the access token for a page you manage (thanks, marcgg!)
541
+ * Added version.rb (Koala::VERSION)
542
+
543
+ Updated methods:
544
+ * OAuth now parses Facebook's new signed cookie format
545
+ * API.put_picture now accepts URLs to images (thanks, marcgg!)
546
+ * Bug fixes to put_picture, parse_signed_request, and the test suite (thanks, johnbhall and Will S.!)
547
+ * Smarter GraphCollection use
548
+ * Any pageable result will now become a GraphCollection
549
+ * Non-pageable results from get_connections no longer error
550
+ * GraphCollection.raw_results allows access to original result data
551
+ * Koala no longer enforces any limits on the number of test users you create at once
552
+
553
+ Internal improvements:
554
+ * Koala now uses Faraday to make requests, replacing the HTTPServices (see wiki)
555
+ * Koala::HTTPService.http_options allows specification of default Faraday connection options
556
+ * Koala::HTTPService.faraday_middleware allows custom middleware configurations
557
+ * Koala now defaults to Net::HTTP rather than Typhoeus
558
+ * Koala::NetHTTPService and Koala::TyphoeusService modules no longer exist
559
+ * Koala no longer automatically switches to Net::HTTP when uploading IO objects to Facebook
560
+ * RealTimeUpdates and TestUsers are no longer subclasses of API, but have their own .api objects
561
+ * The old .graph_api accessor is aliases to .api with a deprecation warning
562
+ * Removed deprecation warnings for pre-1.1 batch interface
563
+
564
+ Testing improvements:
565
+ * Live test suites now run against test users by default
566
+ * Test suite can be repeatedly run live without having to update facebook_data.yml
567
+ * OAuth code and session key tests cannot be run against test users
568
+ * Faraday adapter for live tests can be specified with ADAPTER=[your adapter] in the rspec command
569
+ * Live tests can be run against the beta server by specifying BETA=true in the rspec command
570
+ * Tests now pass against all rubies on Travis CI
571
+ * Expanded and refactored test coverage
572
+ * Fixed bug with YAML parsing in Ruby 1.9
573
+
574
+ v1.1
575
+ ====
576
+
577
+ New methods:
578
+ * Added Batch API support (thanks, seejohnrun and spiegela!)
579
+ * includes file uploads, error handling, and FQL
580
+ * Added GraphAPI#put_video
581
+ * Added GraphAPI#get_comments_for_urls (thanks, amrnt!)
582
+ * Added RestAPI#fql_multiquery, which simplifies the results (thanks, amrnt!)
583
+ * HTTP services support global proxy and timeout settings (thanks, itchy!)
584
+ * Net::HTTP supports global ca_path, ca_file, and verify_mode settings (thanks, spiegela!)
585
+
586
+ Updated methods:
587
+ * RealtimeUpdates now uses a GraphAPI object instead of its own API
588
+ * RestAPI#rest_call now has an optional last argument for method, for calls requiring POST, DELETE, etc. (thanks, sshilo!)
589
+ * Filename can now be specified when uploading (e.g. for Ads API) (thanks, sshilo!)
590
+ * get_objects([]) returns [] instead of a Facebook error in non-batch mode (thanks, aselder!)
591
+
592
+ Internal improvements:
593
+ * Koala is now more compatible with other Rubies (JRuby, Rubinius, etc.)
594
+ * HTTP services are more modular and can be changed on the fly (thanks, chadk!)
595
+ * Includes support for uploading StringIOs and other non-files via Net::HTTP even when using TyphoeusService
596
+ * Koala now uses multi_json to improve compatibility with Rubinius and other Ruby versions
597
+ * Koala now uses the modern Typhoeus API (thanks, aselder!)
598
+ * Koala now uses the current modern Net::HTTP interface (thanks, romanbsd!)
599
+ * Fixed bugs and typos (thanks, waynn, mokevnin, and tikh!)
600
+
601
+ v1.0
602
+ ====
603
+
604
+ New methods:
605
+ * Photo and file upload now supported through #put_picture
606
+ * Added UploadableIO class to manage file uploads
607
+ * Added a delete_like method (thanks to waseem)
608
+ * Added put_connection and delete_connection convenience methods
609
+
610
+ Updated methods:
611
+ * Search can now search places, checkins, etc. (thanks, rickyc!)
612
+ * You can now pass :beta => true in the http options to use Facebook's beta tier
613
+ * TestUser#befriend now requires user info hashes (id and access token) due to Facebook API changes (thanks, pulsd and kbighorse!)
614
+ * All methods now accept an http_options hash as their optional last parameter (thanks, spiegela!)
615
+ * url_for_oauth_code can now take a :display option (thanks, netbe!)
616
+ * Net::HTTP can now accept :timeout and :proxy options (thanks, gilles!)
617
+ * Test users now supports using test accounts across multiple apps
618
+
619
+ Internal improvements:
620
+ * For public requests, Koala now uses http by default (instead of https) to improve speed
621
+ * This can be overridden through Koala.always_use_ssl= or by passing :use_ssl => true in the options hash for an api call
622
+ * Read-only REST API requests now go through the faster api-read server
623
+ * Replaced parse_signed_request with a version from Facebook that also supports the new signed params proposal
624
+ * Note: invalid requests will now raise exceptions rather than return nil, in keeping with other SDKs
625
+ * Delete methods will now raise an error if there's no access token (like put_object and delete_like)
626
+ * Updated parse_signed_request to match Facebook's current implementation (thanks, imajes!)
627
+ * APIError is now < StandardError, not Exception
628
+ * Added KoalaError for non-API errors
629
+ * Net::HTTP's SSL verification is no longer disabled by default
630
+
631
+ Test improvements:
632
+ * Incorporated joshk's awesome rewrite of the entire Koala test suite (thanks, joshk!)
633
+ * Expanded HTTP service tests (added Typhoeus test suite and additional Net::HTTP test cases)
634
+ * Live tests now verify that the access token has the necessary permissions before starting
635
+ * Replaced the 50-person network test, which often took 15+ minutes to run live, with a 5-person test
636
+
637
+ v0.10.0
638
+ =======
639
+
640
+ * Added test user module
641
+ * Fixed bug when raising APIError after Facebook fails to exchange session keys
642
+ * Made access_token accessible via the readonly access_token property on all our API classes
643
+
644
+ v0.9.1
645
+ ======
646
+
647
+ * Tests are now compatible with Ruby 1.9.2
648
+ * Added JSON to runtime dependencies
649
+ * Removed examples directory (referenced from github instead)
650
+
651
+ v0.9.0
652
+ ======
653
+
654
+ * Added parse_signed_request to handle Facebook's new authentication scheme
655
+ * note: creates dependency on OpenSSL (OpenSSL::HMAC) for decryption
656
+ * Added GraphCollection class to provide paging support for GraphAPI get_connections and search methods (thanks to jagthedrummer)
657
+ * Added get_page method to easily fetch pages of results from GraphCollections
658
+ * Exchanging sessions for tokens now works properly when provided invalid/expired session keys
659
+ * You can now include a :typhoeus_options key in TyphoeusService#make_request's options hash to control the Typhoeus call (for example, to set :disable_ssl_peer_verification => true)
660
+ * All paths provided to HTTP services start with leading / to improve compatibility with stubbing libraries
661
+ * If Facebook returns nil for search or get_connections requests, Koala now returns nil rather than throwing an exception
662
+
663
+ v0.8.0
664
+ ======
665
+
666
+ * Breaking interface changes
667
+ * Removed string overloading for the methods, per 0.7.3, which caused Marshaling issues
668
+ * Removed ability to provide a string as the second argument to url_for_access_token, per 0.5.0
669
+
670
+ v0.7.4
671
+ ======
672
+
673
+ * Fixed bug with get_user_from_cookies
674
+
675
+ v0.7.3
676
+ ======
677
+
678
+ * Added support for picture sizes -- thanks thhermansen for the patch!
679
+ * Adjusted the return values for several methods (get_access_token, get_app_access_token, get_token_from_session_key, get_tokens_from_session_keys, get_user_from_cookies)
680
+ * These methods now return strings, rather than hashes, which makes more sense
681
+ * The strings are overloaded with an [] method for backwards compatibility (Ruby is truly amazing)
682
+ * Using those methods triggers a deprecation warning
683
+ * This will be removed by 1.0
684
+ * There are new info methods (get_access_token_info, get_app_access_token_info, get_token_info_from_session_keys, and get_user_info_from_cookies) that natively return hashes, for when you want the expiration date
685
+ * Responses with HTTP status 500+ now properly throw errors under Net::HTTP
686
+ * Updated changelog
687
+ * Added license
688
+
689
+ v0.7.2
690
+ ======
691
+
692
+ * Added support for exchanging session keys for OAuth access tokens (get_token_from_session_key for single keys, get_tokens_from_session_keys for multiple)
693
+ * Moved Koala files into a koala/ subdirectory to minimize risk of name collisions
694
+ * Added OAuth Playground git submodule as an example
695
+ * Updated tests, readme, and changelog
696
+
697
+ v0.7.1
698
+ ======
699
+
700
+ * Updated RealtimeUpdates#list_subscriptions and GraphAPI#get_connections to now return an
701
+ array of results directly (rather than a hash with one key)
702
+ * Fixed a bug with Net::HTTP-based HTTP service in which the headers hash was improperly formatted
703
+ * Updated readme
704
+
705
+ v0.7.0
706
+ ======
707
+
708
+ * Added RealtimeUpdates class, which can be used to manage subscriptions for user updates (see http://developers.facebook.com/docs/api/realtime)
709
+ * Added picture method to graph API, which fetches an object's picture from the redirect headers.
710
+ * Added _greatly_ improved testing with result mocking, which is now the default set of tests
711
+ * Renamed live testing spec to koala_spec_without_mocks.rb
712
+ * Added Koala::Response class, which encapsulates HTTP results since Facebook sometimes sends data in the status or headers
713
+ * Much internal refactoring
714
+ * Updated readme, changelog, etc.
715
+
716
+ v0.6.0
717
+ ======
718
+
719
+ * Added support for the old REST API thanks to cbaclig's great work
720
+ * Updated tests to conform to RSpec standards
721
+ * Updated changelog, readme, etc.
722
+
723
+ v0.5.1
724
+ ======
725
+
726
+ * Documentation is now on the wiki, updated readme accordingly.
727
+
728
+ v0.5.0
729
+ ======
730
+
731
+ * Added several new OAuth methods for making and parsing access token requests
732
+ * Added test suite for the OAuth class
733
+ * Made second argument to url_for_access_token a hash (strings still work but trigger a deprecation warning)
734
+ * Added fields to facebook_data.yml
735
+ * Updated readme
736
+
737
+ v0.4.1
738
+ ======
739
+
740
+ * Encapsulated GraphAPI and OAuth classes in the Koala::Facebook module for clarity (and to avoid claiming the global Facebook class)
741
+ * Moved make_request method to Koala class from GraphAPI instance (for use by future OAuth class functionality)
742
+ * Renamed request method to api for consistancy with Javascript library
743
+ * Updated tests and readme
744
+
745
+ v0.4.0
746
+ ======
747
+
748
+ * Adopted the Koala name
749
+ * Updated readme and tests
750
+ * Fixed cookie verification bug for non-expiring OAuth tokens
751
+
752
+ v0.3.1
753
+ ======
754
+
755
+ * Bug fixes.
756
+
757
+ v0.3
758
+ ====
759
+
760
+ * Renamed Graph API class from Facebook::GraphAPI to FacebookGraph::API
761
+ * Created FacebookGraph::OAuth class for tokens and OAuth URLs
762
+ * Updated method for including HTTP service (think we've got it this time)
763
+ * Updated tests
764
+ * Added CHANGELOG and gemspec
765
+
766
+ v0.2
767
+ ====
768
+
769
+ * Gemified the project
770
+ * Split out HTTP services into their own file, and adjusted inclusion method
771
+
772
+ v0.1
773
+ ====
774
+
775
+ * Added modular support for Typhoeus
776
+ * Added tests
777
+
778
+ v0.0
779
+ ====
780
+
781
+ * Hi from F8! Basic read/write from the graph is working