Skip to content

Instantly share code, notes, and snippets.

@monkstone
Created June 9, 2017 18:23
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/9780d9e148a459e58f5469ec6495ba2f to your computer and use it in GitHub Desktop.
Save monkstone/9780d9e148a459e58f5469ec6495ba2f to your computer and use it in GitHub Desktop.
Code
#!/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