Skip to content

Instantly share code, notes, and snippets.

@kplawver
Created November 3, 2009 16:10
Show Gist options
  • Save kplawver/225157 to your computer and use it in GitHub Desktop.
Save kplawver/225157 to your computer and use it in GitHub Desktop.
I needed a script/runner equivalent for Sinatra. This works pretty well so far.
#!/usr/bin/env ruby
# If you want to run it on a specific environment, set your RACK_ENV environment variable.
require 'rubygems'
require File.expand_path("../app",__FILE__)
# puts ARGV.options.inspect
if ARGV[0].length > 0 && ARGV[0].is_a?(String)
puts eval(ARGV[0])
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment