Open DavidRagone opened 10 years ago
Seems to have been fixed by changing the .metrics file to:
MetricFu::Configuration.run do |config|
config.configure_metrics.each do |metric|
metric.enabled = true
end
end
It seems very strange that the default file would be broken. Not sure if this is the right fix.
You shouldn't need that in your .metrics file at all. Nonetheless, yes, it is my fault for breaking that outside of a major release. I'll leave this open to remind me to add deprecations.
Cool. Happy to submit a PR if you have any guidance for what the .metrics file should look like by default.
I actually just realized that this was because the project I'm working on had a .metrics file previously. I simply hadn't noticed.
Sorry!
Anything else in your .metrics I should deprecate?
metrics, graphs, flay, flog, reek, roodi, saikuro, churn, and rcov all appear to have (at some point) been accessible on MetricFu::Configuration. I'm getting the same error for all of them.
Yes, see 'breaking changes' under https://github.com/metricfu/metric_fu/blob/master/HISTORY.md#metricfu-440--2013-08-15
These breaking changes should have been in a major release, and only deprecations in this release. Let me know if you need help converting your .metrics file to the new format.
Ah, that makes sense - thanks!
I'm not sure what the intention was of the various config options before, so I just turned everything to the defaults now (but skipping Flay because it doesn't seem to finish).
If Flay doesn't finish, please report a bug! If you could run with MF_DEBUG=true in the environment and paste metric_fu --debug-info that would be great! Are you running via the command-line or via rake? Installed via Gemfile or gem install?
Can do. I wasn't sure if it was my settings or it.
Installed via gem install, run via command line metric_fu
I'll run that and let you know what I get.
{"Ruby"=>
{"Engine"=>"ruby",
"Version"=>"1.9.3",
"Patchlevel"=>484,
"Ripper Support"=>true,
"Rubygems Version"=>"2.1.11",
"Long Description"=>
"ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-darwin12.5.0]"},
"Environment"=>
{"VERBOSE"=>"false",
"External Encoding"=>"UTF-8",
"Internal Encoding"=>"UTF-8",
"Host Architecture"=>"x86_64-apple-darwin12.5.0",
"Ruby Prefix"=>"/Users/dmragone/.rvm/rubies/ruby-1.9.3-p484",
"Ruby Options"=>""},
"MetricFu"=>
{"Version"=>"4.6.0",
"Verbose Mode"=>false,
"Enabled Metrics"=>
[:cane,
:churn,
:flay,
:flog,
:stats,
:saikuro,
:reek,
:roodi,
:rails_best_practices,
:hotspots],
"Dependencies"=>
[{"name"=>"flay", "version"=>[">= 2.0.1", "~> 2.1"]},
{"name"=>"churn", "version"=>["~> 0.0.28"]},
{"name"=>"flog", "version"=>[">= 4.1.1", "~> 4.1"]},
{"name"=>"reek", "version"=>[">= 1.3.4", "~> 1.3"]},
{"name"=>"cane", "version"=>[">= 2.5.2", "~> 2.5"]},
{"name"=>"rails_best_practices", "version"=>[">= 1.14.3", "~> 1.14"]},
{"name"=>"saikuro", "version"=>[">= 1.1.1.0"]},
{"name"=>"roodi", "version"=>["~> 3.1"]},
{"name"=>"code_metrics", "version"=>["~> 0.1"]},
{"name"=>"redcard", "version"=>[">= 0"]},
{"name"=>"coderay", "version"=>[">= 0"]},
{"name"=>"multi_json", "version"=>[">= 0"]},
{"name"=>"rcov", "version"=>["~> 0.8"]}]}}
Hi, sorry this issue has gotten stale. Would you still be interested in helping add a deprecation mechanism and the deprecated methods?
Hey sorry for the delayed response - been crazy busy lately. I'm definitely interested in helping, but not sure I'll be able to make time for it soon. However, if you don't mind leaving this open, I will certainly look to come back to it in a few weeks.
In the mean time, did you have anything in particular in mind for how to handle deprecation?
My first though is to wrap the method like rubygems does. My second is to do it like rspec does :)
I ran
gem install metric_fu
And then ran
metric_fu
in my project directory, and got the following error. I'm sure there's something I'm doing wrong, but not sure what the right steps are: