aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/railtie.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-07-22 01:29:18 +0200
committerXavier Noria <fxn@hashref.com>2010-07-22 01:29:18 +0200
commit919eb200a9a0969c444b938d08eb4661d41ba986 (patch)
tree329cbe815d549275cc0dc6aa0f75c18d8954f105 /railties/lib/rails/railtie.rb
parent56669ec3048de316918ec5ad554fff83d757911b (diff)
parentb456877cfb7e0cb0bab9ffd5674abd23caba0ab4 (diff)
downloadrails-919eb200a9a0969c444b938d08eb4661d41ba986.tar.gz
rails-919eb200a9a0969c444b938d08eb4661d41ba986.tar.bz2
rails-919eb200a9a0969c444b938d08eb4661d41ba986.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'railties/lib/rails/railtie.rb')
-rw-r--r--railties/lib/rails/railtie.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb
index dbdbfea509..1d6a2de87d 100644
--- a/railties/lib/rails/railtie.rb
+++ b/railties/lib/rails/railtie.rb
@@ -156,6 +156,12 @@ module Rails
@rake_tasks
end
+ def console(&blk)
+ @load_console ||= []
+ @load_console << blk if blk
+ @load_console
+ end
+
def generators(&blk)
@generators ||= []
@generators << blk if blk
@@ -170,20 +176,16 @@ module Rails
def eager_load!
end
- def rake_tasks
- self.class.rake_tasks
- end
-
- def generators
- self.class.generators
+ def load_console
+ self.class.console.each(&:call)
end
def load_tasks
- rake_tasks.each { |blk| blk.call }
+ self.class.rake_tasks.each(&:call)
end
def load_generators
- generators.each { |blk| blk.call }
+ self.class.generators.each(&:call)
end
end
end