Sha256: 6dd9f5642df953c82643e63f01cf3779b91ad915089e2194fccf63a07da15400

Contents?: true

Size: 588 Bytes

Versions: 22

Compression:

Stored size: 588 Bytes

Contents

module Churn

  #analizes SVN SCM to find recently changed files, and what lines have been altered
  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)
      match = line.match(/\W*[A,M]\W+(\/.*)\b/)
      match ? match[1] : nil
    end
  end

end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
churn-0.0.34 lib/churn/svn_analyzer.rb
churn-0.0.33 lib/churn/svn_analyzer.rb
churn-0.0.32 lib/churn/svn_analyzer.rb
churn-0.0.31 lib/churn/svn_analyzer.rb
churn-0.0.30 lib/churn/svn_analyzer.rb
churn-0.0.29 lib/churn/svn_analyzer.rb
churn-0.0.28 lib/churn/svn_analyzer.rb
churn-0.0.27 lib/churn/svn_analyzer.rb
churn-0.0.26 lib/churn/svn_analyzer.rb
churn-0.0.25 lib/churn/svn_analyzer.rb
churn-0.0.24 lib/churn/svn_analyzer.rb
churn-0.0.23 lib/churn/svn_analyzer.rb
churn-0.0.22 lib/churn/svn_analyzer.rb
churn-0.0.21 lib/churn/svn_analyzer.rb
churn-0.0.20 lib/churn/svn_analyzer.rb
churn-0.0.19 lib/churn/svn_analyzer.rb
rferraz-churn-0.0.19 lib/churn/svn_analyzer.rb
rferraz-churn-0.0.17 lib/churn/svn_analyzer.rb
rferraz-churn-0.0.16 lib/churn/svn_analyzer.rb
churn-0.0.15 lib/churn/svn_analyzer.rb