Permalink
Browse files

Create a console for the environment.

  • Loading branch information...
nelstrom committed Jan 27, 2011
1 parent 96b98a6 commit 39f007410427ac6714426d79e7bc483e7630b125
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 39f0074

Please sign in to comment.