Browse files

Added script/console command.

  • Loading branch information...
1 parent e1a25bf commit a5abed7abdfa9ba453c329b5f4dd186913f11e7f @nelstrom committed Jul 25, 2009
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 retweet console interface."
+exec command

0 comments on commit a5abed7

Please sign in to comment.