Permalink
Browse files

basic working binary

  • Loading branch information...
bglusman
bglusman committed Jan 24, 2012
1 parent 93a5c7f commit e42b944898ce7290a940d45d02a250182959c55a
Showing with 19 additions and 24 deletions.
  1. +6 −0 bin/outlaw
  2. +5 −0 config.outlaw
  3. +8 −8 lib/outlaw.rb
  4. +0 −16 outlawed.rb
View
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
require_relative "../lib/outlaw"
load "config.outlaw"
puts Outlaw.enforce(".")
View
@@ -0,0 +1,5 @@
outlaw "@@", "class variables are evil"
outlaw "protected", "use private or public, protected is silly in ruby"
outlaw "module :token end", "nest modules to avoid empty module declarations"
outlaw "eval", "never eval, rarely class_eval or instance_eval, but never eval"
outlaw "class :symbol < :core_class", "core classes implemented in c, can cause bad mojo"
View
@@ -2,21 +2,21 @@
require_relative 'outlaw/law_dsl'
require_relative 'outlaw/enforcement'
require_relative 'outlaw/rule'
module Outlaw
def self.outlaw(restriction, message)
law = LawDSL.parse(restriction, message)
Enforcement.add(law)
end
def outlaw(restriction, message)
law = Outlaw::LawDSL.parse(restriction, message)
Outlaw::Enforcement.add(law)
end
module Outlaw
def self.enforce(dir=".")
Enforcement.process_directory(dir)
Outlaw::Enforcement.process_directory(dir)
end
PARAM_TYPES = [:on_const, :on_ident, :on_ivar, :on_cvar]
IGNORE_TYPES = [:on_sp, :on_nl, :on_ignored_nl, :on_rparen, :on_lparen]
SPECIAL_CASES = [:disjoint_code_seperator] #need to work on naming here
CORE_CLASS = []
File.open('core_classes.txt') {|io| io.each_line {|line| CORE_CLASS << line.chomp}}
#DEFINED_COLLECTIONS = [CORE_CLASS] # planned to use, but unneeded for now
end
end
View

This file was deleted.

Oops, something went wrong.

0 comments on commit e42b944

Please sign in to comment.