Code Monkey home page Code Monkey logo

metrical's Introduction

Warning: This gem is not being maintained anymore!

I work exclusively with Ruby 1.9, and most tools included don't (fully) support it. If you want to take over the project, fork the project, and open an issue stating your intentions.


Metrical

Build Status

MetricFu is awesome! Metrical strives to make it a little bit easier to get working.

Features

Cleverer defaults

Normally, RCov would work on a black-listing basis. This means that your coverage reports would occasionally be flooded with code outside your project. No longer, because the default is now to exclude everything and only include your lib and app directories. It also fixes some issues with loading RSpec.

Usage

You're advised to install it with Bundler, because of dependency issues. Add this to your Gemfile:

gem 'metrical', :require => false

Then run:

bundle install

And run it:

bundle exec metrical

Configuration

You can configure MetricFu in a .metrics file in the root of your project.

MetricFu::Configuration.run do |config|
  config.metrics -= [ :rcov ]
end

For more information on configuring your metrics, please visit the MetricFu homepage.

You can also turn off metrics when running, for instance:

bundle exec metrical --no-rcov

The metrics you can turn on and off depend on the type of project you are in. For instance, Rails projects also have rails_best_practices and stats as options.

Also, Metrical tries to be smart about your Ruby version. Some metrics are not available on Ruby 1.9 and are disabled automatically.

To see which metrics are available, run:

bundle exec metrical --help

And that's all there is too it. If you have any suggestions, ideas or bug fixes, please drop me a line, or make a github issue.

Known issues

General lack of support of Ruby 1.9

Most tools don't handle Ruby 1.9 new syntax properly. It doesn't look like this is going to change any time soon.

RCov and Ruby 1.9

RCov doesn't work at all with Ruby 1.9. You should use something like SimpleCov. Unfortunately, it hasn't been included into MetricFu yet. Until then, Metrical automatically disables RCov under Ruby 1.9.

New syntax in Ruby 1.9

Most metrics can't cope with the new syntax in Ruby 1.9. There is nothing I can do about that, or the creator of these metrics, because the root lie in the code parser they use. Either don't use the new syntax or exclude these metrics in your .metrics file.

Roodi vs. Psych

If you're running Ruby 1.9 with Psych as your default YAML parser (possible in 1.9.2, and the default in 1.9.3), you might get an error message. Read this issue.

Gem dependency issues

Metrical depends on a lot of other gems. This means that sometimes, when a new version of a gem is released, Rubygems will load the wrong version of the gem, that might be incompatible.

If you get a message like can't activate X, already activated Y, or something similar, use Bundler.

Development

Install dependencies:

gem install bundler && bundle install

Run the specs:

rspec

Changelog

Version 0.1.0:

  • Finally added tests and added metrical to Travis
  • Add option --no-open to stop it from opening in the browser
  • Automatically turn off RCov in Ruby 1.9.x
  • Depend on RCov 0.9, so installation will work under Ruby 1.9
  • Remove other dependencies, it looks like MetricFu has that covered now.
  • Automatically turn off Saikuro on Ruby 1.9.x
  • Add switches for every metric (run metrical --help to see them all)

Copyright 2010-2011, Iain Hecker - Released under the MIT License.

metrical's People

Contributors

faisal avatar iain avatar mvz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

metrical's Issues

ERROR: While executing gem ... (Gem::DependencyError)

When installing the latest metrical version, I'm getting this error:

$ gem install metrical
ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: metric_fu requires chronic (~> 0.3.0);
    churn requires chronic (>= 0.2.3), map (= 4.3.0), chronic (>= 0.2.3);
    main requires chronic (>= 0.6.2), map (>= 5.1.0)
$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

$ gem list
*** LOCAL GEMS ***

bundler (1.0.22)

$

Problem in ruby 1.9.2

I get following error when i try to run metrical. I don't know if its flog problem in ruby 1.9.2.

