diff options
author | José Valim <jose.valim@gmail.com> | 2012-05-29 08:48:00 -0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-05-29 08:48:00 -0700 |
commit | 9fa3926e4fd1c3c24a9ecc613b98cde6609f2975 (patch) | |
tree | 8333b39bc6618a209c462a53c7286f8a5bcf0da5 /railties/lib/rails/railtie.rb | |
parent | d46a36805b93478f39039f4cab006f0aabd4cfd0 (diff) | |
parent | c0ba0f01d05844bf3024d3926900706b270adf4d (diff) | |
download | rails-9fa3926e4fd1c3c24a9ecc613b98cde6609f2975.tar.gz rails-9fa3926e4fd1c3c24a9ecc613b98cde6609f2975.tar.bz2 rails-9fa3926e4fd1c3c24a9ecc613b98cde6609f2975.zip |
Merge pull request #6518 from kennyj/fix_5847-4
(Try again) Fix #5847 and #4045.
Diffstat (limited to 'railties/lib/rails/railtie.rb')
-rw-r--r-- | railties/lib/rails/railtie.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 2102f8a03c..c3cc65ab31 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -145,6 +145,12 @@ module Rails @load_console end + def runner(&blk) + @load_runner ||= [] + @load_runner << blk if blk + @load_runner + end + def generators(&blk) @generators ||= [] @generators << blk if blk @@ -179,6 +185,10 @@ module Rails self.class.console.each { |block| block.call(app) } end + def load_runner(app=self) + self.class.runner.each { |block| block.call(app) } + end + def load_tasks(app=self) extend Rake::DSL if defined? Rake::DSL self.class.rake_tasks.each { |block| self.instance_exec(app, &block) } |