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.
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
-
#msg ⇒ Object
readonly
Returns the value of attribute msg.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#reverse_merge ⇒ Object
readonly
Returns the value of attribute reverse_merge.
-
#revision ⇒ Object
readonly
Returns the value of attribute revision.
Instance Method Summary collapse
- #datetime ⇒ Object
- #find_paths(args) ⇒ Object
- #inspect ⇒ 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.
11 12 13 |
# File 'lib/svnx/log/entry.rb', line 11 def @author end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
11 12 13 |
# File 'lib/svnx/log/entry.rb', line 11 def date @date end |
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
11 12 13 |
# File 'lib/svnx/log/entry.rb', line 11 def entries @entries end |
#msg ⇒ Object (readonly)
Returns the value of attribute msg.
11 12 13 |
# File 'lib/svnx/log/entry.rb', line 11 def msg @msg end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
11 12 13 |
# File 'lib/svnx/log/entry.rb', line 11 def paths @paths end |
#reverse_merge ⇒ Object (readonly)
Returns the value of attribute reverse_merge.
11 12 13 |
# File 'lib/svnx/log/entry.rb', line 11 def reverse_merge @reverse_merge end |
#revision ⇒ Object (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
#datetime ⇒ Object
46 47 48 |
# File 'lib/svnx/log/entry.rb', line 46 def datetime @dt ||= DateTime.parse date end |
#find_paths(args) ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/svnx/log/entry.rb', line 50 def find_paths args paths.select do |path| if args[:kind] path.kind == args[:kind] end end end |
#inspect ⇒ Object
36 37 38 |
# File 'lib/svnx/log/entry.rb', line 36 def inspect to_s end |
#match(action, filter) ⇒ Object
40 41 42 43 44 |
# File 'lib/svnx/log/entry.rb', line 40 def match action, filter paths.select do |path| path.match? action, filter end end |
#message ⇒ Object
28 29 30 |
# File 'lib/svnx/log/entry.rb', line 28 def @msg end |
#set_from_element(elmt) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/svnx/log/entry.rb', line 13 def set_from_element elmt set_attr_var elmt, 'revision', convert: :to_i @reverse_merge = attribute_value elmt, 'reverse-merge' set_elmt_vars elmt, 'author', 'date', 'msg' @paths = elmt.xpath('paths/path').collect do |pe| EntryPath.new attr: pe end.sort # sorted, because svn is not consistent with order @entries = elmt.xpath('logentry').collect do |le| Entry.new le end end |
#to_s ⇒ Object
32 33 34 |
# File 'lib/svnx/log/entry.rb', line 32 def to_s [ @revision, @author, @date, @msg ].collect { |x| x.to_s }.join " " end |