lib/flok/user_compiler.rb in flok-0.0.79 vs lib/flok/user_compiler.rb in flok-0.0.80
- old
+ new
@@ -492,30 +492,27 @@
end
end
class UserCompilerAction
- attr_accessor :controller, :name, :ons, :every_handlers, :on_entry_has_goto
+ attr_accessor :controller, :name, :ons, :every_handlers
include UserCompilerMacro
def initialize controller, name, ctx, &block
@controller = controller
@name = name
@ctx = ctx
@_on_entry_src = ""
@ons = [] #Event handlers
@every_handlers = []
- @on_entry_has_goto = false
self.instance_eval(&block)
end
def on_entry js_src
#returns a string
@_on_entry_src = _macro(js_src)
-
- @on_entry_has_goto = (js_src =~ /Goto/) != nil
end
def on_entry_src
return @_on_entry_src
end
@@ -583,11 +580,9 @@
@_on_entry = _macro(str)
end
def choose_action &block
@ctx.action self, :choose_action, &block
-
- raise "choose_action must contain Goto" unless @ctx.actions.detect{|e| e.name == :choose_action}.on_entry_has_goto
end
#Names of spots
def spots *spots
@spots += spots