Permalink
Browse files

Modulize Rails console methods so that other console libraries such a…

…s Pry can include these methods
  • Loading branch information...
1 parent 7102a3d commit 6d09f275c6e3224a8ea9a738512c90ee5334e20d @amatsuda amatsuda committed Nov 9, 2011
@@ -205,6 +205,8 @@ def initialize_console
require "pp"
require "rails/console/app"
require "rails/console/helpers"
+
+ IRB::ExtendCommandBundle.send :include, Rails::ConsoleMethods
end
end
end
@@ -5,8 +5,8 @@
# work around the at_exit hook in test/unit, which kills IRB
Test::Unit.run = true if Test::Unit.respond_to?(:run=)
-module IRB
- module ExtendCommandBundle
+module Rails
+ module ConsoleMethods
# reference the global "app" instance, created on demand. To recreate the
# instance, pass a non-false value as the parameter.
def app(create=false)
@@ -1,5 +1,5 @@
-module IRB
- module ExtendCommandBundle
+module Rails
+ module ConsoleMethods
def helper
@helper ||= ApplicationController.helpers
end
@@ -19,7 +19,7 @@ def load_environment(sandbox = false)
end
def irb_context
- Object.new.extend(IRB::ExtendCommandBundle)
+ Object.new.extend(Rails::ConsoleMethods)
end
def test_app_method_should_return_integration_session

0 comments on commit 6d09f27

Please sign in to comment.