def initialize (context)
(context['use_ruby_treechecker'] == false) and return
require 'rufus/treechecker'
@checker = Rufus::TreeChecker.new do
exclude_fvccall :abort, :exit, :exit!
exclude_fvccall :system, :fork, :syscall, :trap, :require, :load
exclude_fvcall :private, :public, :protected
exclude_eval
exclude_backquotes
exclude_alias
exclude_global_vars
exclude_module_tinkering
exclude_raise
exclude_rebinding Kernel
exclude_access_to(
IO, File, FileUtils, Process, Signal, Thread, ThreadGroup)
exclude_call_to :instance_variable_get, :instance_variable_set
end
@cchecker = @checker.clone
@cchecker.add_rules do
at_root do
exclude_head [ :block ]
exclude_head [ :lasgn ]
end
end
@checker.freeze
@cchecker.freeze
freeze
end