Class: Svn::Log::EntryStruct
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- Svn::Log::EntryStruct
- Defined in:
- lib/svn/logs.rb
Overview
A subversion log entry
Instance Method Summary collapse
-
#author ⇒ Object
return the revision’s author.
-
#changed_paths ⇒ Object
returns a Hash of the revision’s changed paths.
-
#has_children? ⇒ Boolean
returns whether this revision has children.
-
#message ⇒ Object
(also: #log)
return the revision’s log message.
-
#props ⇒ Object
returns a Hash of the revision’s properties.
-
#rev ⇒ Object
(also: #num)
returns the revision number.
-
#timestamp ⇒ Object
return the Time that this revision was committed.
-
#to_h ⇒ Object
get the contents of this log entry as a multi-level hash.
Instance Method Details
#author ⇒ Object
return the revision’s author
92 93 94 |
# File 'lib/svn/logs.rb', line 92 def props[ AUTHOR_PROP_NAME ] if props end |
#changed_paths ⇒ Object
returns a Hash of the revision’s changed paths
72 73 74 75 76 77 78 |
# File 'lib/svn/logs.rb', line 72 def changed_paths @changed_paths ||= ( self[:changed_paths].null? ? nil : self[:changed_paths].to_h.tap { |by_path| by_path.each_key { |k| by_path[k] = by_path[k].to_h } } ) end |
#has_children? ⇒ Boolean
returns whether this revision has children
67 68 69 |
# File 'lib/svn/logs.rb', line 67 def has_children? ( self[:has_children] == 1 ) end |
#message ⇒ Object Also known as: log
return the revision’s log message
86 87 88 |
# File 'lib/svn/logs.rb', line 86 def props[ LOG_PROP_NAME ] if props end |
#props ⇒ Object
returns a Hash of the revision’s properties
81 82 83 |
# File 'lib/svn/logs.rb', line 81 def props @props ||= ( self[:rev_props].null? ? nil : self[:rev_props].to_h ) end |
#rev ⇒ Object Also known as: num
returns the revision number
61 62 63 |
# File 'lib/svn/logs.rb', line 61 def rev self[:rev] end |
#timestamp ⇒ Object
return the Time that this revision was committed
97 98 99 |
# File 'lib/svn/logs.rb', line 97 def Time.parse( props[ TIMESTAMP_PROP_NAME ] ) if props end |
#to_h ⇒ Object
get the contents of this log entry as a multi-level hash
102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/svn/logs.rb', line 102 def to_h h = { :rev => rev, :log => , :author => , :timestamp => , :has_children? => has_children?, } h[:changed_paths] = changed_paths if changed_paths h end |