Created
June 9, 2017 18:23
-
-
Save monkstone/9780d9e148a459e58f5469ec6495ba2f to your computer and use it in GitHub Desktop.
Code
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
#!/usr/bin/env jruby | |
require 'propane' | |
class MyApp < Propane::App | |
def self.run code,path | |
@@code = code | |
@@path = path | |
MyApp.new | |
end | |
def settings | |
size 100, 100 | |
end | |
def setup | |
puts "running code: #{@@code}" | |
eval @@code | |
puts "saving to #{@@path}" | |
save @@path | |
exit | |
end | |
end | |
code = ARGV[0] | |
path = "/tmp/#{Time.now.to_i}_#{Random.new_seed}.jpg" | |
begin | |
MyApp.run code,path | |
rescue Exception => e | |
puts "it never lands HERE: #{e}" | |
end | |
puts path | |
puts File.exists?(path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment