diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-01 12:14:04 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-02 10:27:39 +0200 |
commit | 0760d5b542fa3af81fc7c5219794fd4dc24c8891 (patch) | |
tree | 98096d96eb1dbed36abd7630780a4ea4b0b29295 /railties | |
parent | 555a956a66628f0c14440e350fefe62125067058 (diff) | |
download | rails-0760d5b542fa3af81fc7c5219794fd4dc24c8891.tar.gz rails-0760d5b542fa3af81fc7c5219794fd4dc24c8891.tar.bz2 rails-0760d5b542fa3af81fc7c5219794fd4dc24c8891.zip |
Added comments to meta programming code.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/generators/base.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/railties/lib/generators/base.rb b/railties/lib/generators/base.rb index 519d8b84a8..769311b6c1 100644 --- a/railties/lib/generators/base.rb +++ b/railties/lib/generators/base.rb @@ -124,6 +124,23 @@ module Rails invocations << [ name, base_name, as ] invocation_blocks[name] = block if block_given? + # hook_for :test_framework + # + # ==== Generates + # + # def invoke_for_test_framework + # return unless options[:test_framework] + # + # klass = Rails::Generators.find_by_namespace(options[:test_framework], + # "rails", "model") + # + # if klass + # say_status :invoke, options[:test_framework], :blue + # invoke_class_with_block :test_framework, klass + # else + # say "Could not find and invoke '#{options[:test_framework]}'" + # end + # end class_eval <<-METHOD, __FILE__, __LINE__ def invoke_for_#{name} return unless options[#{name.inspect}] @@ -181,6 +198,23 @@ module Rails invocations << [ name, base_name, as ] invocation_blocks[name] = block if block_given? + # invoke_if :helper + # + # ==== Generates + # + # def invoke_if_helper + # return unless options[:helper] + # + # klass = Rails::Generators.find_by_namespace(:helper, + # "rails", "controller") + # + # if klass + # say_status :invoke, :helper, :blue + # invoke_class_with_block :helper, klass + # else + # say "Could not find and invoke 'helper'" + # end + # end class_eval <<-METHOD, __FILE__, __LINE__ def invoke_if_#{name} return unless options[#{name.inspect}] |