Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Eric Allam
committed
May 26, 2011
0 parents
commit 645bb08
Showing
38 changed files
with
2,337 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
*.gem | ||
.bundle | ||
Gemfile.lock | ||
pkg/* | ||
.rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source "http://rubygems.org" | ||
|
||
# Specify your gem's dependencies in ruby_cop.gemspec | ||
gemspec |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module RubyCop | ||
# Your code goes here... | ||
end | ||
|
||
require 'ripper' | ||
|
||
require 'ruby_cop/ruby' | ||
require 'ruby_cop/node_builder' | ||
require 'ruby_cop/gray_list' | ||
require 'ruby_cop/policy' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'set' | ||
|
||
module RubyCop | ||
# Combination blacklist and whitelist. | ||
class GrayList | ||
def initialize | ||
@blacklist = Set.new | ||
@whitelist = Set.new | ||
end | ||
|
||
# An item is allowed if it's whitelisted, or if it's not blacklisted. | ||
def allow?(item) | ||
@whitelist.include?(item) || !@blacklist.include?(item) | ||
end | ||
|
||
def blacklist(item) | ||
@whitelist.delete(item) | ||
@blacklist.add(item) | ||
end | ||
|
||
def whitelist(item) | ||
@blacklist.delete(item) | ||
@whitelist.add(item) | ||
end | ||
end | ||
end |
Oops, something went wrong.