diff options
author | Carl Lerche <carllerche@mac.com> | 2009-12-28 16:21:48 -0800 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2009-12-28 17:53:04 -0800 |
commit | c02f2782631a1893e2e880e3ccc65fb9a734567a (patch) | |
tree | 66eff8ee7fedc93f0cc34901953cced52bda075f /railties/lib/rails/plugin.rb | |
parent | 9a650a6547d2a83004db1bf913e26a8daa1c0b6e (diff) | |
download | rails-c02f2782631a1893e2e880e3ccc65fb9a734567a.tar.gz rails-c02f2782631a1893e2e880e3ccc65fb9a734567a.tar.bz2 rails-c02f2782631a1893e2e880e3ccc65fb9a734567a.zip |
Add the ability to have plugins load rake tasks.
Diffstat (limited to 'railties/lib/rails/plugin.rb')
-rw-r--r-- | railties/lib/rails/plugin.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index aa325c6f76..be6cdec3fa 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -25,6 +25,16 @@ module Rails Configuration.default end + def self.rake_tasks(&blk) + @rake_tasks ||= [] + @rake_tasks << blk + end + + def self.load_tasks + return unless @rake_tasks + @rake_tasks.each { |blk| blk.call } + end + # Creates an initializer which includes all given modules to the given class. # # module Rails |