Created
December 4, 2012 17:34
-
-
Save jeremy/4206626 to your computer and use it in GitHub Desktop.
irb rake
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/railties/lib/rails/console/helpers.rb b/railties/lib/rails/console/helpers.rb | |
index 230d3d9..1bbdfd2 100644 | |
--- a/railties/lib/rails/console/helpers.rb | |
+++ b/railties/lib/rails/console/helpers.rb | |
@@ -7,5 +7,16 @@ module Rails | |
def controller | |
@controller ||= ApplicationController.new | |
end | |
+ | |
+ def rake(task) | |
+ pid = Kernel.fork do | |
+ require 'rake' | |
+ include Rake::DSL | |
+ load Rails.root.join('Rakefile') | |
+ Rake::Task[task].invoke | |
+ Kernel.exit | |
+ end | |
+ Process.wait pid | |
+ end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment