Skip to content

Commit 4a0a70a

Browse files
committed
Remove named parameters to support older versions of Ruby
1 parent 3716898 commit 4a0a70a

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

exe/bundle_report

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ require "json"
6464
require "rest-client"
6565

6666
class BundleReport
67-
def self.compatibility(rails_version:, include_rails_gems:)
67+
def self.compatibility(opts = {})
68+
rails_version = opts[:rails_version]
69+
include_rails_gems = opts[:include_rails_gems]
70+
6871
incompatible_gems = BundleReport::GemInfo.all.reject do |gem|
6972
gem.compatible_with_rails?(rails_version: rails_version) || (!include_rails_gems && gem.from_rails?)
7073
end.sort_by do |gem|
@@ -229,11 +232,13 @@ class BundleReport
229232
end
230233
end
231234

232-
def compatible_with_rails?(rails_version: Gem::Version.new("5.0"))
235+
def compatible_with_rails?(opts = {})
236+
rails_version = opts[:rails_version] || Gem::Version.new("5.0")
233237
unsatisfied_rails_dependencies(rails_version: rails_version).empty?
234238
end
235239

236-
def unsatisfied_rails_dependencies(rails_version:)
240+
def unsatisfied_rails_dependencies(opts = {})
241+
rails_version = opts[:rails_version]
237242
rails_dependencies = gem_specification.runtime_dependencies.select {|dependency| rails_gems.include?(dependency.name) }
238243

239244
rails_dependencies.reject do |rails_dependency|

exe/deprecations

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ require "colorize"
44
require "optparse"
55
require "set"
66

7-
def run_tests(deprecation_warnings, tracker_mode:, next_mode:)
7+
def run_tests(deprecation_warnings, opts = {})
8+
tracker_mode = opts[:tracker_mode]
9+
next_mode = opts[:next_mode]
810
rspec_command = if next_mode
911
"bin/next rspec"
1012
else
@@ -16,7 +18,8 @@ def run_tests(deprecation_warnings, tracker_mode:, next_mode:)
1618
exec command
1719
end
1820

19-
def print_info(deprecation_warnings, verbose: false)
21+
def print_info(deprecation_warnings, opts = {})
22+
verbose = !!opts[:verbose]
2023
frequency_by_message = deprecation_warnings.each_with_object({}) do |(test_file, messages), hash|
2124
messages.each do |message|
2225
hash[message] ||= { test_files: Set.new, occurrences: 0 }

lib/deprecation_tracker.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ def Kernel.warn(*args, &block)
3939
end
4040
end
4141

42-
def self.track_rspec(rspec_config, shitlist_path:, mode:, transform_message: nil)
42+
def self.track_rspec(rspec_config, opts = {})
43+
shitlist_path = opts[:shitlist_path]
44+
mode = opts[:mode]
45+
transform_message = opts[:transform_message]
4346
deprecation_tracker = DeprecationTracker.new(shitlist_path, transform_message)
4447
if defined?(ActiveSupport)
4548
ActiveSupport::Deprecation.behavior << -> (message, _callstack) { deprecation_tracker.add(message) }

0 commit comments

Comments
 (0)