Class: NdrDevSupport::Rubocop::RangeFinder
- Inherits:
-
Object
- Object
- NdrDevSupport::Rubocop::RangeFinder
- 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
- #diff_expr(expr) ⇒ Object
- #diff_files(files) ⇒ Object
- #diff_head ⇒ Object
- #diff_staged ⇒ Object
- #diff_unstaged ⇒ Object
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_head ⇒ Object
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_staged ⇒ Object
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_unstaged ⇒ Object
21 22 23 |
# File 'lib/ndr_dev_support/rubocop/range_finder.rb', line 21 def diff_unstaged file_change_locations_from git_diff('') end |