Class: Svnlog2csv::LogEntry
- Inherits:
-
Object
- Object
- Svnlog2csv::LogEntry
- Defined in:
- lib/svnlog2csv/log_entry.rb
Overview
Una LogEntry corrisponde ad un commit. Un commit è caratterizzato da una data, un autore e una serie di azioni. Ogni azione è un hash con la struttura n, dove tipo_azione può essere A (add), M (modify), D (delete), e n è il numero di file aggiunti/modificati/cancellati.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#author ⇒ Object
readonly
Returns the value of attribute author.
-
#day ⇒ Object
readonly
Returns the value of attribute day.
Instance Method Summary collapse
-
#initialize(xml) ⇒ LogEntry
constructor
A new instance of LogEntry.
Constructor Details
#initialize(xml) ⇒ LogEntry
Returns a new instance of LogEntry.
12 13 14 15 16 17 18 19 20 |
# File 'lib/svnlog2csv/log_entry.rb', line 12 def initialize xml doc = Nokogiri::XML(xml) @day = doc.xpath("//date")[0].inner_text[0..9] = doc.xpath("//author")[0].inner_text @actions = Hash.new(0) doc.xpath("//path").each do |path| @actions[path.attribute("action").value.to_sym] += 1 end end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
10 11 12 |
# File 'lib/svnlog2csv/log_entry.rb', line 10 def actions @actions end |
#author ⇒ Object (readonly)
Returns the value of attribute author.
10 11 12 |
# File 'lib/svnlog2csv/log_entry.rb', line 10 def end |
#day ⇒ Object (readonly)
Returns the value of attribute day.
10 11 12 |
# File 'lib/svnlog2csv/log_entry.rb', line 10 def day @day end |