Sha256: 5232f8359cb7dd882bd04ff8327b060220dfbb9cce52cd4e8afc5b52862bde24

Contents?: true

Size: 667 Bytes

Versions: 10

Compression:

Stored size: 667 Bytes

Contents

require 'rubysketch/all'


module RubySketch
  WINDOW  = RubySketch::Window.new {start}
  CONTEXT = RubySketch::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# RubySketch


begin
  w, c = RubySketch::WINDOW, RubySketch::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.hasUserBlocks__ && !$!
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubysketch-0.5.13 lib/rubysketch.rb
rubysketch-0.5.12 lib/rubysketch.rb
rubysketch-0.5.11 lib/rubysketch.rb
rubysketch-0.5.10 lib/rubysketch.rb
rubysketch-0.5.9 lib/rubysketch.rb
rubysketch-0.5.8 lib/rubysketch.rb
rubysketch-0.5.7 lib/rubysketch.rb
rubysketch-0.5.5 lib/rubysketch.rb
rubysketch-0.5.4 lib/rubysketch.rb
rubysketch-0.5.3 lib/rubysketch.rb