Class: NdrDevSupport::Rubocop::RangeFinder

Inherits:
Object
  • Object
show all
Defined in:
lib/ndr_dev_support/rubocop/range_finder.rb

Overview

Produces diffs, and parses from them the file/hunk boundaries

Instance Method Summary collapse

Instance Method Details

#diff_expr(expr) ⇒ Object



26
27
28
# File 'lib/ndr_dev_support/rubocop/range_finder.rb', line 26

def diff_expr(expr)
  file_change_locations_from git_diff(expr)
end

#diff_files(files) ⇒ Object



10
11
12
# File 'lib/ndr_dev_support/rubocop/range_finder.rb', line 10

def diff_files(files)
  file_change_locations_from git_diff(files * ' ')
end

#diff_headObject



14
15
16
# File 'lib/ndr_dev_support/rubocop/range_finder.rb', line 14

def diff_head
  file_change_locations_from git_diff('HEAD')
end

#diff_stagedObject



18
19
20
# File 'lib/ndr_dev_support/rubocop/range_finder.rb', line 18

def diff_staged
  file_change_locations_from git_diff('--staged')
end

#diff_unstagedObject



22
23
24
# File 'lib/ndr_dev_support/rubocop/range_finder.rb', line 22

def diff_unstaged
  file_change_locations_from git_diff('')
end