class EffectiveEmailTemplates::Generators::InstallGenerator

Public Class Methods

next_migration_number(dirname) click to toggle source
# File lib/generators/effective_email_templates/install_generator.rb, line 10
def self.next_migration_number(dirname)
  unless ActiveRecord::Base.timestamped_migrations
    Time.new.utc.strftime("%Y%m%d%H%M%S")
  else
    "%.3d" % (current_migration_number(dirname) + 1)
  end
end

Public Instance Methods

copy_initializer() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/generators/effective_email_templates/install_generator.rb, line 38
def message
  puts("Please run rake db:migrate and rake effective_email_templates:import")
end