Class: MetricFu::MetricRailsBestPractices

Inherits:
Metric
  • Object
show all
Defined in:
lib/metric_fu/metrics/rails_best_practices/metric.rb

Instance Attribute Summary

Attributes inherited from Metric

#activated, #enabled

Instance Method Summary collapse

Methods inherited from Metric

#configured_run_options, #default_run_args, enabled_metrics, #gem_name, get_metric, #initialize, metrics, #run, #run_external, #run_options

Constructor Details

This class inherits a constructor from MetricFu::Metric

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MetricFu::Metric

Instance Method Details

#activateObject



23
24
25
26
# File 'lib/metric_fu/metrics/rails_best_practices/metric.rb', line 23

def activate
  activate_library("rails_best_practices")
  super
end

#default_run_optionsObject



7
8
9
# File 'lib/metric_fu/metrics/rails_best_practices/metric.rb', line 7

def default_run_options
  {}
end

#enableObject



15
16
17
18
19
20
21
# File 'lib/metric_fu/metrics/rails_best_practices/metric.rb', line 15

def enable
  if MetricFu.configuration.supports_ripper?
    super if MetricFu.configuration.rails?
  else
    MetricFu.logger.debug("Rails Best Practices is only available in MRI 1.9. It requires ripper")
  end
end

#has_graph?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/metric_fu/metrics/rails_best_practices/metric.rb', line 11

def has_graph?
  true
end

#nameObject



3
4
5
# File 'lib/metric_fu/metrics/rails_best_practices/metric.rb', line 3

def name
  :rails_best_practices
end