module Kernel
Override for Kernel#eval
and Kernel.eval
Public Class Methods
load(file, wrap = false)
click to toggle source
# File lib/live_ast/replace_load.rb, line 8 def load(file, wrap = false) LiveAST.load(file, wrap) end
Also aliased as: live_ast_original_load
Public Instance Methods
eval(*args)
click to toggle source
# File lib/live_ast/replace_eval.rb, line 56 def eval(*args) LiveAST::Common.check_arity(args, 1..4) LiveAST.eval( args[0], args[1] || Binding.of_caller(1), *LiveAST::Common.location_for_eval(*args[1..3])) end
Also aliased as: live_ast_original_eval
Private Instance Methods
ast_eval(*args)
click to toggle source
The same as eval
except that the binding argument is required and AST-accessible objects are created.
# File lib/live_ast/ast_eval.rb, line 10 def ast_eval(*args) LiveAST::Evaler.eval(args[0], *args) end
ast_load(file, wrap = false)
click to toggle source
For use in noninvasive mode (require 'live_ast/base'
).
Same behavior as the built-in load
except that AST-accessible objects are created.
# File lib/live_ast/ast_load.rb, line 14 def ast_load(file, wrap = false) LiveAST::Loader.load(file, wrap) end
caller(*args)
click to toggle source
# File lib/live_ast/replace_caller.rb, line 9 def caller(*args) c = live_ast_original_caller(*args) c.shift c.map { |line| LiveAST.strip_token line } end
Also aliased as: live_ast_original_caller
load(file, wrap = false)
click to toggle source
# File lib/live_ast/replace_load.rb, line 8 def load(file, wrap = false) LiveAST.load(file, wrap) end
Also aliased as: live_ast_original_load
raise(*args)
click to toggle source
# File lib/live_ast/replace_raise.rb, line 10 def raise(*args) ex = begin live_ast_original_raise(*args) rescue Exception => e e end ex.backtrace.reject! { |line| line.index __FILE__ } ex.backtrace.map! { |line| LiveAST.strip_token line } live_ast_original_raise ex end
Also aliased as: live_ast_original_raise