Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup ruby warnings #96

Merged
merged 1 commit into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/pact/consumer_contract/interaction_v2_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def self.parse_request request_hash, options
if query_is_string
request_hash['query'] = Pact::QueryHash.new(request_hash['query'], original_query_string, Pact::Query.parsed_as_nested?(request_hash['query']))
end
request = Pact::Request::Expected.from_hash(request_hash)
Pact::Request::Expected.from_hash(request_hash)
end

def self.parse_response response_hash, options
Expand Down
8 changes: 4 additions & 4 deletions lib/pact/consumer_contract/pact_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def read uri, options = {}
def save_pactfile_to_tmp pact, name
::FileUtils.mkdir_p Pact.configuration.tmp_dir
::File.open(Pact.configuration.tmp_dir + "/#{name}", "w") { |file| file << pact}
rescue Errno::EROFS => e
rescue Errno::EROFS
# do nothing, probably on RunKit
end

Expand All @@ -56,9 +56,9 @@ def get_local(filepath, _)
def get_remote_with_retry(uri_string, options)
uri = URI(uri_string)
if uri.userinfo
options[:username] = uri.user unless options[:username]
options[:password] = uri.password unless options[:password]
end
options[:username] = uri.user unless options[:username]
options[:password] = uri.password unless options[:password]
end
((options[:retry_limit] || RETRY_LIMIT) + 1).times do |i|
begin
response = get_remote(uri, options)
Expand Down
2 changes: 1 addition & 1 deletion lib/pact/matching_rules/merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def recurse expected, path
end

def recurse_hash hash, path
recursed = hash.each_with_object({}) do | (k, v), new_hash |
hash.each_with_object({}) do | (k, v), new_hash |
new_path = path + "['#{k}']"
new_hash[k] = recurse(v, new_path)
end
Expand Down
1 change: 1 addition & 0 deletions lib/pact/term.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'pact/shared/active_support_support'
Regexp.remove_method(:as_json) if Regexp.method_defined?(:as_json)
require 'json/add/regexp'
require 'pact/errors'

Expand Down