/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/racc/parser.rb:349:in `on_error':  (Racc::ParseError)
parse error on value ")" (tRPAREN)
    from /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/racc/parser.rb:99:in `_racc_do_parse_c'
    from /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/racc/parser.rb:99:in `do_parse'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/ruby_parser-2.0.5/lib/ruby_parser_extras.rb:749:in `process'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/flog-2.5.0/lib/flog.rb:241:in `block in flog'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/flog-2.5.0/lib/flog.rb:235:in `each'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/flog-2.5.0/lib/flog.rb:235:in `flog'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metric_fu-2.0.1/lib/generators/flog.rb:20:in `emit'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metric_fu-2.0.1/lib/base/generator.rb:126:in `block in generate_report'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metric_fu-2.0.1/lib/base/generator.rb:124:in `each'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metric_fu-2.0.1/lib/base/generator.rb:124:in `generate_report'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metric_fu-2.0.1/lib/base/generator.rb:52:in `generate_report'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metric_fu-2.0.1/lib/base/report.rb:54:in `add'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metrical-0.0.4/bin/metrical:34:in `block in <top (required)>'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metrical-0.0.4/bin/metrical:34:in `each'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/gems/metrical-0.0.4/bin/metrical:34:in `<top (required)>'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/bin/metrical:19:in `load'
    from /Users/me/.rvm/gems/ruby-1.9.2-p180/bin/metrical:19:in `<main>'

Chronic dependency

Hi,

I am getting the following error when I try to run the metrical gem

braga@braga-laptop:~/prj/dummy_app$ metrical
/usr/local/lib/site_ruby/1.8/rubygems.rb:242:in activate': can't activate chronic (~> 0.6.2, runtime) for ["main-4.7.3", "churn-0.0.13", "metric_fu-2.1.1", "metrical-0.0.6"], already activated chronic-0.3.0 for ["metric_fu-2.1.1", "metrical-0.0.6"] (Gem::LoadError) from /usr/local/lib/site_ruby/1.8/rubygems.rb:258:inactivate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:in each' from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:inactivate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:258:in activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:ineach'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:in activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:258:inactivate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:in each' from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:inactivate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:258:in activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:ineach'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:257:in activate' from /usr/local/lib/site_ruby/1.8/rubygems.rb:1146:ingem'
from /usr/bin/metrical:18

The Rails Version I am using is 2.3.14 and the Ruby version is 1.8.7

I read through a bunch of posts regarding metric_fu and metrical and many places I am seeing this dependency problem. Some of the blog posts say that they were resolved. But then they have become old enough and the dependent gems have updated themselves making the above error to appear again.

Can somone tell me how to resolve this error?

Thanks

Running metrical with rubygems-bundler

When using rubygems-bundler, all the gem binstubs get a "bundle exec" wrapper, which causes Metrical to not work.

The solution is to add this line to your .bash_profile and gem regenerate_binstubs.

export BUNDLER_BLACKLIST="metrical churn flay reek roodi rcov saikuro rails_best_practices"

Metrical won't install on ruby 1.9, because of rcov dependency.

The current version of rcov, 1.0.0, will not install on Ruby 1.9. I had to explicitly install the previous version, 0.9.11, then I could install metrical without error.

$ gem install metrical
Building native extensions.  This could take a while...
ERROR:  Error installing metrical:
    ERROR: Failed to build gem native extension.

        $USER/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
**** Ruby 1.9 is not supported. Please switch to simplecov ****


Gem files will remain installed in $USER/.rvm/gems/ruby-1.9.2-p290@/gems/rcov-1.0.0 for inspection.
Results logged to $USER/.rvm/gems/ruby-1.9.2-p290@/gems/rcov-1.0.0/ext/rcovrt/gem_make.out

Workaround:

$ gem install rcov --version 0.9.11
Building native extensions.  This could take a while...
WARNING: rcov-0.9.11 has an invalid nil value for @cert_chain
Successfully installed rcov-0.9.11
1 gem installed
Installing ri documentation for rcov-0.9.11...
Installing RDoc documentation for rcov-0.9.11...

$ gem install metrical
WARNING: Saikuro-1.1.0 has an invalid nil value for @cert_chain
Building native extensions.  This could take a while...
Successfully installed chronic-0.3.0
Successfully installed Saikuro-1.1.0
Successfully installed syntax-1.0.0
Successfully installed hirb-0.5.0
Successfully installed git-1.2.5
Successfully installed jeweler-1.6.4
Successfully installed json-1.6.1
Successfully installed json_pure-1.6.5
8 gems installed
Installing ri documentation for chronic-0.3.0...
Installing ri documentation for Saikuro-1.1.0...
Installing ri documentation for syntax-1.0.0...
Installing ri documentation for hirb-0.5.0...
Installing ri documentation for git-1.2.5...
Installing ri documentation for jeweler-1.6.4...
Installing ri documentation for json-1.6.1...
Installing ri documentation for json_pure-1.6.5...
Installing RDoc documentation for chronic-0.3.0...
Installing RDoc documentation for Saikuro-1.1.0...
Installing RDoc documentation for syntax-1.0.0...
Installing RDoc documentation for hirb-0.5.0...
Installing RDoc documentation for git-1.2.5...
Installing RDoc documentation for jeweler-1.6.4...
Installing RDoc documentation for json-1.6.1...
Installing RDoc documentation for json_pure-1.6.5...

depends on ripper gem

Apparently Metrical depends on the ripper gem but it's not in the dependencies. I had to install it manually.

Incompatible churn ruby_parser

Thanks for metrical. Here's an error message I'm getting because metrical requires metric_fu, requires churn, requires an incompatible version of ruby_parser.

I've opened this issue with the churn author. Thanks, Joel ([email protected])

Bundler could not find compatible versions for gem "ruby_parser":
In Gemfile:
metrical depends on
ruby_parser (~> 2.0.4)

ruby_parser (2.3.0)

Making Metrical Run with 1.9 - Practical Approach

Hi, I just tried out metrical and think its great. Thinking of changing it to run with 1.9 source code - in fact I already did a nasty hack running all .rb files through a gsub that replaces 1.9 with 1.8 hash syntax and tada all metrics are generated.
(see https://github.com/bkleinen/hash-reverter - three files to put in an rails app - still rather rough, if it's going to stick has to be converted to a gem).

Thus my approach would be to include that to metrical, split up the metric tools into those that do support 1.9 and those which don't , and run everything in two passes, and migrate them to 1.9 one by one.

As finally the ruby_parser seems to get updated to support 1.9 hashes in version 3, I hope that it will become easier upgrading the tools, too.

I've forked metrical, https://github.com/bkleinen/metrical , but not yet sure if I will be able to maintain it, but I'm looking into that.

Any comments on my approach welcomed.

uninitialized constant ActiveSupport::Dependencies::Mutex

I've installed metrical (0.0.4)

$ ruby script/about
About your application's environment
Ruby version 1.8.7 (i686-darwin10.3.0)
RubyGems version 1.6.2
Rack version 1.1
Rails version 2.3.8

OSX 10.6.6

when I run metrical I get [1]

I had to add:
require 'thread'
to the rails app to solve a known issue between rails 2.3.8 and ruby gems 1.6

[1]
/Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/gems/rake-0.8.7/lib/rake.rb:2503:in const_missing': uninitialized constant ActiveSupport::Dependencies::Mutex (NameError) from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:55 from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require' from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/gems/activesupport-2.3.8/lib/active_support.rb:57 from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require' from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/gems/activesupport-2.3.8/lib/activesupport.rb:1 from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require' from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/gems/metric_fu-2.0.1/lib/metric_fu.rb:7 from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:ingem_original_require'
from /Users/enrico/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in require' from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/gems/metrical-0.0.4/bin/metrical:4 from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/bin/metrical:19:inload'
from /Users/enrico/.rvm/gems/ruby-1.8.7-p249@reachout/bin/metrical:19

Dependency Issue when installing

Churn is a culprit here. That won't install stand alone.

ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: churn requires chronic (>= 0.2.3), map (= 4.3.0), chronic (>= 0.2.3); main requires chronic (>= 0.6.2), map (>= 5.1.0); metric_fu requires chronic (~> 0.3.0)

ruby -v : ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

Gem List:

abstract (1.0.0)
actionmailer (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
actionpack (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
activemodel (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
activerecord (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
activeresource (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
activesupport (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
addressable (2.2.7)
arel (3.0.2, 2.2.3, 2.2.2, 2.2.1, 2.0.10, 2.0.9)
bcrypt-ruby (3.0.1, 2.1.4, 2.1.3)
builder (3.0.0, 2.1.2)
bundler (1.0.21)
cancan (1.6.7, 1.6.4, 1.5.0)
capistrano (2.9.0)
capybara (1.1.2)
capybara-webkit (0.11.0)
childprocess (0.3.1)
coffee-rails (3.2.2, 3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.2.0)
database_cleaner (0.7.2)
devise (2.0.4, 2.0.0, 1.3.4, 1.2.1, 1.1.5)
devise_invitable (1.0.0, 0.5.0, 0.3.5)
erubis (2.7.0, 2.6.6)
exception_notifier (1.0.0)
execjs (1.3.0)
ffi (1.0.11)
hashie (1.2.0)
highline (1.6.11, 1.6.9, 1.6.1)
hike (1.2.1)
hpricot (0.8.6)
i18n (0.6.0, 0.5.0)
journey (1.0.3, 1.0.2)
jquery-rails (2.0.0, 1.0.19)
json (1.6.5, 1.6.4)
libwebsocket (0.1.3)
mail (2.4.1, 2.3.0, 2.2.19, 2.2.15)
meta_search (1.0.6)
mime-types (1.18, 1.17.2, 1.16)
mini_fb (1.1.7)
multi_json (1.1.0, 1.0.4)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.3.0, 2.2.1)
net-ssh-gateway (1.1.0)
nokogiri (1.5.2)
oauth (0.4.5)
orm_adapter (0.0.6, 0.0.4)
paperclip (2.3.6)
pjax_rails (0.1.10)
polyglot (0.3.3, 0.3.1)
rack (1.4.1, 1.3.6, 1.2.5, 1.2.4, 1.2.2)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-pjax (0.5.7)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
railties (3.2.1, 3.2.0, 3.1.3, 3.0.10, 3.0.9, 3.0.5)
rake (0.9.2.2, 0.8.7)
rdoc (3.12)
rest-client (1.6.7)
rmagick (2.13.1)
rubygems-update (1.8.15)
rubyzip (0.9.7)
sass (3.1.15)
sass-rails (3.2.4, 3.1.5)
selenium-webdriver (2.20.0)
simplecov (0.6.1, 0.5.4, 0.4.1)
simplecov-html (0.5.3, 0.4.3)
sitemap_generator (3.0.0, 1.3.8)
sprockets (2.1.2, 2.0.3)
sqlite3 (1.3.5, 1.3.4, 1.3.3)
sqlite3-ruby (1.3.3, 1.3.2)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10, 1.4.9)
twitter_oauth (0.4.3)
tzinfo (0.3.32, 0.3.31, 0.3.25)
uglifier (1.2.3)
warden (1.1.1, 1.0.6, 1.0.3)
xpath (0.1.4)

It isn't working with rvm 1.9.2

metrical
ERROR! Aborting. You may want to run with --continue.
/Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/racc/parser.rb:349:in on_error': (Racc::ParseError) parse error on value "." (tDOT) from /Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/racc/parser.rb:99:in_racc_do_parse_c'
from /Users/max/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/racc/parser.rb:99:in do_parse' from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/ruby_parser-2.0.6/lib/ruby_parser_extras.rb:749:inprocess'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/flog-2.5.1/lib/flog.rb:241:in block in flog' from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/flog-2.5.1/lib/flog.rb:235:ineach'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/flog-2.5.1/lib/flog.rb:235:in flog' from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metric_fu-2.1.1/lib/generators/flog.rb:20:inemit'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metric_fu-2.1.1/lib/base/generator.rb:130:in block in generate_report' from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metric_fu-2.1.1/lib/base/generator.rb:128:ineach'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metric_fu-2.1.1/lib/base/generator.rb:128:in generate_report' from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metric_fu-2.1.1/lib/base/report.rb:60:inadd'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metrical-0.0.5/bin/metrical:34:in block in <top (required)>' from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metrical-0.0.5/bin/metrical:34:ineach'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/gems/metrical-0.0.5/bin/metrical:34:in <top (required)>' from /Users/max/.rvm/gems/ruby-1.9.2-p0/bin/metrical:19:inload'
from /Users/max/.rvm/gems/ruby-1.9.2-p0/bin/metrical:19:in `

