Created
March 14, 2009 10:35
-
-
Save davidlee/79041 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
#!/usr/bin/env ruby | |
# bin/console.rb | |
# a nice little ruby console for your Sinatra app | |
ENV["RACK_ENV"] ||= ( ARGV[0] || 'development' ) | |
this_file = File.expand_path( __FILE__ ) | |
app_file = File.expand_path( File.join( File.dirname( __FILE__), '../app' )) | |
cmd = "irb -r #{ this_file } -r irb/completion --simple-prompt" | |
if __FILE__ == $0 | |
system( cmd ) | |
else | |
require app_file | |
@app = App.new | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment