Class: Herdsman::GitRepo::StatusParser
- Inherits:
-
Object
- Object
- Herdsman::GitRepo::StatusParser
- Defined in:
- lib/herdsman/git_repo.rb
Instance Method Summary collapse
-
#initialize(status_porcelain) ⇒ StatusParser
constructor
A new instance of StatusParser.
- #modified_files ⇒ Object
- #untracked_files ⇒ Object
Constructor Details
#initialize(status_porcelain) ⇒ StatusParser
Returns a new instance of StatusParser.
90 91 92 |
# File 'lib/herdsman/git_repo.rb', line 90 def initialize(status_porcelain) @status_porcelain = status_porcelain end |
Instance Method Details
#modified_files ⇒ Object
98 99 100 |
# File 'lib/herdsman/git_repo.rb', line 98 def modified_files status_porcelain.lines.select { |l| l =~ /^ ?[A-Z]/ } end |
#untracked_files ⇒ Object
94 95 96 |
# File 'lib/herdsman/git_repo.rb', line 94 def untracked_files status_porcelain.lines.select { |l| l.start_with?('??') } end |