koala 3.0.0.beta3 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2ed893e5254cc1e5b3007301dc847bd025b592c1
4
- data.tar.gz: 3ad942cb33ac7e7a36304250dd3cc7c6b36712f8
2
+ SHA256:
3
+ metadata.gz: 3209d60dbf8ab51fac40f7b990f221076bb453329641194dce55b800d0611856
4
+ data.tar.gz: 9dfb75f13c1b1e187c325453793b6dfcdc085a0f42e119d40df7a30d7b492250
5
5
  SHA512:
6
- metadata.gz: 6d4cac2752f9b72f7c1c1cf4632dfaf10b7ba9b72753699540587e3b636b35fde33ca2035b47e468d51d59c490ce9dcbc624618d5eb10e1da3b5fc4c2a11f034
7
- data.tar.gz: 4728dfc6777f3e1b29d2dcab6608c9a40f24e8ee8a2136940ed2b463846ddcffa9c0f0afd96a1ab8d21b2d2c0203bdde5ddfe0c4a8ee1d250650921361343c90
6
+ metadata.gz: 2aa7c4c61594d111e5654788712a56eea9005e4e3f6ce133536de6d2089f6014a6a0f5a059012b3bccf2204862b6c28212b517a4a264ea4b2cc272530d11cb4f
7
+ data.tar.gz: 318d505d832d0d2e70cd9df39040254c1eea64bdf3c743cf29c6311e8fe2cd68159f3237a27a6a066136b5d3306029771fae2935fc4c768860a2c12525f29137
@@ -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.5, 2.6, 2.7, "3.0", 3.1, head]
14
+
15
+ steps:
16
+ - name: Checkout repository
17
+ uses: actions/checkout@v2
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@v3.0.0
29
+ env:
30
+ CC_TEST_REPORTER_ID: 7af99d9225b4c14640f9ec3cb2e24d2f7103ac49417b0bd989188fb6c25f2909
31
+ with:
32
+ coverageCommand: bundle exec rspec
data/Gemfile CHANGED
@@ -7,15 +7,16 @@ group :development do
7
7
  end
8
8
 
9
9
  group :development, :test do
10
+ gem "psych", '< 4.0.0' # safe_load signature not compatible with older rubies
10
11
  gem "rake"
11
12
  gem "typhoeus" unless defined? JRUBY_VERSION
12
13
  end
13
14
 
14
15
  group :test do
15
16
  gem "rspec", '~> 3.4'
16
- gem "vcr"
17
+ gem "vcr", github: 'vcr/vcr', ref: '8ced6c96e01737a418cd270e0382a8c2c6d85f7f' # needs https://github.com/vcr/vcr/pull/907 for ruby 3.1
17
18
  gem "webmock"
18
- gem "codeclimate-test-reporter", "~> 1.0.0", require: nil
19
+ gem "simplecov"
19
20
  end
20
21
 
21
22
  gem "jruby-openssl" if defined? JRUBY_VERSION
data/ISSUE_TEMPLATE CHANGED
@@ -8,16 +8,18 @@ Koala is a labor of love both from me and from the awesome community members who
8
8
 
