lib/qed/script.rb in qed-2.2.0 vs lib/qed/script.rb in qed-2.2.1

- old
+ new

@@ -38,10 +38,15 @@ def advice #@scope.__advice__ @applique.__advice__ end + # + def advise(signal, *args) + advice.call(@scope, signal, *args) + end + # Expanded dirname of +file+. def directory @directory ||= File.expand_path(File.dirname(file)) end @@ -49,10 +54,16 @@ def name @name ||= File.basename(file).chomp(File.extname(file)) end # + def evaluate(code, line) + eval(code, @binding, @file, line) + #@scope.module_eval(section.text, @file, section.line) + end + + # #def source # @source ||= ( # #case file # #when /^http/ # # ext = File.extname(file).sub('.','') @@ -61,9 +72,11 @@ # File.read(file) # #end # ) #end + # Parse script. + # Retruns an abstract syntax tree. def parse Parser.new(file).parse end #