Mago

Tool to detect magic numbers in ruby code.

Installation

gem install mago

Usage

Detect magic numbers in particular ruby file:

mago ./path/to/file.rb

In all ruby files of directory:

mago ./path/to/project/

Example

P = 3.14

radius = 5
square = P * radius ** 2
mago ./square.rb
./square.rb:3 detected magic number 5
./square.rb:4 detected magic number 2

Copyright (c) 2013 Sergey Potapov. See LICENSE.txt for further details.