Skip to content

Instantly share code, notes, and snippets.

@jtoy

jtoy/propane cli Secret

Created June 9, 2017 17:17
Show Gist options
  • Save jtoy/94a8b95b5b65552f6bdbed98fda8b355 to your computer and use it in GitHub Desktop.
Save jtoy/94a8b95b5b65552f6bdbed98fda8b355 to your computer and use it in GitHub Desktop.
require 'propane'
class MyApp < Propane::App
def self.run code,path
@@code = code
@@path = path
MyApp.new
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