public
Description: Lint for Ruby
Homepage: http://github.com/kevinclark/dust/wikis
Clone URL: git://github.com/kevinclark/dust.git
Click here to lend your support to: dust and make a donation at www.pledgie.com !
dust /
name age message
file Dusters Tue Jun 03 12:47:11 -0700 2008 Add new Duster ideas [kevinclark]
file LICENSE Mon Jun 02 16:55:09 -0700 2008 Add MIT License [kevinclark]
file README Wed Sep 17 10:35:18 -0700 2008 Update README to point to wiki [kevinclark]
file Rakefile Sun Sep 14 15:23:06 -0700 2008 Swap Rake in for Thor. Clean up a forgotten puts. [kevinclark]
directory lib/ Wed Sep 17 10:24:41 -0700 2008 Add variable shadowing detection to LocalVariab... [kevinclark]
directory spec/ Wed Sep 17 10:24:41 -0700 2008 Add variable shadowing detection to LocalVariab... [kevinclark]
README
Ruby lint. Sorta.

http://github.com/kevinclark/dust/wikis

## Examples
require 'lib/dust'

# Detect unused variabls
def unused_lvar
  a = 1
  1 + 2
end

d = Dust::LocalVariableDuster.new(Object, :unused_lvar)
d.dust!
d.warnings # => [#<Dust::Warnings::UnusedVariable:0x86970 @variable=:a>]

# Catch yield's without a check for block_given?
def no_conditional_for_block_given
  yield
end

d = Dust::BlockDuster.new(Object, :no_conditional_for_block_given)
d.dust!
d.warnings # => [#<Dust::Warnings::UnprotectedBlock:0x614dd8 @yes_branch=nil, @condition=nil, @no_branch=nil>]

# Find useless branches
def silly_if_else
  1 == 2 ? true : false
end

d = Dust::BranchDuster.new(Object, :silly_if_else)
d.dust!
d.warnings # => [#<Dust::Warnings::UselessBranch:0x5f80e8 @yes_branch=s(:true), @no_branch=s(:false)>]