我正在使用 metric_fu 4.4.1
我的 .metrics 文件说:
MetricFu::Configuration.run do |config|
config.metrics -= [:reek]
config.metrics -= [:flay]
config.metrics -= [:flog]
end
我的 metric_fu.rake 说:
begin
require 'metric_fu'
rescue LoadError
puts 'Could not load metric_fu'
end
当我运行时:bundle exec rake metrics:all get the falling error
rake aborted!
undefined method `metrics' for #<MetricFu::Configuration:0xa3d4f14>
/home/montells/Projects/beesor/.metrics:2:in `block in <top (required)>'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/metric_fu-4.4.1/lib/metric_fu/configuration.rb:102:in `run'
/home/montells/Projects/beesor/.metrics:1:in `<top (required)>'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `block in load'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:245:in `load'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/metric_fu-4.4.1/lib/metric_fu/run.rb:32:in `load_user_configuration'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/metric_fu-4.4.1/lib/metric_fu/run.rb:6:in `initialize'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/metric_fu-4.4.1/lib/metric_fu/tasks/metric_fu.rake:5:in `new'
/home/montells/.rvm/gems/ruby-1.9.3-p392/gems/metric_fu-4.4.1/lib/metric_fu/tasks/metric_fu.rake:5:in `block (2 levels) in <top (required)>'
Tasks: TOP => metrics:all
(See full trace by running task with --trace)