Class: Herdsman::GitRepo::StatusParser

Inherits:
Object
  • Object
show all
Defined in:
lib/herdsman/git_repo.rb

Instance Method Summary collapse

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_filesObject



98
99
100
# File 'lib/herdsman/git_repo.rb', line 98

def modified_files
  status_porcelain.lines.select { |l| l =~ /^ ?[A-Z]/ }
end

#untracked_filesObject



94
95
96
# File 'lib/herdsman/git_repo.rb', line 94

def untracked_files
  status_porcelain.lines.select { |l| l.start_with?('??') }
end