diff options
Diffstat (limited to 'railties/lib/rails/railtie.rb')
-rw-r--r-- | railties/lib/rails/railtie.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/lib/rails/railtie.rb b/railties/lib/rails/railtie.rb index 43a0303c5b..e3297148e5 100644 --- a/railties/lib/rails/railtie.rb +++ b/railties/lib/rails/railtie.rb @@ -35,13 +35,28 @@ module Rails @rake_tasks end + def self.generators(&blk) + @generators ||= [] + @generators << blk if blk + @generators + end + def rake_tasks self.class.rake_tasks end + def generators + self.class.generators + end + def load_tasks return unless rake_tasks rake_tasks.each { |blk| blk.call } end + + def load_generators + return unless generators + generators.each { |blk| blk.call } + end end end |