Class: Utils::LineBlamer
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, lineno = 1) ⇒ LineBlamer
constructor
A new instance of LineBlamer.
- #perform(options = '') ⇒ Object
Constructor Details
#initialize(file, lineno = 1) ⇒ LineBlamer
Returns a new instance of LineBlamer.
3 4 5 |
# File 'lib/utils/line_blamer.rb', line 3 def initialize(file, lineno = 1) @file, @lineno = file, lineno end |
Class Method Details
.for_line(line) ⇒ Object
7 8 9 |
# File 'lib/utils/line_blamer.rb', line 7 def self.for_line(line) location = line.source_location and new(*location) end |
Instance Method Details
#perform(options = '') ⇒ Object
11 12 13 |
# File 'lib/utils/line_blamer.rb', line 11 def perform( = '') `git 2>/dev/null blame #{} -L #@lineno,+1 "#@file"`.full? end |