Class: EffectiveEmailTemplates::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- EffectiveEmailTemplates::Generators::InstallGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/effective_email_templates/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #copy_initializer ⇒ Object
- #copy_liquid ⇒ Object
- #copy_mailer ⇒ Object
- #copy_preview ⇒ Object
- #create_migration_file ⇒ Object
- #message ⇒ Object
Class Method Details
.next_migration_number(dirname) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 10 def self.next_migration_number(dirname) unless ActiveRecord::Base. Time.new.utc.strftime("%Y%m%d%H%M%S") else "%.3d" % (current_migration_number(dirname) + 1) end end |
Instance Method Details
#copy_initializer ⇒ Object
18 19 20 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 18 def copy_initializer template ('../' * 3) + 'config/effective_email_templates.rb', 'config/initializers/effective_email_templates.rb' end |
#copy_liquid ⇒ Object
26 27 28 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 26 def copy_liquid template ('../' * 3) + 'config/welcome.liquid', 'app/views/email_templates_mailer/welcome.liquid' end |
#copy_mailer ⇒ Object
22 23 24 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 22 def copy_mailer template ('../' * 3) + 'config/email_templates_mailer.rb', 'app/mailers/email_templates_mailer.rb' end |
#copy_preview ⇒ Object
30 31 32 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 30 def copy_preview template ('../' * 3) + 'config/email_templates_mailer_preview.rb', 'test/mailers/previews/email_templates_mailer_preview.rb' end |
#create_migration_file ⇒ Object
34 35 36 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 34 def create_migration_file migration_template ('../' * 3) + 'db/migrate/101_create_effective_email_templates.rb', 'db/migrate/create_effective_email_templates.rb' end |
#message ⇒ Object
38 39 40 |
# File 'lib/generators/effective_email_templates/install_generator.rb', line 38 def puts("Please run rake db:migrate and rake effective_email_templates:import") end |