Module: Deathnote
- Defined in:
- lib/deathnote.rb,
lib/deathnote/version.rb
Defined Under Namespace
Classes: DeadCodes
Constant Summary collapse
- VERSION =
'0.1.1'
Class Method Summary collapse
Class Method Details
.run(argv) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/deathnote.rb', line 10 def run(argv) = (argv) old_branch = Open3.popen3('git rev-parse --abbrev-ref HEAD') { |_i, o, _e, _t| o.read.chomp } base_missing = DeadCodes.new(branch: [:base_commit], options: .deep_clone).run pr_missing = DeadCodes.new(branch: [:compare_commit], options: .deep_clone).run Open3.popen3("git checkout #{old_branch}") pr_missing. reject { |unused, _location| base_missing.has_key?(unused) }. each { |unused, location| puts "#{unused} #{location}" } end |