• This repository has been archived on 08/Jul/2020
  • Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    Ruby
  • Created over 14 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Run MetricFu without making it part of your projects depencies.

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.

More Repositories

1

http_accept_language

Ruby on Rails plugin. Fishes out the Accept-Language header into an array.
Ruby
771
star
2

fake_sqs

Provides a fake SQS server that you can run locally to test against
Ruby
292
star
3

roundsman

Combines Capistrano with Chef Solo
Ruby
204
star
4

elo

The Elo rating system is a method for calculating the relative skill levels of players in two-player games such as chess and Go.
Ruby
158
star
5

dotfiles

My bash / zsh / vim / pry settings
Vim Script
88
star
6

i18n_label

Adds translated form labels to Rails 2.2
Ruby
55
star
7

translatable_columns

Provides proxies for localized columns, depending on the locale set by I18n
Ruby
51
star
8

status_cats

Rack middleware replacing status codes with relevant pictures of cats.
Ruby
37
star
9

simple-backend-example

The source code for the article I wrote on Backends in Rails 3.1
Ruby
34
star
10

capistrano_chef_solo

Combining the awesome powers of Capistrano and chef-solo
Ruby
20
star
11

rack-token_auth

Rack middleware for using the Authorization header with token authentication
Ruby
14
star
12

formalize-rails

Use Formalize with the asset pipeline
Ruby
11
star
13

adventures-with-ruby

My own blog
Ruby
11
star
14

not

Syntactic sugar for negating any results: @foo.not.nil?
Ruby
10
star
15

no_value_helper

A simpel helper to display a nice message when there is no value
Ruby
6
star
16

scripted

A framework for organizing scripts
Ruby
6
star
17

spec_coverage

Ruby
6
star
18

basic_named_scopes

Basic named scopes for ActiveRecord makes all find-parameters a named scope
Ruby
5
star
19

model_based_html

Rails plugin for binding html to models
Ruby
4
star
20

root_table

Easy manageable root tables for Rails
Ruby
4
star
21

view

Displaying objects automatically
Ruby
4
star
22

coffee-machine

Some scripts I use for developing with CoffeeScript
Ruby
4
star
23

coffeescript-workshop

Examples and scripts for some workshops
Shell
4
star
24

rspec-smart-formatter

Chooses a formatter for best displaying purpose
Ruby
4
star
25

rule_table

A simple implementation of a rule table with lots of metaprogramming.
Ruby
4
star
26

faker

This fork is deleted soon
Ruby
4
star
27

stots

Ruby
3
star
28

fill

Fill your database, using rake db:seed
Ruby
3
star
29

i18n-airbrake

Ruby
3
star
30

rake_svn

Some handy svn commands for Rails
2
star
31

miniture-ninja

Experiments with WebGL
CoffeeScript
2
star
32

pillory

work in progress
Ruby
2
star
33

validate_database

Rails plugin that validates ActiveRecord according to the database
2
star
34

ubuntu_settings

Personal stuff with configuration, custom scripts and aliases for Ubuntu
Vim Script
2
star
35

capistrano-blaze

Ruby
2
star
36

tally

Simple Slack Bot, using AWS Lambda, SNS, SQS, API Gateway
Ruby
2
star
37

kingsofcode

2
star
38

iain.github.com

Github pages
2
star
39

heliosphere

Sunspot extras
Ruby
2
star
40

wodan

Ruby
1
star
41

opengl

A night of hacking OpenGL in Ruby
Ruby
1
star
42

adventure

Ruby
1
star
43

cramplire

Ruby
1
star
44

test_suite

Ruby
1
star
45

bearded-robot

Ruby
1
star
46

crockford

Crockford's Base32 (not the regular one), it switches out a couple letters to reduce chances of mistyping codes
Ruby
1
star
47

blaze

A tiny Campfire gem
Ruby
1
star
48

object_scoped_i18n

Translate using i18n and scope it according to the object's place in Ruby's hierarchial structure
Ruby
1
star