Skip to content

Commit

Permalink
refactor: remove unused argument
Browse files Browse the repository at this point in the history
  • Loading branch information
bethesque committed Jan 13, 2020
1 parent 4cb3e9f commit d1e040d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/pact_broker/matrix/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def find_ids_for_pacticipant_names params

# Return the latest matrix row (pact/verification) for each consumer_version_number/provider_version_number
def find specified_selectors, options = {}
resolved_selectors = resolve_selectors(specified_selectors, options)
resolved_selectors = resolve_specified_selectors(specified_selectors, options)
lines = query_matrix(resolved_selectors, options)
lines = apply_latestby(options, specified_selectors, lines)

Expand Down Expand Up @@ -131,8 +131,8 @@ def base_model(options)
options[:latestby] ? QuickRow : EveryRow
end

def resolve_selectors(specified_selectors, options)
resolved_specified_selectors = resolve_versions_and_add_ids(specified_selectors, :specified, options[:latestby])
def resolve_specified_selectors(specified_selectors, options)
resolved_specified_selectors = resolve_versions_and_add_ids(specified_selectors, :specified)
if options[:latest] || options[:tag]
add_inferred_selectors(resolved_specified_selectors, options)
else
Expand All @@ -141,19 +141,19 @@ def resolve_selectors(specified_selectors, options)
end

# Find the version number for selectors with the latest and/or tag specified
def resolve_versions_and_add_ids(selectors, selector_type, latestby)
def resolve_versions_and_add_ids(selectors, selector_type)
selectors.collect do | selector |
pacticipant = PactBroker::Domain::Pacticipant.find(name: selector[:pacticipant_name])
versions = find_versions_for_selector(selector)
build_selectors_for_pacticipant_and_versions(pacticipant, versions, selector, selector_type, latestby)
build_selectors_for_pacticipant_and_versions(pacticipant, versions, selector, selector_type)
end.flatten
end

def build_selectors_for_pacticipant_and_versions(pacticipant, versions, original_selector, selector_type, latestby)
def build_selectors_for_pacticipant_and_versions(pacticipant, versions, original_selector, selector_type)
if versions
versions.collect do | version |
if version
selector_for_version(pacticipant, version, original_selector, selector_type, latestby)
selector_for_version(pacticipant, version, original_selector, selector_type)
else
selector_for_non_existing_version(pacticipant, original_selector, selector_type)
end
Expand Down Expand Up @@ -200,7 +200,7 @@ def build_inferred_selectors(inferred_pacticipant_names, options)
selector[:latest] = options[:latest] if options[:latest]
selector
end
resolve_versions_and_add_ids(selectors, :inferred, options[:latestby])
resolve_versions_and_add_ids(selectors, :inferred)
end

def all_pacticipant_names_in_specified_matrix(selectors)
Expand All @@ -214,7 +214,7 @@ def selector_for_non_existing_version(pacticipant, original_selector, selector_t
ResolvedSelector.for_pacticipant_and_non_existing_version(pacticipant, original_selector, selector_type)
end

def selector_for_version(pacticipant, version, original_selector, selector_type, latestby)
def selector_for_version(pacticipant, version, original_selector, selector_type)
ResolvedSelector.for_pacticipant_and_version(pacticipant, version, original_selector, selector_type)
end

Expand Down

0 comments on commit d1e040d

Please sign in to comment.