Sha256: 83b1b8ca836f38fb973244b33b807b6e84c186ae21e502ee6d2b991bae195307

Contents?: true

Size: 666 Bytes

Versions: 3

Compression:

Stored size: 666 Bytes

Contents

require 'processing/all'


module Processing
  WINDOW  = Processing::Window.new {start}
  CONTEXT = Processing::Context.new WINDOW

  refine Object do
    (CONTEXT.methods - Object.instance_methods).each do |method|
      define_method method do |*args, **kwargs, &block|
        CONTEXT.__send__ method, *args, **kwargs, &block
      end
    end
  end
end# Processing


begin
  w, c = Processing::WINDOW, Processing::CONTEXT

  c.class.constants.each do |const|
    self.class.const_set const, c.class.const_get(const)
  end

  w.__send__ :begin_draw
  at_exit do
    w.__send__ :end_draw
    Processing::App.new {w.show}.start if c.hasDrawBlock__ && !$!
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
processing-0.5.2 lib/processing.rb
processing-0.5.1 lib/processing.rb
processing-0.5.0 lib/processing.rb