'

Dependency issue with ruby_parser

can't activate ruby_parser (~> 2.0.4, runtime) for ["churn-0.0.13", "metric_fu-2.1.1", "metrical-0.0.7"], already activated ruby_parser-2.3.1 for "flay-1.4.2", "metric_fu-2.1.1", "metrical-0.0.7"

Unable to resolve dependencies: metrical requires main (~> 4.6.0)

With ruby 1.9.3, when trying to install metrical:

$ gem install metrical
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: metrical requires main (> 4.6.0); metric_fu requires chronic (> 0.3.0); churn requires chronic (= 0.6.4), main (= 4.7.7), main (>= 0), chronic (>= 0.2.3)

Roodi vs. Psych - solved.

Re:

"If you're running Ruby 1.9 with Psych as your default YAML parser (possible in 1.9.2, and the default in 1.9.3), you might get an error message. I have no clue what to do about it. Some help on this would be greatly appreciated."

The problem is with the roodi.yml file (https://github.com/martinjandrews/roodi/blob/master/roodi.yml), see this ignored pull request: roodi/roodi#9. I've applied the change to my roodi.yml file and roodi now runs fine.

It looks like the roodi gem has is not being maintained. One solution is to edit the yml file manually (what i did), the other is to publish a fixed version of the gem so the metric_fu gemspec can reference the fixed published gem.

It could be helpful to add the link to the fixed rood.yml file and pull request on the readme.

I hope this saves someone else some time.
Cam

ruby_parser parsing error with block comments

Hi,

I run on:

ruby 1.8.7
rails 3.0.3
metrical 0.0.4
metric_fu 2.0.1
ruby_parser 2.0.6

In my code I have a comment block, like

=begin
  This will crash
=end

The block causes the command 'metrical' to produce an error:

from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:227:in `load_dependency'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/engine.rb:201
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/engine.rb:200:in `each'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/engine.rb:200
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/application.rb:77:in `send'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /Users/Clint/work/projects/customer/test/config/environment.rb:5
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /Users/Clint/work/projects/customer/test/config.ru:3
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /Users/Clint/.rvm/gems/ruby-1.8.7-p302@test/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /Users/Clint/work/projects/customer/test/config.ru:1:in `new'
from /Users/Clint/work/projects/customer/test/config.ru:1test

changing the above comment block to

#=begin
# This will not crash
#=end

"fixes" the parser error.

invalid multibyte escape when installing in ruby 1.9.3

I added metrical in my gemfile
gem 'metrical', :require => false
bundle install
bundle exec metrical gave the following error

.rvm/gems/ruby-1.9.3-p374/gems/ruby_parser-2.3.1/lib/ruby_parser_extras.rb:612:in `initialize': invalid multibyte escape: /[\x80-\xff]/ (RegexpError)

rails version : 3.2.9
ruby version : 1.9.3

What should i change to run metrical successfully.?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.