Skip to content

Commit

Permalink
Resolve ruby 2.7 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
greeneca committed Nov 27, 2020
1 parent d9ed35a commit e95eb13
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/roku_builder.rb
Expand Up @@ -200,7 +200,7 @@ def self.execute_command
stager.stage
end
instance = plugin.new(config: @@config)
instance.send(@@options.command, {options: @@options})
instance.send(@@options.command, **{options: @@options})
stager.unstage if stager
end
end
Expand All @@ -224,7 +224,7 @@ def self.options_parse(options:)
def self.process_hook(hook:, params:)
@@plugins.each do |plugin|
if plugin.respond_to?("#{hook}_hook".to_sym)
plugin.send("#{hook}_hook", params)
plugin.send("#{hook}_hook", **params)
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/roku_builder/config_validator.rb
Expand Up @@ -89,7 +89,7 @@ def call_validate_method_for_section(section:, content:)
attrs = {}
attrs[section_singular] = content
method = "validate_#{section_singular}".to_sym
send(method, attrs)
send(method, **attrs)
end

def singularize(section:)
Expand Down
1 change: 1 addition & 0 deletions lib/roku_builder/plugins/analyzer.rb
Expand Up @@ -30,6 +30,7 @@ def self.dependencies
def analyze(options:, quiet: false)
@options = options
@warnings = []
@sca_warning = {}
performance_config = get_config("performance_config.json")
linter_config = get_config(".roku_builder_linter.json", true)
linter_config ||= {is_ssai: false}
Expand Down
2 changes: 1 addition & 1 deletion lib/roku_builder/version.rb
Expand Up @@ -2,5 +2,5 @@

module RokuBuilder
# Version of the RokuBuilder Gem
VERSION = "4.21.4"
VERSION = "4.21.5"
end
3 changes: 2 additions & 1 deletion test/roku_builder/plugins/test_analyzer.rb
Expand Up @@ -106,7 +106,7 @@ def test_performance_skip_warning_comment_upper_case
warnings = test_file(text: "function test() as String 'IGNORE-WARNING\n? \"test\"\nend function")
assert_equal 0, warnings.count
end
def test_performance_for_loop_title_case
def test_performance_for_each_loop_title_case
warnings = test_file(text: "For each button in buttons\n ? button\nEND FOR")
assert_equal 0, warnings.count
end
Expand Down Expand Up @@ -148,6 +148,7 @@ def test_logger_with_file_content(text:, severity:)
end

logger.verify
warnings
end

def test(quiet=true)
Expand Down
3 changes: 2 additions & 1 deletion test/roku_builder/plugins/test_profiler.rb
Expand Up @@ -32,7 +32,8 @@ def test_profiler_node_tracking
end
count = 0
read_stub = Proc.new do |size|
raise SystemExit if count = 2
shouldExit = (count = 2)
raise SystemExit if shouldExit
count += 1
end
connection = Minitest::Mock.new
Expand Down
3 changes: 1 addition & 2 deletions test/roku_builder/test_options.rb
Expand Up @@ -32,14 +32,13 @@ def test_options_initialize_params
end
def test_options_parse
parser = Minitest::Mock.new()
options_hash = {}
options = Options.allocate
parser.expect(:banner=, nil, [String])
parser.expect(:parse!, nil)
OptionParser.stub(:new, parser) do
options.stub(:add_plugin_options, nil) do
options.stub(:validate_parser, nil) do
options_hash = options.send(:parse)
options.send(:parse)
end
end
end
Expand Down

0 comments on commit e95eb13

Please sign in to comment.