lib/headdesk/cli_commands/blame.rb in headdesk-0.12.0 vs lib/headdesk/cli_commands/blame.rb in headdesk-0.13.0
- old
+ new
@@ -7,10 +7,11 @@
module Headdesk
module CliCommands
#
# Find out which JAR/AAR is bringing in symbols
#
+ # :reek:NilCheck, :reek:NestedIterators
module Blame
include Headdesk::CliCommand
def self.included(thor)
thor.class_eval do
@@ -54,11 +55,11 @@
# Pretty output
all_matches = jar_matches.merge(aar_matches)
all_matches.each do |package, symbols|
STDOUT.puts '📦 ' + package
symbols.each do |match|
- STDOUT.puts " ↳ #{match[0]}#{match[1].green}#{match[2].chomp('.') if match[2]}"
+ STDOUT.puts " ↳ #{match[0]}#{match[1].green}#{match[2]&.chomp('.')}"
end
end
CLI.print_update_message unless Headdesk::Versions.latest_version?
@@ -70,10 +71,10 @@
def self.match_lines(stdout, matcher)
stdout.lines
.each(&:strip!)
.map { |line| matcher.match(line) }
.compact
- .map { |match| match.captures.map { |capture| capture.tr('/', '.') if capture } }
+ .map { |match| match.captures.map { |capture| capture&.tr('/', '.') } }
end
end
end
end