From 06673afdf47da08958cd9728e3074336b581f7f4 Mon Sep 17 00:00:00 2001 From: Doug Miller Date: Mon, 22 Feb 2021 10:02:46 -0600 Subject: [PATCH] Fixing issues with ruby 3.0 --- .travis.yml | 1 + lib/recurly/client.rb | 4 ++-- lib/recurly/pager.rb | 2 +- spec/recurly/client_spec.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 953be7834..b5abc45a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ rvm: - 2.5 - 2.6 - 2.7 + - 3.0 bundler_args: --binstubs before_install: - gem update --system diff --git a/lib/recurly/client.rb b/lib/recurly/client.rb index 8929668fa..93badeaf7 100644 --- a/lib/recurly/client.rb +++ b/lib/recurly/client.rb @@ -299,7 +299,7 @@ def validate_path_parameters!(**options) end def interpolate_path(path, **options) - validate_path_parameters!(options) + validate_path_parameters!(**options) options.each do |k, v| # We need to encode the values for the url options[k] = ERB::Util.url_encode(v.to_s) @@ -330,7 +330,7 @@ def build_url(path, options) end end - def scope_by_site(path, **options) + def scope_by_site(path, options) if site = site_id || options[:site_id] # Ensure that we are only including the site_id once because the Pager operations # will use the cursor returned from the API which may already have these components diff --git a/lib/recurly/pager.rb b/lib/recurly/pager.rb index 86dc9841b..28f03c321 100644 --- a/lib/recurly/pager.rb +++ b/lib/recurly/pager.rb @@ -116,7 +116,7 @@ def page_enumerator def fetch_next!(options) path = extract_path(self.next) - page = @client.send(:get, path, options) + page = @client.send(:get, path, **options) @data = page.data.map { |d| JSONParser.from_json(d) } @has_more = page.has_more @next = page.next diff --git a/spec/recurly/client_spec.rb b/spec/recurly/client_spec.rb index 2fad9fe35..b94c0c996 100644 --- a/spec/recurly/client_spec.rb +++ b/spec/recurly/client_spec.rb @@ -1,7 +1,7 @@ require "spec_helper" RSpec.describe Recurly::Client do - subject(:client) { Recurly::Client.new(client_options) } + subject(:client) { Recurly::Client.new(**client_options) } let(:client_options) { { api_key: api_key } } let(:subdomain) { "test" } let(:api_key) { "recurly-good" }