X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/dc635b6d39be19a09a428282b6d639d029908df6..22f84a3ea8bc39eb4cb91575d35dfca683336032:/vendor/plugins/acts_as_authenticated/generators/authenticated_mailer/authenticated_mailer_generator.rb diff --git a/vendor/plugins/acts_as_authenticated/generators/authenticated_mailer/authenticated_mailer_generator.rb b/vendor/plugins/acts_as_authenticated/generators/authenticated_mailer/authenticated_mailer_generator.rb new file mode 100644 index 0000000..df2a94a --- /dev/null +++ b/vendor/plugins/acts_as_authenticated/generators/authenticated_mailer/authenticated_mailer_generator.rb @@ -0,0 +1,27 @@ +class AuthenticatedMailerGenerator < Rails::Generator::NamedBase + def manifest + record do |m| + # Check for class naming collisions. + m.class_collisions class_path, "#{class_name}Notifier", "#{class_name}NotifierTest", "#{class_name}Observer" + + # Controller, helper, views, and test directories. + m.directory File.join('app/models', class_path) + m.directory File.join('app/views', class_path, "#{file_name}_notifier") + m.directory File.join('test/unit', class_path) + + %w( notifier observer ).each do |model_type| + m.template "#{model_type}.rb", File.join('app/models', + class_path, + "#{file_name}_#{model_type}.rb") + end + + m.template 'notifier_test.rb', File.join('test/unit', class_path, "#{file_name}_notifier_test.rb") + + # Mailer templates + %w( activation signup_notification ).each do |action| + m.template "#{action}.rhtml", + File.join('app/views', "#{file_name}_notifier", "#{action}.rhtml") + end + end + end +end