Permalink
Browse files

add console

  • Loading branch information...
1 parent 2fa1bf4 commit 386856aab710e59532e68a53db9666dc3c914ca4 @zapnap committed Oct 17, 2009
Showing with 16 additions and 0 deletions.
  1. +16 −0 script/console
View
@@ -0,0 +1,16 @@
+#! /usr/bin/env ruby
+# This console script adapted from:rake
+# http://barkingiguana.com/blog/2009/01/25/scriptconsole-for-your-application/
+
+libs = []
+libs << "irb/completion"
+libs << File.dirname(__FILE__) + '/../environment.rb'
+
+command_line = []
+command_line << "irb"
+command_line << libs.inject("") { |acc, lib| acc + %( -r "#{lib}") }
+command_line << "--simple-prompt"
+command = command_line.join(" ")
+
+puts "Welcome to the sinatra console interface."
+exec command

0 comments on commit 386856a

Please sign in to comment.