Class: BuildMaster::SvnStatusInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/buildmaster/project/svn_status_info.rb

Defined Under Namespace

Classes: Entry

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSvnStatusInfo

Returns a new instance of SvnStatusInfo.



6
7
8
# File 'lib/buildmaster/project/svn_status_info.rb', line 6

def initialize
  @changes = Array.new
end

Class Method Details

.parse_xml(content) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/buildmaster/project/svn_status_info.rb', line 14

def SvnStatusInfo::parse_xml(content)
  info = SvnStatusInfo.new
  xml = REXML::Document.new(content)
  REXML::XPath.each(xml, '/status/target/entry') do |entry|
    info.add Entry.new(entry)
  end
  return info
end

Instance Method Details

#add(entry) ⇒ Object



10
11
12
# File 'lib/buildmaster/project/svn_status_info.rb', line 10

def add(entry)
  @changes.push entry
end

#entries(status) ⇒ Object



31
32
33
34
35
# File 'lib/buildmaster/project/svn_status_info.rb', line 31

def entries(status)
  @changes.select {|entry|
    entry.status == status
  }
end

#missingObject



27
28
29
# File 'lib/buildmaster/project/svn_status_info.rb', line 27

def missing
  entries('missing')
end

#unversionedObject



23
24
25
# File 'lib/buildmaster/project/svn_status_info.rb', line 23

def unversioned
  entries('unversioned')
end