Class: Svnx::Log::Entry
- Inherits:
-
Base::Entry
- Object
- Base::Entry
- Svnx::Log::Entry
- Defined in:
- lib/svnx/log/entry.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Instance Method Summary collapse
- #datetime ⇒ Object
- #find_paths(args) ⇒ Object
- #match(action, filter) ⇒ Object
- #message ⇒ Object
- #set_from_element(elmt) ⇒ Object
- #to_s ⇒ Object
Methods inherited from Base::Entry
#attribute_value, #element_text, #initialize, #set_attr_var, #set_attr_vars, #set_elmt_var, #set_elmt_vars, #set_var
Constructor Details
This class inherits a constructor from Svnx::Base::Entry
Instance Attribute Details
#author ⇒ Object (readonly)
Returns the value of attribute author.
16 17 18 |
# File 'lib/svnx/log/entry.rb', line 16 def @author end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
16 17 18 |
# File 'lib/svnx/log/entry.rb', line 16 def date @date end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
16 17 18 |
# File 'lib/svnx/log/entry.rb', line 16 def msg @msg end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
16 17 18 |
# File 'lib/svnx/log/entry.rb', line 16 def paths @paths end |
#revision ⇒ Object (readonly)
Returns the value of attribute revision.
16 17 18 |
# File 'lib/svnx/log/entry.rb', line 16 def revision @revision end |
Instance Method Details
#datetime ⇒ Object
50 51 52 |
# File 'lib/svnx/log/entry.rb', line 50 def datetime @dt ||= DateTime.parse date end |
#find_paths(args) ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/svnx/log/entry.rb', line 54 def find_paths args paths.select do |path| if args[:kind] path.kind == args[:kind] end end end |
#match(action, filter) ⇒ Object
44 45 46 47 48 |
# File 'lib/svnx/log/entry.rb', line 44 def match action, filter paths.select do |path| path.match? action, filter end end |
#message ⇒ Object
36 37 38 |
# File 'lib/svnx/log/entry.rb', line 36 def @msg end |
#set_from_element(elmt) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/svnx/log/entry.rb', line 18 def set_from_element elmt set_attr_var elmt, 'revision' set_elmt_vars elmt, 'author', 'date', 'msg' @paths = Array.new elmt.elements.each('paths/path') do |pe| kind = attribute_value pe, 'kind' action = attribute_value pe, 'action' name = pe.text @paths << EntryPath.new(kind: kind, action: Svnx::Action.new(action), name: name) end # Svn isn't consistent with the order of paths @paths.sort! end |
#to_s ⇒ Object
40 41 42 |
# File 'lib/svnx/log/entry.rb', line 40 def to_s [ @revision, @author, @date, @msg, @paths ].collect { |x| x.to_s }.join " " end |