我目前正在开发一个Ruby gem并希望创建度量。
我用的是米制的,但RCov好像留下了我的规格。
这是我的米制配置:

MetricFu::Configuration.run do |config|
        config.metrics  = [:churn, :saikuro, :flog, :flay, :reek, :roodi, :rcov]
        config.graphs   = [:flog, :flay, :reek, :roodi, :rcov]
        config.flay     = { :dirs_to_flay => ['lib']  }
        config.flog     = { :dirs_to_flog => ['lib']  }
        config.reek     = { :dirs_to_reek => ['lib']  }
        config.roodi    = { :dirs_to_roodi => ['lib'] }
        config.saikuro  = { :output_directory => 'scratch_directory/saikuro',
                            :input_directory => ['lib'],
                            :cyclo => "",
                            :filter_cyclo => "0",
                            :warn_cyclo => "5",
                            :error_cyclo => "7",
                            :formater => "text"} #this needs to be set to "text"
        config.churn    = { :start_date => "1 year ago", :minimum_churn_count => 10}
        config.rcov     = { :test_files => ["spec/**/*_spec.rb"],
                            :rcov_opts => ["--sort coverage",
                                           "--no-html",
                                           "--text-coverage",
                                           "--no-color",
                                           "--profile",
                                           "--spec-only",
                                           "--exclude /gems/,/Library/,spec"]}
end

你有什么建议吗?
致意

最佳答案

如果没有堆栈跟踪,这将很难诊断,但我建议将配置更改为:

MetricFu::Configuration.run do |config|
        config.metrics  = [:rcov]
        config.graphs   = [:rcov]
        config.rcov     = { :test_files => ["spec/**/*_spec.rb"],
                            :rcov_opts => ["--sort coverage",
                                           "--no-html",
                                           "--text-coverage",
                                           "--no-color",
                                           "--profile",
                                           "--spec-only",
                                           "--exclude /gems/,/Library/,spec"]}
end

所以你可以把问题隔离开来然后运行“rake metrics:all--trace”,如果您无法从中找出答案,请将结果发布到此处或google group:http://groups.google.com/group/metric_fu
您还可以尝试直接从命令行运行rcov(metric_fu基本上就是这样做的)。
希望能有所帮助。

关于ruby - RCov不起作用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1927527/

10-11 06:24