9
9
  If you have questions about using the Facebook API, [facebook.stackoverflow.com](http://facebook.stackoverflow.com) is a great resource.
10
10
 
11
- For code issues:
11
+ _For code issues:_
12
12
 
13
13
  [ ] What I'm doing works on the [Graph API explorer](https://developers.facebook.com/tools/explorer/)/curl/another tool.
14
14
 
15
15
  Seeing an example of what works helps diagnose what doesn't work.
16
16
 
17
17
  [ ] I'm using the newest version
18
-
19
18
  [ ] Here's code to replicate the issue:
20
19
 
21
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.
22
21
 
23
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.
@@ -6,4 +6,6 @@ Here are a few things that will help get your pull request merged in quickly. No
6
6
  [ ] The live tests pass for my changes (`LIVE=true rspec` -- unrelated failures are okay).
7
7
  [ ] The PR is based on the most recent master commit and has no merge conflicts.
8
8
 
9
- If you have any questions, feel free to open an issue or comment on your PR!
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/changelog.md CHANGED
@@ -1,4 +1,42 @@
1
- v3.0.0 (not released yet)
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.1.0 (2022-18-01)
19
+ ======
20
+
21
+ New features:
22
+
23
+ * mask_tokens config (default: true) to mask tokens in logs
24
+
25
+ Updated features:
26
+
27
+ * Log before and after sending request
28
+
29
+ Internal improvements:
30
+
31
+ * Lock Faraday to < 2
32
+ * Compatibility with ruby 3.x
33
+
34
+ Testing improvements:
35
+
36
+ * Use Github actions for CI
37
+ * Run CI on latest rubies
38
+
39
+ v3.0.0 (2017-03-17)
2
40
  ======
3
41
 
4
42
  Most users should not see any difference upgrading from 2.x to 3.0. Most of the changes are
@@ -29,6 +67,7 @@ Updated features:
29
67
  * Koala.config now uses a dedicated Koala::Configuration object
30
68
  * TestUser#befriend will provide the appsecret_proof if a secret is set (thanks, kwasimensah!)
31
69
  * API#search now requires an object type parameter to be included, matching Facebook's API (#575)
70
+ * RealtimeUpdates will now only fetch the app access token if necessary, avoiding unnecessary calls
32
71
 
33
72
  Removed features:
34
73
 
@@ -47,6 +86,8 @@ Internal improvements:
47
86
  * Use the more secure JSON.parse instead of JSON.load (thanks, lautis!) (#567)
48
87
  * Use JSON's quirks_mode option to remove hacky JSON hack (#573 -- thanks sakuro for the
49
88
  suggestion!)
89
+ * The gemspec now allows both JSON 1.8 and 2.0 (#596) (thanks, pawandubey!)
90
+ * Remove Autotest and Guard references (no longer used/needed)
50
91
 
51
92
  Testing improvements:
52
93
 
@@ -55,6 +96,7 @@ Testing improvements:
55
96
  Others:
56
97
 
57
98
  * Added an issue and pull request template
99
+ * Updated Code of Conduct to 1.4
58
100
 
59
101
  v2.5.0 (2017-02-17)
60
102
  ======
data/code_of_conduct.md CHANGED
@@ -1,22 +1,74 @@
1
- # Contributor Code of Conduct
1
+ # Contributor Covenant Code of Conduct
2
2
 
3
- As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
3
+ ## Our Pledge
4
4
 
5
- We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
6
22
 
7
23
  Examples of unacceptable behavior by participants include:
8
24
 
9
- * The use of sexualized language or imagery
10
- * Personal attacks
11
- * Trolling or insulting/derogatory comments
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
12
28
  * Public or private harassment
13
- * Publishing other's private information, such as physical or electronic addresses, without explicit permission
14
- * Other unethical or unprofessional conduct.
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
15
63
 
16
- Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
17
67
 
18
- This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
68
+ ## Attribution
19
69
 
20
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
21
72
 
22
- This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/koala.gemspec CHANGED
@@ -23,7 +23,8 @@ Gem::Specification.new do |gem|
23
23
 
24
24
  gem.required_ruby_version = '>= 2.1'
25
25
 
26
- gem.add_runtime_dependency("faraday")
26
+ gem.add_runtime_dependency("faraday", "< 2")
27
27
  gem.add_runtime_dependency("addressable")
28
- gem.add_runtime_dependency("json", ">= 2.0")
28
+ gem.add_runtime_dependency("json", ">= 1.8")
29
+ gem.add_runtime_dependency("rexml")
29
30
  end
@@ -8,6 +8,9 @@ module Koala
8
8
  # inside a batch call we can do anything a regular Graph API can do
9
9
  include GraphAPIMethods
10
10
 
11
+ # Limits from @see https://developers.facebook.com/docs/marketing-api/batch-requests/v2.8
12
+ MAX_CALLS = 50
13
+
11
14
  attr_reader :original_api
12
15
  def initialize(api)
13
16
  @original_api = api
@@ -35,26 +38,34 @@ module Koala
35
38
  nil # batch operations return nothing immediately
36
39
  end
37
40
 
38
- # execute the queued batch calls
41
+ # execute the queued batch calls. limits it to 50 requests per call.
42
+ # NOTE: if you use `name` and JsonPath references, you should ensure to call `execute` for each
43
+ # co-reference group and that the group size is not greater than the above limits.
39
44
  def execute(http_options = {})
40
45
  return [] if batch_calls.empty?
41
46
 
42
- # Turn the call args collected into what facebook expects
43
- args = {"batch" => batch_args}
44
- batch_calls.each do |call|
45
- args.merge! call.files || {}
46
- end
47
+ batch_results = []
48
+ batch_calls.each_slice(MAX_CALLS) do |batch|
49
+ # Turn the call args collected into what facebook expects
50
+ args = {"batch" => batch_args(batch)}
51
+ batch.each do |call|
52
+ args.merge!(call.files || {})
53
+ end
47
54
 
48
- original_api.graph_call("/", args, "post", http_options) do |response|
49
- raise bad_response if response.nil?
50
- generate_results(response)
55
+ original_api.graph_call("/", args, "post", http_options) do |response|
56
+ raise bad_response if response.nil?
57
+
58
+ batch_results += generate_results(response, batch)
59
+ end
51
60
  end
61
+
62
+ batch_results
52
63
  end
53
64
 
54
- def generate_results(response)
65
+ def generate_results(response, batch)
55
66
  index = 0
56
67
  response.map do |call_result|
57
- batch_op = batch_calls[index]
68
+ batch_op = batch[index]
58
69
  index += 1
59
70
  post_process = batch_op.post_processing
60
71
 
@@ -104,8 +115,8 @@ module Koala
104
115
  GraphErrorChecker.new(code, body, headers).error_if_appropriate
105
116
  end
106
117
 
107
- def batch_args
108
- calls = batch_calls.map do |batch_op|
118
+ def batch_args(calls_for_batch)
119
+ calls = calls_for_batch.map do |batch_op|
109
120
  batch_op.to_batch_params(access_token, app_secret)
110
121
  end
111
122
 
data/lib/koala/api.rb CHANGED
@@ -102,7 +102,7 @@ module Koala
102
102
  args = sanitize_request_parameters(args) unless preserve_form_arguments?(options)
103
103
 
104
104
  # add a leading / if needed...
105
- path = "/#{path}" unless path =~ /^\//
105
+ path = "/#{path}" unless path.to_s =~ /^\//
106
106
 
107
107
  # make the request via the provided service
108
108
  result = Koala.make_request(path, args, verb, options)
@@ -28,6 +28,9 @@ class Koala::Configuration
28
28
  # The server to use when constructing dialog URLs.
29
29
  attr_accessor :dialog_host
30
30
 
31
+ # Whether or not to mask tokens
32
+ attr_accessor :mask_tokens
33
+
31
34
  # Certain Facebook services (beta, video) require you to access different
32
35
  # servers. If you're using your own servers, for instance, for a proxy,
33
36
  # you can change both the matcher (what value to change when updating the URL) and the
@@ -45,5 +48,6 @@ class Koala::Configuration
45
48
  Koala::HTTPService::DEFAULT_SERVERS.each_pair do |key, value|
46
49
  self.public_send("#{key}=", value)
47
50
  end
51
+ self.mask_tokens = true
48
52
  end
49
53
  end
@@ -49,6 +49,18 @@ module Koala
49
49
  # set up our Faraday connection
50
50
  conn = Faraday.new(request.server, faraday_options(request.options), &(faraday_middleware || DEFAULT_MIDDLEWARE))
51
51
 
52
+ filtered_args = request.raw_args.dup.transform_keys(&:to_s)
53
+
54
+ if Koala.config.mask_tokens
55
+ %w(access_token input_token).each do |arg_token|
56
+ if (token = filtered_args[arg_token])
57
+ filtered_args[arg_token] = token[0, 10] + '*****' + token[-5, 5]
58
+ end
59
+ end
60
+ end
61
+
62
+ Koala::Utils.debug "STARTED => #{request.verb.upcase}: #{request.path} params: #{filtered_args.inspect}"
63
+
52
64
  if request.verb == "post" && request.json?
53
65
  # JSON requires a bit more handling
54
66
  # remember, all non-GET requests are turned into POSTs, so this covers everything but GETs
@@ -62,8 +74,7 @@ module Koala
62
74
  response = conn.send(request.verb, request.path, request.post_args)
63
75
  end
64
76
 
65
- # Log URL information
66
- Koala::Utils.debug "#{request.verb.upcase}: #{request.path} params: #{request.raw_args.inspect}"
77
+ Koala::Utils.debug "FINISHED => #{request.verb.upcase}: #{request.path} params: #{filtered_args.inspect}"
67
78
  Koala::HTTPService::Response.new(response.status.to_i, response.body, response.headers)
68
79
  end
69
80
 
@@ -7,9 +7,6 @@ module Koala
7
7
  # @note: to subscribe to real-time updates, you must have an application access token
8
8
  # or provide the app secret when initializing your RealtimeUpdates object.
9
9
 
10
- # The application API interface used to communicate with Facebook.
11
- # @return [Koala::Facebook::API]
12
- attr_reader :api
13
10
  attr_reader :app_id, :app_access_token, :secret
14
11
 
15
12
  # Create a new RealtimeUpdates instance.
@@ -29,14 +26,21 @@ module Koala
29
26
  unless @app_id && (@app_access_token || @secret) # make sure we have what we need
30
27
  raise ArgumentError, "Initialize must receive a hash with :app_id and either :app_access_token or :secret! (received #{options.inspect})"
31
28
  end
29
+ end
32
30
 
33
- # fetch the access token if we're provided a secret
34
- if @secret && !@app_access_token
35
- oauth = Koala::Facebook::OAuth.new(@app_id, @secret)
36
- @app_access_token = oauth.get_app_access_token
37
- end
31
+ # The app access token, either provided on initialization or fetched from Facebook using the
32
+ # app_id and secret.
33
+ def app_access_token
34
+ # If a token isn't provided but we need it, fetch it
35
+ @app_access_token ||= Koala::Facebook::OAuth.new(@app_id, @secret).get_app_access_token
36
+ end
38
37
 
39
- @api = API.new(@app_access_token)
38
+ # The application API interface used to communicate with Facebook.
39
+ # @return [Koala::Facebook::API]
40
+ def api
41
+ # Only instantiate the API if needed. validate_update doesn't require it, so we shouldn't
42
+ # make an unnecessary request to get the app_access_token.
43
+ @api ||= API.new(app_access_token)
40
44
  end
41
45
 
42
46
  # Subscribe to realtime updates for certain fields on a given object (user, page, etc.).
@@ -60,7 +64,7 @@ module Koala
60
64
  :callback_url => callback_url,
61
65
  }.merge(verify_token ? {:verify_token => verify_token} : {})
62
66
  # a subscription is a success if Facebook returns a 200 (after hitting your server for verification)
63
- @api.graph_call(subscription_path, args, 'post', options)
67
+ api.graph_call(subscription_path, args, 'post', options)
64
68
  end
65
69
 
66
70
  # Unsubscribe from updates for a particular object or from updates.
@@ -71,7 +75,7 @@ module Koala
71
75
  #
72
76
  # @raise A subclass of Koala::Facebook::APIError if the subscription request failed.
73
77
  def unsubscribe(object = nil, options = {})
74
- @api.graph_call(subscription_path, object ? {:object => object} : {}, "delete", options)
78
+ api.graph_call(subscription_path, object ? {:object => object} : {}, "delete", options)
75
79
  end
76
80
 
77
81
  # List all active subscriptions for this application.
@@ -80,7 +84,7 @@ module Koala
80
84
  #
81
85
  # @return [Array] a list of active subscriptions
82
86
  def list_subscriptions(options = {})
83
- @api.graph_call(subscription_path, {}, "get", options)
87
+ api.graph_call(subscription_path, {}, "get", options)
84
88
  end
85
89
 
86
90
  # As a security measure (to prevent DDoS attacks), Facebook sends a verification request to your server
@@ -129,12 +133,13 @@ module Koala
129
133
  raise AppSecretNotDefinedError, "You must init RealtimeUpdates with your app secret in order to validate updates"
130
134
  end
131
135
 
132
- if request_signature = headers['X-Hub-Signature'] || headers['HTTP_X_HUB_SIGNATURE'] and
133
- signature_parts = request_signature.split("sha1=")
134
- request_signature = signature_parts[1]
135
- calculated_signature = OpenSSL::HMAC.hexdigest('sha1', @secret, body)
136
- calculated_signature == request_signature
137
- end
136
+ request_signature = headers['X-Hub-Signature'] || headers['HTTP_X_HUB_SIGNATURE']
137
+ return unless request_signature
138
+
139
+ signature_parts = request_signature.split("sha1=")
140
+ request_signature = signature_parts[1]
141
+ calculated_signature = OpenSSL::HMAC.hexdigest('sha1', @secret, body)
142
+ calculated_signature == request_signature
138
143
  end
139
144
 
140
145
  # The Facebook subscription management URL for your application.
data/lib/koala/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Koala
2
- VERSION = "3.0.0.beta3"
2
+ VERSION = "3.1.0"
3
3
  end
data/readme.md CHANGED
@@ -1,6 +1,6 @@
1
- Koala [![Version](https://img.shields.io/gem/v/koala.svg)](https://rubygems.org/gems/koala) [![Dependencies](https://img.shields.io/gemnasium/arsduo/koala.svg)](https://gemnasium.com/arsduo/koala) [![Build Status](https://img.shields.io/travis/arsduo/koala.svg)](http://travis-ci.org/arsduo/koala) [![Code Climate](https://img.shields.io/codeclimate/github/arsduo/koala.svg)](https://codeclimate.com/github/arsduo/koala) [![Code Coverage](https://img.shields.io/codeclimate/coverage/github/arsduo/koala.svg)](https://codeclimate.com/github/arsduo/koala)
1
+ Koala [![Version](https://img.shields.io/gem/v/koala.svg)](https://rubygems.org/gems/koala) [![Build Status](https://img.shields.io/travis/arsduo/koala.svg)](http://travis-ci.org/arsduo/koala) [![Code Climate](https://img.shields.io/codeclimate/coverage-letter/arsduo/koala.svg)](https://codeclimate.com/github/arsduo/koala) [![Code Coverage](https://img.shields.io/codeclimate/coverage/arsduo/koala.svg)](https://codeclimate.com/github/arsduo/koala)
2
2
  ====
3
- [Koala](http://github.com/arsduo/koala) is a Facebook library for Ruby, supporting the Graph API (including the batch requests and photo uploads), realtime updates, test users, and OAuth validation. We wrote Koala with four goals:
3
+ [Koala](http://github.com/arsduo/koala) is a Facebook library for Ruby, supporting the Graph API (including the batch requests and photo uploads), the Marketing API, the Atlas API, realtime updates, test users, and OAuth validation. We wrote Koala with four goals:
4
4
 
5
5
  * Lightweight: Koala should be as light and simple as Facebook’s own libraries, providing API accessors and returning simple JSON.
6
6
  * Fast: Koala should, out of the box, be quick. Out of the box, we use Facebook's faster read-only servers when possible and if available, the Typhoeus gem to make snappy Facebook requests. Of course, that brings us to our next topic:
@@ -12,27 +12,23 @@ Koala [![Version](https://img.shields.io/gem/v/koala.svg)](https://rubygems.org/
12
12
  Installation
13
13
  ------------
14
14
 
15
- **Koala 3.0 is in beta! There should be no significant changes** for most users -- please check it
16
- out!
15
+ **Koala 3.0 is out! There should be no significant changes** for most users. If you encounter any
16
+ problems, please file an issue and I'll take a look.
17
17
 
18
18
  In Bundler:
19
19
  ```ruby
20
- gem "koala", "~> 3.0.0.beta2"
21
- # if you need the previous release
22
- gem "koala", "~> 2.4"
20
+ gem "koala"
23
21
  ```
24
22
 
25
23
  Otherwise:
26
24
  ```bash
27
- [sudo|rvm] gem install koala --pre
28
- # if you need the previous release
29
25
  [sudo|rvm] gem install koala
30
26
  ```
31
27
 
32
28
  Configuration
33
29
  -------------
34
30
 
35
- Most applications will only use one application configuration. Rather than having toprovide that
31
+ Most applications will only use one application configuration. Rather than having to provide that
36
32
  value every time, you can configure Koala to use global settings:
37
33
 
38
34
  ```ruby
@@ -1,4 +1,5 @@
1
1
  require 'spec_helper'
2
+ require 'json' unless Hash.respond_to?(:to_json)
2
3
 
3
4
  describe "Koala::Facebook::GraphAPI in batch mode" do
4
5
 
@@ -468,6 +469,46 @@ describe "Koala::Facebook::GraphAPI in batch mode" do
468
469
  expect(thread_one_count).to eq(first_count)
469
470
  expect(thread_two_count).to eq(second_count)
470
471
  end
472
+
473
+ end
474
+ end
475
+
476
+ describe '#big_batches' do
477
+ before :each do
478
+ payload = [{code: 200, headers: [{name: "Content-Type", value: "text/javascript; charset=UTF-8"}], body: "{\"id\":\"1234\"}"}]
479
+ allow(Koala).to receive(:make_request) do |_request, args, _verb, _options|
480
+ request_count = JSON.parse(args['batch']).length
481
+ expect(request_count).to be <= 50 # check FB's limit
482
+ Koala::HTTPService::Response.new(200, (payload * request_count).to_json, {})
483
+ end
484
+ end
485
+
486
+ it 'stays within fb limits' do
487
+ count_calls = 0
488
+ expected_calls = 100
489
+ @api.batch do |batch_api|
490
+ expected_calls.times { |_i| batch_api.get_object('me') { |_ret| count_calls += 1 } }
491
+ end
492
+
493
+ expect(count_calls).to eq(expected_calls)
494
+ end
495
+
496
+ it 'is recursive safe' do
497
+ # ensure batch operations whose callbacks call batch operations don't resubmit
498
+ call_count = 0
499
+ iterations = 60
500
+ @api.batch do |batch_api|
501
+ # must do enough calls to provoke a batch submission
502
+ iterations.times { |_i|
503
+ batch_api.get_object('me') { |_ret|
504
+ call_count += 1
505
+ batch_api.get_object('me') { |_ret|
506
+ call_count += 1
507
+ }
508
+ }
509
+ }
510
+ end
511
+ expect(call_count).to eq(2 * iterations)
471
512
  end
472
513
  end
473
514
 
@@ -122,7 +122,8 @@ describe Koala::HTTPService do
122
122
 
123
123
  let(:verb) { "get" }
124
124
  let(:options) { {} }
125
- let(:request) { Koala::HTTPService::Request.new(path: "/foo", verb: verb, args: {"an" => :arg}, options: options) }
125
+ let(:args) { {"an" => :arg } }
126
+ let(:request) { Koala::HTTPService::Request.new(path: "/foo", verb: verb, args: args, options: options) }
126
127
 
127
128
  shared_examples_for :making_a_request do
128
129
  before :each do
@@ -153,7 +154,8 @@ describe Koala::HTTPService do
153
154
 
154
155
  it "logs verb, url and params to debug" do
155
156
  log_message = "#{verb.upcase}: #{request.path} params: #{request.raw_args.inspect}"
156
- expect(Koala::Utils.logger).to receive(:debug).with(log_message)
157
+ expect(Koala::Utils.logger).to receive(:debug).with("STARTED => #{log_message}")
158
+ expect(Koala::Utils.logger).to receive(:debug).with("FINISHED => #{log_message}")
157
159
 
158
160
  Koala::HTTPService.make_request(request)
159
161
  end
@@ -230,5 +232,42 @@ describe Koala::HTTPService do
230
232
 
231
233
  Koala::HTTPService.make_request(request)
232
234
  end
235
+
236
+ context 'log_tokens configuration' do
237
+ let(:args) { { "an" => :arg, "access_token" => "myvisbleaccesstoken" } }
238
+
239
+ before(:each) do
240
+ allow_any_instance_of(Faraday::Connection).to receive(:get) { double(status: '200', body: 'ok', headers: {}) }
241
+ end
242
+
243
+ it 'logs tokens' do
244
+ allow(Koala.config).to receive(:mask_tokens) { false }
245
+
246
+ expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleaccesstoken"}')
247
+ expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleaccesstoken"}')
248
+
249
+ Koala::HTTPService.make_request(request)
250
+ end
251
+
252
+ it 'doesnt log tokens' do
253
+ allow(Koala.config).to receive(:mask_tokens) { true }
254
+
255
+ expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleac*****token"}')
256
+ expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleac*****token"}')
257
+
258
+ Koala::HTTPService.make_request(request)
259
+ end
260
+
261
+ it 'hides the token for the debug_token api endpoint' do
262
+ request = Koala::HTTPService::Request.new(path: "/debug_token", verb: verb, args: { input_token: 'myvisibleaccesstoken', 'access_token' => 'myvisibleaccesstoken' }, options: options)
263
+
264
+ allow(Koala.config).to receive(:mask_tokens) { true }
265
+
266
+ expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /debug_token params: {"input_token"=>"myvisiblea*****token", "access_token"=>"myvisiblea*****token"}')
267
+ expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /debug_token params: {"input_token"=>"myvisiblea*****token", "access_token"=>"myvisiblea*****token"}')
268
+
269
+ Koala::HTTPService.make_request(request)
270
+ end
271
+ end
233
272
  end
234
273
  end
@@ -106,25 +106,24 @@ describe "Koala::Facebook::RealtimeUpdates" do
106
106
  expect(updates).to be_a(Koala::Facebook::RealtimeUpdates)
107
107
  end
108
108
 
109
- it "fetches an app_token from Facebook when provided an app_id and a secret" do
110
- updates = Koala::Facebook::RealtimeUpdates.new(:app_id => @app_id, :secret => @secret)
111
- expect(updates.app_access_token).not_to be_nil
109
+ it "sets up the API with the app access token" do
110
+ updates = Koala::Facebook::RealtimeUpdates.new(:app_id => @app_id, :app_access_token => @app_access_token)
111
+ expect(updates.api).to be_a(Koala::Facebook::API)
112
+ expect(updates.api.access_token).to eq(@app_access_token)
112
113
  end
114
+ end
113
115
 
114
- it "uses the OAuth class to fetch a token when provided an app_id and a secret" do
115
- oauth = Koala::Facebook::OAuth.new(@app_id, @secret)
116
- token = oauth.get_app_access_token
117
- expect(oauth).to receive(:get_app_access_token).and_return(token)
118
- expect(Koala::Facebook::OAuth).to receive(:new).with(@app_id, @secret).and_return(oauth)
116
+ describe "#app_access_token" do
117
+ it "fetches an app_token from Facebook when provided an app_id and a secret" do
118
+ # integration test
119
119
  updates = Koala::Facebook::RealtimeUpdates.new(:app_id => @app_id, :secret => @secret)
120
+ expect(updates.app_access_token).not_to be_nil
120
121
  end
121
122
 
122
- it "sets up the with the app acces token" do
123
- updates = Koala::Facebook::RealtimeUpdates.new(:app_id => @app_id, :app_access_token => @app_access_token)
124
- expect(updates.api).to be_a(Koala::Facebook::API)
125
- expect(updates.api.access_token).to eq(@app_access_token)
123
+ it "returns the provided token if provided" do
124
+ updates = Koala::Facebook::RealtimeUpdates.new(app_id: @app_id, app_access_token: @app_access_token)
125
+ expect(updates.app_access_token).to eq(@app_access_token)
126
126
  end
127
-
128
127
  end
129
128
 
130
129
  describe "#subscribe" do
@@ -5,9 +5,7 @@
5
5
  # by enter an OAuth token, code, and session_key (for real users) or changing the app_id and secret (for test users)
6
6
  # (note for real users: this will leave some photos and videos posted to your wall, since they can't be deleted through the API)
7
7
 
8
- # These values are configured to work with the OAuth Playground app by default
9
- # Of course, you can change this to work with your own app.
10
- # Check out http://oauth.twoalex.com/ to easily generate tokens, cookies, etc.
8
+ # These values are configured to work with a test app. If you want, you can change this to work with your own app.
11
9
 
12
10
  # Your OAuth token should have the read_stream, publish_stream, user_photos, user_videos, and read_insights permissions.
13
11
  oauth_token:
@@ -22,7 +20,7 @@ oauth_test_data:
22
20
  # These values will work out of the box
23
21
  app_id: 119908831367602
24
22
  secret: e45e55a333eec232d4206d2703de1307
25
- callback_url: http://oauth.twoalex.com/
23
+ callback_url: http://testdomain.koalatest.test/
26
24
  app_access_token: 119908831367602|o3wswWQ88LYjEC9-ukR_gjRIOMw.
27
25
  raw_token_string: "access_token=119908831367602|2.6GneoQbnEqtSiPppZzDU4Q__.3600.1273366800-2905623|3OLa3w0x1K4C1S5cOgbs07TytAk.&expires=6621"
28
26
  raw_offline_access_token_string: access_token=119908831367602|2.6GneoQbnEqtSiPppZzDU4Q__.3600.1273366800-2905623|3OLa3w0x1K4C1S5cOgbs07TytAk.
@@ -54,7 +52,7 @@ oauth_test_data:
54
52
  issued_at: 1301917299
55
53
 
56
54
  subscription_test_data:
57
- subscription_path: https://oauth.twoalex.com/subscriptions
55
+ subscription_path: https://testdomain.koalatest.test/subscriptions
58
56
  verify_token: "myverificationtoken|1f54545d5f722733e17faae15377928f"
59
57
  challenge_data:
60
58
  "hub.challenge": "1290024882"
@@ -62,4 +60,4 @@ subscription_test_data:
62
60
  "hub.mode": "subscribe"
63
61
 
64
62
  vcr_data:
65
- oauth_token: CAACEdEose0cBAKuiUM40KZBEsq2l0iggaMGZBPI74svGQRMmZCPXb7eZCYPhNUbVXnnYZCjXKFKIc7HgYllr4RDIKrANHm6kKncOx0Y3UpDqLliRGZAnSEUypyFworUnBMOQJBlAuB1wlwYJZB7LIZCobCcnT2q9QwrZBpK3qAZB3u7ZAJaZAdsMZBsyALkAXatoj75leWXhgXfT1QiJHZBGoRlz07Q85z1dZBReK4ZD
63
+ oauth_token: CAACEdEose0cBAKuiUM40KZBEsq2l0iggaMGZBPI74svGQRMmZCPXb7eZCYPhNUbVXnnYZCjXKFKIc7HgYllr4RDIKrANHm6kKncOx0Y3UpDqLliRGZAnSEUypyFworUnBMOQJBlAuB1wlwYJZB7LIZCobCcnT2q9QwrZBpK3qAZB3u7ZAJaZAdsMZBsyALkAXatoj75leWXhgXfT1QiJHZBGoRlz07Q85z1dZBReK4ZD
@@ -144,10 +144,10 @@ graph_api:
144
144
  message=Hello, world, from the test suite batch API!:
145
145
  post:
146
146
  with_token: '{"id": "FEED_ITEM_BATCH"}'
147
- link=http://oauth.twoalex.com/&message=Hello, world, from the test suite again!&name=OAuth Playground:
147
+ link=http://testdomain.koalatest.test/&message=Hello, world, from the test suite again!&name=OAuth Playground:
148
148
  post:
149
149
  with_token: '{"id": "FEED_ITEM_CONTEXT"}'
150
- link=http://oauth.twoalex.com/&message=body&name=It's a big question&picture=http://oauth.twoalex.com//images/logo.png&properties=<%= JSON.dump({"Link1"=>{"text"=>"Left", "href"=>"http://oauth.twoalex.com/"}, "other" => {"text"=>"Straight ahead", "href"=>"http://oauth.twoalex.com/?"}}) %>&type=link:
150
+ link=http://testdomain.koalatest.test/&message=body&name=It's a big question&picture=http://testdomain.koalatest.test//images/logo.png&properties=<%= JSON.dump({"Link1"=>{"text"=>"Left", "href"=>"http://testdomain.koalatest.test/"}, "other" => {"text"=>"Straight ahead", "href"=>"http://testdomain.koalatest.test/?"}}) %>&type=link:
151
151
  post:
152
152
  with_token: '{"id": "FEED_ITEM_DICTIONARY"}'
153
153
 
@@ -367,12 +367,12 @@ graph_api:
367
367
  with_token:
368
368
  code: 200
369
369
  get:
370
- with_token: '{"data":[{"callback_url":"https://oauth.twoalex.com/subscriptions", "fields":["name"], "object":"user", "active":true}]}'
370
+ with_token: '{"data":[{"callback_url":"https://testdomain.koalatest.test/subscriptions", "fields":["name"], "object":"user", "active":true}]}'
371
371
 
372
372
 
373
373
  callback_url=<%= SUBSCRIPTION_DATA["subscription_path"] %>:
374
374
  get:
375
- with_token: '{"data":[{"callback_url":"https://oauth.twoalex.com/subscriptions", "fields":["name"], "object":"user", "active":true}]}'
375
+ with_token: '{"data":[{"callback_url":"https://testdomain.koalatest.test/subscriptions", "fields":["name"], "object":"user", "active":true}]}'
376
376
 
377
377
  # -- Mock Item Responses --
378
378
 
@@ -394,13 +394,13 @@ graph_api:
394
394
  no_args:
395
395
  <<: *item_deleted
396
396
  get:
397
- with_token: '{"link":"http://oauth.twoalex.com/", "name": "OAuth Playground"}'
397
+ with_token: '{"link":"http://testdomain.koalatest.test/", "name": "OAuth Playground"}'
398
398
 
399
399
  /FEED_ITEM_DICTIONARY:
400
400
  no_args:
401
401
  <<: *item_deleted
402
402
  get:
403
- with_token: '{"link":"http://oauth.twoalex.com/", "name": "OAuth Playground", "properties": {}}'
403
+ with_token: '{"link":"http://testdomain.koalatest.test/", "name": "OAuth Playground", "properties": {}}'
404
404
 
405
405
  /FEED_ITEM_CATS:
406
406
  no_args:
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://graph.facebook.com/v2.8/119908831367602/accounts?access_token=**
5
+ uri: https://graph.facebook.com/v2.8/119908831367602/accounts?access_token=********************
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -175,7 +175,7 @@ shared_examples_for "Koala GraphAPI with an access token" do
175
175
  end
176
176
 
177
177
  it "can post a message with an attachment to a feed" do
178
- result = @api.put_wall_post("Hello, world, from the test suite again!", {:name => "OAuth Playground", :link => "http://oauth.twoalex.com/"})
178
+ result = @api.put_wall_post("Hello, world, from the test suite again!", {:name => "OAuth Playground", :link => "http://testdomain.koalatest.test/"})
179
179
  @temporary_object_id = result["id"]
180
180
  expect(@temporary_object_id).not_to be_nil
181
181
  end
@@ -311,7 +311,7 @@ shared_examples_for "Koala GraphAPI with an access token" do
311
311
  end
312
312
 
313
313
  it "can verify a message with an attachment posted to a feed" do
314
- attachment = {"name" => "OAuth Playground", "link" => "http://oauth.twoalex.com/"}
314
+ attachment = {"name" => "OAuth Playground", "link" => "http://testdomain.koalatest.test/"}
315
315
  result = @api.put_wall_post("Hello, world, from the test suite again!", attachment)
316
316
  @temporary_object_id = result["id"]
317
317
  get_result = @api.get_object(@temporary_object_id)
@@ -508,7 +508,7 @@ shared_examples_for "Koala GraphAPI without an access token" do
508
508
  # but are here for completeness
509
509
  it "can't post to a feed" do
510
510
  expect(lambda do
511
- attachment = {:name => "OAuth Playground", :link => "http://oauth.twoalex.com/"}
511
+ attachment = {:name => "OAuth Playground", :link => "http://testdomain.koalatest.test/"}
512
512
  @result = @api.put_wall_post("Hello, world", attachment, "facebook")
513
513
  end).to raise_error(Koala::Facebook::AuthenticationError)
514
514
  end
@@ -8,7 +8,7 @@ module Koala
8
8
  # Mocks all HTTP requests for with koala_spec_with_mocks.rb
9
9
  # Mocked values to be included in TEST_DATA used in specs
10
10
  ACCESS_TOKEN = '*'
11
- APP_ACCESS_TOKEN = "**"
11
+ APP_ACCESS_TOKEN = "********************"
12
12
  OAUTH_CODE = 'OAUTHCODE'
13
13
 
14
14
  # Loads testing data
@@ -30,7 +30,7 @@ module Koala
30
30
 
31
31
  # Loads the mock response data via ERB to substitue values for TEST_DATA (see oauth/access_token)
32
32
  mock_response_file_path = File.join(File.dirname(__FILE__), '..', 'fixtures', 'mock_facebook_responses.yml')
33
- RESPONSES = YAML.load(ERB.new(IO.read(mock_response_file_path)).result(binding))
33
+ RESPONSES = YAML.safe_load(ERB.new(IO.read(mock_response_file_path)).result(binding), [], [], true)
34
34
 
35
35
  def self.make_request(request)
36
36
  if response = match_response(request.raw_path, request.raw_args, request.raw_verb, request.raw_options)
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: koala
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Koppel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2022-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: addressable
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,14 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '2.0'
47
+ version: '1.8'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '2.0'
54
+ version: '1.8'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rexml
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Koala is a lightweight, flexible Ruby SDK for Facebook. It allows read/write
56
70
  access to the social graph via the Graph and REST APIs, as well as support for realtime
57
71
  updates and OAuth and Facebook Connect authentication. Koala is fully tested and
@@ -64,19 +78,16 @@ extra_rdoc_files:
64
78
  - readme.md
65
79
  - changelog.md
66
80
  files:
67
- - ".autotest"
81
+ - ".github/workflows/test.yml"
68
82
  - ".gitignore"
69
83
  - ".rspec"
70
- - ".travis.yml"
71
84
  - ".yardopts"
72
85
  - Gemfile
73
- - Guardfile
74
86
  - ISSUE_TEMPLATE
75
87
  - LICENSE
76
88
  - Manifest
77
89
  - PULL_REQUEST_TEMPLATE
78
90
  - Rakefile
79
- - autotest/discover.rb
80
91
  - changelog.md
81
92
  - code_of_conduct.md
82
93
  - koala.gemspec
@@ -135,7 +146,7 @@ homepage: http://github.com/arsduo/koala
135
146
  licenses:
136
147
  - MIT
137
148
  metadata: {}
138
- post_install_message:
149
+ post_install_message:
139
150
  rdoc_options:
140
151
  - "--line-numbers"
141
152
  - "--inline-source"
@@ -150,46 +161,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
161
  version: '2.1'
151
162
  required_rubygems_version: !ruby/object:Gem::Requirement
152
163
  requirements:
153
- - - ">"
164
+ - - ">="
154
165
  - !ruby/object:Gem::Version
155
- version: 1.3.1
166
+ version: '0'
156
167
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.6.10
159
- signing_key:
168
+ rubygems_version: 3.0.0
169
+ signing_key:
160
170
  specification_version: 4
161
171
  summary: A lightweight, flexible library for Facebook with support for the Graph API,
162
172
  the REST API, realtime updates, and OAuth authentication.
163
- test_files:
164
- - spec/cases/api_spec.rb
165
- - spec/cases/configuration_spec.rb
166
- - spec/cases/error_spec.rb
167
- - spec/cases/graph_api_batch_spec.rb
168
- - spec/cases/graph_api_spec.rb
169
- - spec/cases/graph_collection_spec.rb
170
- - spec/cases/graph_error_checker_spec.rb
171
- - spec/cases/http_service/request_spec.rb
172
- - spec/cases/http_service/response_spec.rb
173
- - spec/cases/http_service_spec.rb
174
- - spec/cases/koala_spec.rb
175
- - spec/cases/koala_test_spec.rb
176
- - spec/cases/multipart_request_spec.rb
177
- - spec/cases/oauth_spec.rb
178
- - spec/cases/realtime_updates_spec.rb
179
- - spec/cases/test_users_spec.rb
180
- - spec/cases/uploadable_io_spec.rb
181
- - spec/cases/utils_spec.rb
182
- - spec/fixtures/beach.jpg
183
- - spec/fixtures/cat.m4v
184
- - spec/fixtures/facebook_data.yml
185
- - spec/fixtures/mock_facebook_responses.yml
186
- - spec/fixtures/vcr_cassettes/app_test_accounts.yml
187
- - spec/fixtures/vcr_cassettes/friend_list_next_page.yml
188
- - spec/integration/graph_collection_spec.rb
189
- - spec/spec_helper.rb
190
- - spec/support/custom_matchers.rb
191
- - spec/support/graph_api_shared_examples.rb
192
- - spec/support/koala_test.rb
193
- - spec/support/mock_http_service.rb
194
- - spec/support/uploadable_io_shared_examples.rb
195
- has_rdoc:
173
+ test_files: []
data/.autotest DELETED
@@ -1,12 +0,0 @@
1
- # Override autotest default magic to rerun all tests every time a
2
- # change is detected on the file system.
3
- class Autotest
4
-
5
- def get_to_green
6
- begin
7
- rerun_all_tests
8
- wait_for_changes unless all_good
9
- end until all_good
10
- end
11
-
12
- end
data/.travis.yml DELETED
@@ -1,19 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- rvm:
5
- # MRI
6
- - 2.1
7
- - 2.2
8
- - 2.3.1
9
- - 2.4.0
10
- # Rubinius is failing due to segfaults on Travis (and takes significantly longer to run)
11
- # those builds will be restored later
12
- # jruby
13
- # - jruby-19mode
14
- bundler_args: --without development
15
- addons:
16
- code_climate:
17
- repo_token: 7af99d9225b4c14640f9ec3cb2e24d2f7103ac49417b0bd989188fb6c25f2909
18
- after_success:
19
- - bundle exec codeclimate-test-reporter
data/Guardfile DELETED
@@ -1,6 +0,0 @@
1
- guard 'rspec', :version => 2 do
2
- watch(%r{^spec/.+_spec\.rb$})
3
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
- watch('spec/spec_helper.rb') { "spec" }
5
- end
6
-
data/autotest/discover.rb DELETED
@@ -1 +0,0 @@
1
- Autotest.add_discovery { "rspec2" }