Skip to content

Instantly share code, notes, and snippets.

@monkstone
Last active June 12, 2017 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monkstone/99d1111b4d77821406be83664cc583e9 to your computer and use it in GitHub Desktop.
Save monkstone/99d1111b4d77821406be83664cc583e9 to your computer and use it in GitHub Desktop.
require 'propane'
class MyApp < Propane::App
def self.code
@code
end
def self.path
@path
end
def settings
size 100, 100
end
def self.run(code = '', path)
@code = code
@path = path
obj = MyApp.new
obj.synchronized do
obj.wait 1000
end
puts 'after app'
end
def setup
#exit
no_loop
end
def draw
puts "running code: #{MyApp.code}"
eval MyApp.code
puts "saving to #{MyApp.path}"
save_frame MyApp.path
puts "file exists in draw: #{File.exists?(MyApp.path)}"
end
end
code = ARGV[0]
path = "/tmp/#{Time.now.strftime("%Y%d%m_%H%M%S")}.jpg"
begin
MyApp.run code,path
rescue Exception => e
puts "it never lands HERE: #{e}"
end
puts "file exists in main loop: #{File.exists?(path)}"
exit 38,0-1 Bot
7,0-1 Top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment