class Status class Line def initialize(text) text.strip! @modified = /^M/.match(text) ? true : false @external = /^X/.match(text) ? true : false @unversioned = /^\?/.match(text) ? true : false @modified_properties = /^.M/.match(text) ? true : false @path = text.gsub(/^...... /, '') end attr_reader :path def modified? @modified end def external? @external end def unversioned? @unversioned end def modified_properties? @modified_properties end end def initialize(text) @lines = text.split("\n").collect do |line| Status::Line.new(line) end end def modified @lines.select { |line| line.modified? }.collect {|line| line.path} end def externals @lines.select { |line| line.external? }.collect {|line| line.path} end def unversioned @lines.select { |line| line.unversioned? }.collect {|line| line.path} end end