Class: MetricFu::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/metric_fu/base.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



68
69
70
71
72
73
# File 'lib/metric_fu/base.rb', line 68

def initialize
  raise "Use config.churn instead of MetricFu::CHURN_OPTIONS" if defined? ::MetricFu::CHURN_OPTIONS
  raise "Use config.flog[:dirs_to_flog] instead of MetricFu::DIRECTORIES_TO_FLOG" if defined? ::MetricFu::DIRECTORIES_TO_FLOG
  raise "Use config.saikuro instead of MetricFu::SAIKURO_OPTIONS" if defined? ::MetricFu::SAIKURO_OPTIONS      
  reset      
end

Instance Attribute Details

#base_directoryObject

Returns the value of attribute base_directory.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def base_directory
  @base_directory
end

#churnObject

Returns the value of attribute churn.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def churn
  @churn
end

#coverageObject

Returns the value of attribute coverage.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def coverage
  @coverage
end

#flayObject

Returns the value of attribute flay.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def flay
  @flay
end

#flogObject

Returns the value of attribute flog.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def flog
  @flog
end

#generalObject

Returns the value of attribute general.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def general
  @general
end

#heckleObject

Returns the value of attribute heckle.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def heckle
  @heckle
end

#metricsObject

Returns the value of attribute metrics.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def metrics
  @metrics
end

#reekObject

Returns the value of attribute reek.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def reek
  @reek
end

#roodiObject

Returns the value of attribute roodi.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def roodi
  @roodi
end

#saikuroObject

Returns the value of attribute saikuro.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def saikuro
  @saikuro
end

#template_dirObject

Returns the value of attribute template_dir.



65
66
67
# File 'lib/metric_fu/base.rb', line 65

def template_dir
  @template_dir
end

Class Method Details

.run {|MetricFu.configuration| ... } ⇒ Object



75
76
77
# File 'lib/metric_fu/base.rb', line 75

def self.run()  
  yield MetricFu.configuration
end

Instance Method Details

#resetObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/metric_fu/base.rb', line 79

def reset
  @general  = { :open_in_browser => true }
  @churn    =  {}
  rcov_opts =  ["--sort coverage", "--html", "--exclude /gems/,/Library/,spec"]
  rcov_opts << "--rails" if MetricFu.is_rails?
  @coverage = { :test_files => ['test/**/*_test.rb', 'spec/**/*_spec.rb'],
                :rcov_opts => rcov_opts }
  @flay     = { :dirs_to_flay => MetricFu.code_dirs}
  @flog     = { :dirs_to_flog => MetricFu.code_dirs}
  @heckle   = { :dirs_to_heckle => MetricFu.code_dirs}      
  @reek     = { :dirs_to_reek => MetricFu.code_dirs}
  @roodi    = { :dirs_to_roodi => MetricFu.code_dirs}
  @metrics  = MetricFu.default_metrics
  @saikuro  = {}
  @template_dir = File.join(File.dirname(__FILE__), '..', 'templates')
  @base_directory = ENV['CC_BUILD_ARTIFACTS'] || 'tmp/metric_fu'      
end