Sha256: 72dfaa2fdbc4bd6b8291ca87830ebc67b69957a4bd6bf2e874a01d567bf39b89

Contents?: true

Size: 595 Bytes

Versions: 2

Compression:

Stored size: 595 Bytes

Contents

# frozen_string_literal: true

require 'active_generator/base'
require 'generators/locale/base'

module Locale
  class MailerGenerator < Rails::Generators::NamedBase
    include ActiveGenerator::Base
    include Locale::Base

    source_root File.expand_path('../templates', __FILE__)
    argument :language, type: :string, required: false, default: 'en', desc: 'The locale alpha code'

    def create_mailer_file
      assert_valid_language!
      path = File.join("config/locales/#{language}/mailers", namespace_path, "#{file_name}.yml")

      template('mailer.yml', path)
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_generator-5.1.0 lib/generators/locale/mailer/mailer_generator.rb
active_generator-5.0.0 lib/generators/locale/mailer/mailer_generator.rb