Skip to content

Commit

Permalink
Better: compatibility with ruby 3.x (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
ylecuyer authored Jan 17, 2022
1 parent 021a6aa commit e9544b8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ group :development do
end

group :development, :test do
gem "psych", '< 4.0.0' # safe_load signature not compatible with older rubies
gem "rake"
gem "typhoeus" unless defined? JRUBY_VERSION
end

group :test do
gem "rspec", '~> 3.4'
gem "vcr"
gem "vcr", github: 'vcr/vcr', ref: '8ced6c96e01737a418cd270e0382a8c2c6d85f7f' # needs https://github.com/vcr/vcr/pull/907 for ruby 3.1
gem "webmock"
gem "simplecov"
end
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Removed features:
Internal improvements:

* Lock Faraday to < 2
* Compatibility with ruby 3.x

Testing improvements:

Expand Down
1 change: 1 addition & 0 deletions koala.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ Gem::Specification.new do |gem|
gem.add_runtime_dependency("faraday", "< 2")
gem.add_runtime_dependency("addressable")
gem.add_runtime_dependency("json", ">= 1.8")
gem.add_runtime_dependency("rexml")
end
2 changes: 1 addition & 1 deletion lib/koala/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def api(path, args = {}, verb = "get", options = {})
args = sanitize_request_parameters(args) unless preserve_form_arguments?(options)

# add a leading / if needed...
path = "/#{path}" unless path =~ /^\//
path = "/#{path}" unless path.to_s =~ /^\//

# make the request via the provided service
result = Koala.make_request(path, args, verb, options)
Expand Down
2 changes: 1 addition & 1 deletion spec/support/mock_http_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module MockHTTPService

# Loads the mock response data via ERB to substitue values for TEST_DATA (see oauth/access_token)
mock_response_file_path = File.join(File.dirname(__FILE__), '..', 'fixtures', 'mock_facebook_responses.yml')
RESPONSES = YAML.load(ERB.new(IO.read(mock_response_file_path)).result(binding))
RESPONSES = YAML.safe_load(ERB.new(IO.read(mock_response_file_path)).result(binding), [], [], true)

def self.make_request(request)
if response = match_response(request.raw_path, request.raw_args, request.raw_verb, request.raw_options)
Expand Down

0 comments on commit e9544b8

Please sign in to comment.