Class: Achoo::VCS::Subversion
- Inherits:
-
Object
- Object
- Achoo::VCS::Subversion
- Defined in:
- lib/achoo/vcs/subversion.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(dir) ⇒ Subversion
constructor
A new instance of Subversion.
- #log_for(date) ⇒ Object
Constructor Details
#initialize(dir) ⇒ Subversion
Returns a new instance of Subversion.
11 12 13 |
# File 'lib/achoo/vcs/subversion.rb', line 11 def initialize(dir) @dir = dir end |
Class Method Details
.repository?(dir) ⇒ Boolean
7 8 9 |
# File 'lib/achoo/vcs/subversion.rb', line 7 def self.repository?(dir) File.exist?("#{dir}/.svn") end |
Instance Method Details
#log_for(date) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/achoo/vcs/subversion.rb', line 15 def log_for(date) date = date.strftime("%F") xml = Nokogiri::XML(`cd #@dir; svn log --xml`) logentries = xml.xpath("/log/logentry/author[contains(., \"#{ENV['USER']}\")]/parent::*") # FIX are the dates in the xml local time, or do they need to be # converted? log = "" logentries.each do |e| if e.css('date').text.start_with?(date) log << e.css('msg').text.strip << "\n" end end log end |