Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create a console for the environment.

  • Loading branch information...
commit 39f007410427ac6714426d79e7bc483e7630b125 1 parent 96b98a6
@nelstrom authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 script/console
View
16 script/console
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.