Sha256: fc2474862d4702660d4783e4e11d139e7266a3b27a8d280534bd3d457d61a4ee
Contents?: true
Size: 1.38 KB
Versions: 1
Compression:
Stored size: 1.38 KB
Contents
require 'vedeu/instrumentation' require 'vedeu/support/builder' require 'vedeu/support/events' require 'vedeu/support/geometry' require 'vedeu/support/menu' require 'vedeu/parsing/view' require 'vedeu/launcher' module Vedeu def self.debug? false end Vedeu::Instrumentation::Trace.call if debug? # :nocov: module ClassMethods def interface(name, &block) Builder.build(name, &block) end def event(name, &block) Vedeu.events.on(name, &block) end alias_method :on, :event def run(name, *args) Vedeu.events.trigger(name, *args) end alias_method :trigger, :run end def self.events @events ||= Events.new do on(:_exit_) { fail StopIteration } on(:_log_) { |message| Vedeu.log(message) } on(:_mode_switch_) { fail ModeSwitch } on(:_keypress_) do |key| trigger(:key, key) trigger(:_log_, (' ' * 42) + "key: #{key}") trigger(:_mode_switch_) if key == :escape end end end def self.log(message) Vedeu::Instrumentation::Log.logger.debug(message) end def self.error(exception) Vedeu::Instrumentation::Log.error(exception) end def self.included(receiver) receiver.send(:include, ClassMethods) receiver.extend(ClassMethods) end extend ClassMethods private def self.root_path File.expand_path('../..', __FILE__) end # :nocov: end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.1.1 | lib/vedeu.rb |