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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cacc94480f8090c1c5380856b9315897e46b23b907efd411ab937d0c090d15ab
4
+ data.tar.gz: da676d048bd4d57e41eccef84cd72f7793ecad5e591728bac7ba45c51e01bb93
5
+ SHA512:
6
+ metadata.gz: 709df731e154734f941caba0b9df74aa3c0201f1e769bed433947e4dc54e6c3c27396560dfcaedd6eccaaa5d2d3a02f01b7d09e934ad70e97d7f37f766794efd
7
+ data.tar.gz: 9d15308a886501cedd51422a76a5e38e72b453ecfe0a067337b773b790c4a483cfc9c164c0299b62ca3f0cda0833201409b8e4dbdfbb934906df00888ef73516
@@ -0,0 +1,32 @@
1
+ name: Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ name: on ruby ${{matrix.ruby}}
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ ruby: [2.7, "3.0", 3.1, 3.2, 3.3, 3.4, head]
14
+
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v4
18
+
19
+ - name: Set up Ruby
20
+ uses: ruby/setup-ruby@v1
21
+ with:
22
+ ruby-version: ${{matrix.ruby}}
23
+
24
+ - name: Install dependencies
25
+ run: bundle install --jobs 4 --retry 3
26
+
27
+ - name: Specs & Coverage
28
+ uses: paambaati/codeclimate-action@v6
29
+ env:
30
+ CC_TEST_REPORTER_ID: 7af99d9225b4c14640f9ec3cb2e24d2f7103ac49417b0bd989188fb6c25f2909
31
+ with:
32
+ coverageCommand: bundle exec rspec
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ pkg
2
+ .project
3
+ Gemfile.lock
4
+ .rvmrc
5
+ *.rbc
6
+ *~
7
+ .yardoc/
8
+ .DS_Store
9
+ coverage
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color --order rand
data/.yardopts ADDED
@@ -0,0 +1,3 @@
1
+ --readme readme.md
2
+ --title "Koala Documentation"
3
+ --no-private
data/Gemfile ADDED
@@ -0,0 +1,25 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :development do
4
+ gem 'debugger', :platforms => [:mri_19]
5
+ gem 'byebug', :platforms => [:mri_20, :mri_21]
6
+ gem "yard"
7
+ end
8
+
9
+ group :development, :test do
10
+ gem "psych", '< 4.0.0' # safe_load signature not compatible with older rubies
11
+ gem "rake"
12
+ gem "typhoeus" unless defined? JRUBY_VERSION
13
+ gem 'faraday-typhoeus' unless defined? JRUBY_VERSION
14
+ end
15
+
16
+ group :test do
17
+ gem "rspec", "~> 3.0", "< 3.10" # resrict rspec version until https://github.com/rspec/rspec-support/pull/537 gets merged
18
+ gem "vcr", github: 'vcr/vcr', ref: 'ce35c236fe48899f02ddf780973b44cdb756c0ee' # needs https://github.com/vcr/vcr/issues/1057 for ruby 3.5
19
+ gem "webmock"
20
+ gem "simplecov"
21
+ end
22
+
23
+ gem "jruby-openssl" if defined? JRUBY_VERSION
24
+
25
+ gemspec
data/ISSUE_TEMPLATE ADDED
@@ -0,0 +1,25 @@
1
+ Thanks for using Koala! Sorry you've run into an issue 😓 Here are some questions to help get things figured out as quickly as possible.
2
+
3
+ You don't have to fill this all out -- it's more of a guide. If in doubt, delete any sections that aren't relevant and open the issue. I want to help.
4
+
5
+ [ ] This is a Koala bug/issue/documentation problem.
6
+
7
+ Koala is a labor of love both from me and from the awesome community members who answer questions here. Much as we'd love to be able to help with everything, I have to focus my time on issues with the gem itself and can't help with questions on how to _use_ Facebook. (Plus, Facebook is huge!)
8
+
9
+ If you have questions about using the Facebook API, [facebook.stackoverflow.com](http://facebook.stackoverflow.com) is a great resource.
10
+
11
+ _For code issues:_
12
+
13
+ [ ] What I'm doing works on the [Graph API explorer](https://developers.facebook.com/tools/explorer/)/curl/another tool.
14
+
15
+ Seeing an example of what works helps diagnose what doesn't work.
16
+
17
+ [ ] I'm using the newest version
18
+ [ ] Here's code to replicate the issue:
19
+
20
+ Obviously not all code can be shared -- feel free to put variables in place of any sensitive information and describe what should be used to replicate it.
21
+
22
+ Thanks for submitting an issue! Looking forward to working with you to figure it out.
23
+
24
+
25
+ Note: Koala has a [code of conduct](https://github.com/arsduo/koala/blob/master/code_of_conduct.md). Check it out.
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2010-2011 Alex Koppel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Manifest CHANGED
@@ -1,12 +1,39 @@
1
1
  CHANGELOG
2
+ LICENSE
2
3
  Manifest
3
4
  Rakefile
4
5
  init.rb
5
6
  koala.gemspec
6
- lib/http_services.rb
7
7
  lib/koala.rb
8
+ lib/koala/graph_api.rb
9
+ lib/koala/http_services.rb
10
+ lib/koala/realtime_updates.rb
11
+ lib/koala/rest_api.rb
12
+ lib/koala/test_users.rb
13
+ lib/koala/uploadable_io.rb
8
14
  readme.md
9
- test/facebook_data.yml
10
- test/koala/facebook_no_access_token_tests.rb
11
- test/koala/facebook_with_access_token_tests.rb
12
- test/koala_tests.rb
15
+ spec/facebook_data.yml
16
+ spec/koala/api_base_tests.rb
17
+ spec/koala/assets/beach.jpg
18
+ spec/koala/graph_and_rest_api/graph_and_rest_api_no_token_tests.rb
19
+ spec/koala/graph_and_rest_api/graph_and_rest_api_with_token_tests.rb
20
+ spec/koala/graph_api/graph_api_no_access_token_tests.rb
21
+ spec/koala/graph_api/graph_api_tests.rb
22
+ spec/koala/graph_api/graph_api_with_access_token_tests.rb
23
+ spec/koala/graph_api/graph_collection_tests.rb
24
+ spec/koala/http_services/http_service_tests.rb
25
+ spec/koala/http_services/net_http_service_tests.rb
26
+ spec/koala/http_services/typhoeus_service_tests.rb
27
+ spec/koala/live_testing_data_helper.rb
28
+ spec/koala/oauth/oauth_tests.rb
29
+ spec/koala/realtime_updates/realtime_updates_tests.rb
30
+ spec/koala/rest_api/rest_api_no_access_token_tests.rb
31
+ spec/koala/rest_api/rest_api_tests.rb
32
+ spec/koala/rest_api/rest_api_with_access_token_tests.rb
33
+ spec/koala/test_users/test_users_tests.rb
34
+ spec/koala/uploadable_io/uploadable_io_tests.rb
35
+ spec/koala_spec.rb
36
+ spec/koala_spec_helper.rb
37
+ spec/koala_spec_without_mocks.rb
38
+ spec/mock_facebook_responses.yml
39
+ spec/mock_http_service.rb
@@ -0,0 +1,11 @@
1
+ Thanks for submitting a pull request to Koala! A huge portion of the gem has been built by awesome people (like you) from the Ruby community.
2
+
3
+ Here are a few things that will help get your pull request merged in quickly. None of this is required -- you can delete anything not relevant. If in doubt, open the PR! I want to help.
4
+
5
+ [ ] My PR has tests and they pass!
6
+ [ ] The live tests pass for my changes (`LIVE=true rspec` -- unrelated failures are okay).
7
+ [ ] The PR is based on the most recent master commit and has no merge conflicts.
8
+
9
+ If you have any questions, feel free to open an issue or comment on your PR!
10
+
11
+ Note: Koala has a [code of conduct](https://github.com/arsduo/koala/blob/master/code_of_conduct.md). Check it out.
data/Rakefile CHANGED
@@ -1,15 +1,15 @@
1
- # Rakefile
2
- require 'rubygems'
3
1
  require 'rake'
4
- require 'echoe'
5
2
 
6
- # gem management
7
- Echoe.new('koala', '0.4') do |p|
8
- p.summary = "A lightweight, flexible library for Facebook's new Graph API"
9
- p.description = "Koala is a lightweight, flexible Ruby SDK for Facebook's new Graph API. It allows read/write access to the Facebook Graph and provides OAuth URLs and cookie validation for Facebook Connect sites. Koala supports Net::HTTP and Typhoeus connections out of the box and can accept custom modules for other services."
10
- p.url = "http://github.com/arsduo/ruby-sdk"
11
- p.author = ["Alex Koppel", "Rafi Jacoby", "Context Optional"]
12
- p.email = "alex@alexkoppel.com"
13
- p.ignore_pattern = ["tmp/*", "script/*"]
14
- p.development_dependencies = []
3
+ begin
4
+ require 'bundler/setup'
5
+ Bundler::GemHelper.install_tasks
6
+ rescue LoadError
7
+ puts 'although not required, bundler is recommened for running the tests'
8
+ end
9
+
10
+ task :default => :spec
11
+
12
+ require 'rspec/core/rake_task'
13
+ RSpec::Core::RakeTask.new do |t|
14
+ t.rspec_opts = ["--color", '--format doc']
15
15
  end