Class: MetricFu::Churn
Instance Attribute Summary
Attributes inherited from Generator
#report, #template
Instance Method Summary
collapse
Methods inherited from Generator
class_name, #create_data_dir_if_missing, #create_metric_dir_if_missing, #create_output_dir_if_missing, generate_report, #generate_report, metric_directory, #metric_directory, #remove_excluded_files, #round_to_tenths, #to_graph
Constructor Details
#initialize(options = {}) ⇒ Churn
Returns a new instance of Churn.
5
6
7
|
# File 'lib/generators/churn.rb', line 5
def initialize(options={})
super
end
|
Instance Method Details
#analyze ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/generators/churn.rb', line 15
def analyze
if @output.match(/fatal: Not a git repository/)
@churn = [:churn => {}]
else
@churn = YAML::load(@output)
end
end
|
#emit ⇒ Object
9
10
11
12
13
|
# File 'lib/generators/churn.rb', line 9
def emit
@output = `churn --yaml`
yaml_start = @output.index("---")
@output = @output[yaml_start...@output.length] if yaml_start
end
|
#to_h ⇒ Object
23
24
25
|
# File 'lib/generators/churn.rb', line 23
def to_h
{:churn => @churn[:churn]}
end
|