lib/metric_fu/metrics/flay/init.rb in metric_fu-4.3.1 vs lib/metric_fu/metrics/flay/init.rb in metric_fu-4.4.0
- old
+ new
@@ -1,14 +1,30 @@
-MetricFu::Configuration.run do |config|
- require 'flay'
- config.add_metric(:flay)
- config.add_graph(:flay)
- config.configure_metric(:flay,
- { :dirs_to_flay => MetricFu.code_dirs, # was @code_dirs
- # MetricFu has been setting the minimum score as 100 for
- # a long time. This is a really big number, considering
- # the default is 16. Commenting it out for documentation
- # of the setting, but to use the Flay default.
- # :minimum_score => 100,
- :filetypes => ['rb'] }
- )
+module MetricFu
+ class MetricFlay < Metric
+
+ def name
+ :flay
+ end
+
+ def default_run_options
+ { :dirs_to_flay => MetricFu::Io::FileSystem.directory('code_dirs'),
+ # MetricFu has been setting the minimum score as 100 for
+ # a long time. This is a really big number, considering
+ # the default is 16. Setting it to nil to use the Flay default.
+ :minimum_score => nil,
+ :filetypes => ['rb'] }
+ end
+
+ def has_graph?
+ true
+ end
+
+ def enable
+ super
+ end
+
+ def activate
+ super
+ end
+
+ end
end