Class: SVNx::Log::Entry

Inherits:
Entry
  • Object
show all
Defined in:
lib/svnx/log/entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Entry

#get_attribute, #get_element_text, #initialize, #set_attr_var, #set_elmt_var, #set_from_xml, #set_var

Constructor Details

This class inherits a constructor from SVNx::Entry

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



11
12
13
# File 'lib/svnx/log/entry.rb', line 11

def author
  @author
end

#dateObject (readonly)

Returns the value of attribute date.



11
12
13
# File 'lib/svnx/log/entry.rb', line 11

def date
  @date
end

#msgObject (readonly)

Returns the value of attribute msg.



11
12
13
# File 'lib/svnx/log/entry.rb', line 11

def msg
  @msg
end

#pathsObject (readonly)

Returns the value of attribute paths.



11
12
13
# File 'lib/svnx/log/entry.rb', line 11

def paths
  @paths
end

#revisionObject (readonly)

Returns the value of attribute revision.



11
12
13
# File 'lib/svnx/log/entry.rb', line 11

def revision
  @revision
end

Instance Method Details

#match(action, filter) ⇒ Object



42
43
44
45
46
# File 'lib/svnx/log/entry.rb', line 42

def match action, filter
  paths.select do |path|
    path.match? action, filter
  end
end

#messageObject



34
35
36
# File 'lib/svnx/log/entry.rb', line 34

def message
  @msg
end

#set_from_element(elmt) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/svnx/log/entry.rb', line 13

def set_from_element elmt
  set_attr_var elmt, 'revision'

  %w{ author date msg }.each do |field|
    set_elmt_var elmt, field
  end
  
  @paths = Array.new

  elmt.elements.each('paths/path') do |pe|
    kind = get_attribute pe, 'kind'
    action = get_attribute pe, 'action'
    name = pe.text

    @paths << LogEntryPath.new(kind: kind, action: SVNx::Action.new(action), name: name)
  end
  
  # Svn isn't consistent with the order of paths
  @paths.sort!
end

#to_sObject



38
39
40
# File 'lib/svnx/log/entry.rb', line 38

def to_s
  [ @revision, @author, @date, @msg, @paths ].collect { |x| x.to_s }.join " "
end