Last active
June 12, 2017 16:19
-
-
Save monkstone/99d1111b4d77821406be83664cc583e9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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