Permalink
Browse files

added a console 'binary' to mimic Rails' console

  • Loading branch information...
1 parent a69ca54 commit a40a1a510c2f3206f5de900723a53e9b217873a5 @mattetti committed Apr 10, 2012
Showing with 25 additions and 3 deletions.
  1. +6 −3 Gemfile.lock
  2. +5 −0 bin/console
  3. +14 −0 lib/bootloader.rb
View
@@ -14,6 +14,7 @@ GEM
multi_json (~> 1.0)
addressable (2.2.7)
arel (2.2.3)
+ backports (2.3.0)
builder (3.0.0)
ffi (1.0.11)
foreman (0.41.0)
@@ -29,11 +30,11 @@ GEM
puma
rb-inotify
i18n (0.6.0)
+ json (1.6.6)
launchy (2.1.0)
addressable (~> 2.2.6)
libnotify (0.7.2)
- ffi (~> 1.0.0)
- minitest (1.6.0)
+ minitest (2.12.0)
multi_json (1.2.0)
mysql2 (0.3.11)
puma (1.1.1)
@@ -52,17 +53,19 @@ GEM
tilt (~> 1.3, >= 1.3.3)
thor (0.14.6)
tilt (1.3.3)
- tzinfo (0.3.32)
+ tzinfo (0.3.33)
weasel_diesel (1.0.0)
PLATFORMS
ruby
DEPENDENCIES
activerecord (= 3.1.3)
+ backports (= 2.3.0)
foreman
guard-minitest
guard-puma
+ json
launchy
minitest
mysql2 (= 0.3.11)
View
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+require 'irb'
+require File.expand_path('../lib/bootloader', File.dirname(__FILE__))
+Bootloader.console
+IRB.start(__FILE__)
View
@@ -28,6 +28,20 @@ def start
end
end
+ # Boot in console mode
+ def console
+ unless @booted
+ set_env
+ load_environment
+ set_loadpath
+ load_lib_dependencies
+ set_db_connection
+ connect_to_db
+ load_models unless ENV['DONT_CONNECT']
+ @booted = true
+ end
+ end
+
def root_path
ROOT
end

0 comments on commit a40a1a5

Please sign in to comment.