Commit 25ee2498 authored by intrigeri's avatar intrigeri
Browse files

Rubocop: fix Style/SymbolProc offenses

Changes generated with:

`rubocop --only Style/SymbolProc --auto-correct`
parent 9f98f048
......@@ -266,22 +266,3 @@ Style/SafeNavigation:
- 'features/support/helpers/misc_helpers.rb'
- 'features/support/helpers/vm_helper.rb'
- 'features/support/hooks.rb'
# Offense count: 12
# Cop supports --auto-correct.
# Configuration parameters: IgnoredMethods.
# IgnoredMethods: respond_to, define_method
Style/SymbolProc:
Exclude:
- 'Rakefile'
- 'bin/doc-impacted-by'
- 'features/step_definitions/build.rb'
- 'features/step_definitions/chutney.rb'
- 'features/step_definitions/common_steps.rb'
- 'features/step_definitions/thunderbird.rb'
- 'features/step_definitions/tor.rb'
- 'features/support/helpers/misc_helpers.rb'
- 'features/support/helpers/opencv.rb'
- 'features/support/helpers/screen.rb'
- 'features/support/helpers/vm_helper.rb'
- 'features/support/hooks.rb'
......@@ -593,7 +593,7 @@ def clean_up_builder_vms
old_domain =
begin
old_domain_uuid =
open('vagrant/.vagrant/machines/default/libvirt/id', 'r') { |f| f.read }
open('vagrant/.vagrant/machines/default/libvirt/id', 'r', &:read)
.strip
libvirt.lookup_domain_by_uuid(old_domain_uuid)
rescue Errno::ENOENT, Libvirt::RetrieveError
......
......@@ -196,7 +196,7 @@ def find_impacted_docs(impact_map,
source_path_diff = git_diff.clone.path(source_path)
next if source_path_diff.empty?
changed_files = source_path_diff.map { |file| file.path }
changed_files = source_path_diff.map(&:path)
reasons = changed_files.map do |path|
"Changes in source file: #{path}"
end
......
......@@ -6,7 +6,7 @@ Given /^Tails ([[:alnum:]~.]+) has been released$/ do |version|
old_branch = current_branch
fatal_system 'git checkout --quiet stable'
old_entries = File.open('debian/changelog') { |f| f.read }
old_entries = File.open('debian/changelog', &:read)
File.open('debian/changelog', 'w') do |changelog|
changelog.write(<<~END_OF_CHANGELOG)
tails (#{version}) stable; urgency=low
......
......@@ -82,7 +82,7 @@ def ensure_chutney_is_running
match = Regexp.new('^(\d+)/(\d+) nodes are running$').match(status)
assert_not_nil(match, "Chutney's status did not contain the expected " +
'string listing the number of running nodes')
running, total = match[1, 2].map { |x| x.to_i }
running, total = match[1, 2].map(&:to_i)
assert_equal(
total, running, "Chutney is only running #{running}/#{total} nodes"
)
......
......@@ -762,7 +762,7 @@ When /^(no|\d+) application(?:s?) (?:is|are) playing audio(?:| after (\d+) secon
end
When /^I double-click on the (Tails documentation|Report an Error) launcher on the desktop$/ do |launcher|
image = 'Desktop' + launcher.split.map { |s| s.capitalize } .join + '.png'
image = 'Desktop' + launcher.split.map(&:capitalize) .join + '.png'
info = xul_application_info('Tor Browser')
# Sometimes the double-click is lost (#12131).
retry_action(10) do
......
......@@ -82,7 +82,7 @@ Then /^I see that only the (.+) add-on(?:s are| is) enabled in Thunderbird$/ do
@thunderbird_addons
.child('Enigmail', roleName: 'label')
.parent.parent.children(roleName: 'list item', recursive: false)
.map { |item| item.name }
.map(&:name)
expected_addons.each do |addon|
result = actual_addons.find { |e| e.start_with?(addon) }
assert_not_nil(result)
......
......@@ -175,7 +175,7 @@ Then /^the firewall is configured to block all external IPv6 traffic$/ do
bad_rules = rules - good_rules
assert(bad_rules.empty?,
"The IPv6 table's #{name} chain contains some unexpected rules:\n" +
(bad_rules.map { |r| r.to_s }).join("\n"))
(bad_rules.map(&:to_s)).join("\n"))
end
end
......
......@@ -293,7 +293,7 @@ def random_alpha_string(min_len, max_len = 0)
end
def random_alnum_string(min_len, max_len = 0)
alnum_set = ('A'..'Z').to_a + ('a'..'z').to_a + (0..9).to_a.map { |n| n.to_s }
alnum_set = ('A'..'Z').to_a + ('a'..'z').to_a + (0..9).to_a.map(&:to_s)
random_string_from_set(alnum_set, min_len, max_len)
end
......
......@@ -27,7 +27,7 @@ module OpenCV
out = p.readlines.join("\n")
case $CHILD_STATUS.exitstatus
when 0
out.chomp.split.map { |s| s.to_i }
out.chomp.split.map(&:to_i)
when 1
nil
else
......
......@@ -92,7 +92,7 @@ class Screen
end
def xdotool(*args)
out = cmd_helper(['xdotool'] + args.map { |x| x.to_s })
out = cmd_helper(['xdotool'] + args.map(&:to_s))
assert(out.empty?, "xdotool reported an error:\n" + out)
end
......
......@@ -705,7 +705,7 @@ class VM
File.delete(file)
end
old_domain = $virt.lookup_domain_by_name(LIBVIRT_DOMAIN_NAME)
old_domain.list_all_snapshots.each { |snapshot| snapshot.delete }
old_domain.list_all_snapshots.each(&:delete)
rescue Libvirt::RetrieveError
# No such domain, so no snapshots either.
end
......
......@@ -72,7 +72,7 @@ end
After do
if @after_scenario_hooks
@after_scenario_hooks.each { |block| block.call }
@after_scenario_hooks.each(&:call)
end
@after_scenario_hooks = []
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment