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



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

def diff_expr(expr)
  file_change_locations_from git_diff(expr)
end

#diff_files(files) ⇒ Object



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

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

#diff_headObject



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

def diff_head
  file_change_locations_from git_diff('HEAD')
end

#diff_stagedObject



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

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

#diff_unstagedObject



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

def diff_unstaged
  file_change_locations_from git_diff('')
end