Class: Obst::GitLog::Commit::FileStatus
- Inherits:
-
Object
- Object
- Obst::GitLog::Commit::FileStatus
- Defined in:
- lib/obst/git_log.rb
Overview
Constant Summary collapse
- TAB =
/\t/
- AMD =
/^[AMD]/
- RENAME =
/^R/
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#old_name ⇒ Object
readonly
Returns the value of attribute old_name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(line) ⇒ FileStatus
constructor
A new instance of FileStatus.
Constructor Details
#initialize(line) ⇒ FileStatus
Returns a new instance of FileStatus.
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/obst/git_log.rb', line 35 def initialize(line) if line =~ AMD @status, @name = line.split(TAB) @status = @status.downcase.to_sym elsif line =~ RENAME @score, @old_name, @name = line.split(TAB) @status = :r end @name.strip! if @name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
33 34 35 |
# File 'lib/obst/git_log.rb', line 33 def name @name end |
#old_name ⇒ Object (readonly)
Returns the value of attribute old_name.
33 34 35 |
# File 'lib/obst/git_log.rb', line 33 def old_name @old_name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
33 34 35 |
# File 'lib/obst/git_log.rb', line 33 def status @status end |