Sha256: 53e90f138d19efffa63922827af0b973cc2ff57b96c3bb1feeb085ae4fd5c12c

Contents?: true

Size: 491 Bytes

Versions: 6

Compression:

Stored size: 491 Bytes

Contents

module Churn

  class SvnAnalyzer < SourceControl
    def get_logs
      `svn log #{date_range} --verbose`.split(/\n/).map { |line| clean_up_svn_line(line) }.compact
    end

    private
    def date_range
      if @start_date
        date = Chronic.parse(@start_date)
        "--revision {#{date.strftime('%Y-%m-%d')}}:{#{Time.now.strftime('%Y-%m-%d')}}"
      end
    end

    def clean_up_svn_line(line)
      m = line.match(/\W*[A,M]\W+(\/.*)\b/)
      m ? m[1] : nil
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
churn-0.0.12 lib/churn/svn_analyzer.rb
churn-0.0.11 lib/churn/svn_analyzer.rb
churn-0.0.10 lib/churn/svn_analyzer.rb
churn-0.0.9 lib/churn/svn_analyzer.rb
churn-0.0.8 lib/churn/svn_analyzer.rb
churn-0.0.7 lib/churn/svn_analyzer.rb