Class: MetricFu::Churn
- Inherits:
-
Base::Generator
- Object
- Base::Generator
- MetricFu::Churn
- Defined in:
- lib/metric_fu/churn.rb
Defined Under Namespace
Classes: Git, SourceControl, Svn
Instance Method Summary collapse
- #analyze ⇒ Object
-
#initialize(base_dir, options = {}) ⇒ Churn
constructor
A new instance of Churn.
-
#template_name ⇒ Object
should be dynamically read from the class.
Methods inherited from Base::Generator
#generate_html, #generate_report, generate_report, #link_to_filename, #save_html, #template_file
Constructor Details
#initialize(base_dir, options = {}) ⇒ Churn
Returns a new instance of Churn.
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/metric_fu/churn.rb', line 4 def initialize(base_dir, ={}) @base_dir = base_dir if File.exist?(".git") @source_control = Git.new([:start_date]) elsif File.exist?(".svn") @source_control = Svn.new([:start_date]) else raise "Churning requires a subversion or git repo" end @minimum_churn_count = [:minimum_churn_count] || 5 end |
Instance Method Details
#analyze ⇒ Object
17 18 19 |
# File 'lib/metric_fu/churn.rb', line 17 def analyze @changes = parse_log_for_changes.reject! {|file, change_count| change_count < @minimum_churn_count} end |
#template_name ⇒ Object
should be dynamically read from the class
22 23 24 |
# File 'lib/metric_fu/churn.rb', line 22 def template_name 'churn' end |