Sha256: c44393412291687eb496914bb612235593856a474ace0add1423e5bc8c469bfc
Contents?: true
Size: 1.06 KB
Versions: 33
Compression:
Stored size: 1.06 KB
Contents
module Merb::Generators class MailerGenerator < NamespacedGenerator def self.source_root File.dirname(__FILE__) / 'templates' / 'mailer' end desc <<-DESC Generates a mailer DESC option :testing_framework, :desc => 'Testing framework to use (one of: rspec, test_unit)' first_argument :name, :required => true, :desc => "mailer name" template :mailer do |t| t.source = 'app/mailers/%file_name%_mailer.rb' t.destination = File.join("app/mailers", base_path, "#{file_name}_mailer.rb") end template :notify_on_event do |t| t.source = 'app/mailers/views/%file_name%_mailer/notify_on_event.text.erb' t.destination = File.join("app/mailers/views", base_path, "#{file_name}_mailer/notify_on_event.text.erb") end template :controller_spec, :testing_framework => :rspec do |t| t.source = 'spec/mailers/%file_name%_mailer_spec.rb' t.destination = File.join("spec/mailers", base_path, "#{file_name}_mailer_spec.rb") end end add :mailer, MailerGenerator end
Version data entries
33 entries across 33 versions & 1 rubygems