Sha256: d196cd9a4e49c65d6ca6984e8cd1d5e237a633cdcde916aab0bd6b6493535377

Contents?: true

Size: 603 Bytes

Versions: 3

Compression:

Stored size: 603 Bytes

Contents

# frozen_string_literal: true

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

module Locale
  class UploaderGenerator < 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_uploader_file
      assert_valid_language!
      path = File.join("config/locales/#{language}/uploaders", namespace_path, "#{file_name}.yml")

      template('uploader.yml', path)
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_generator-5.2.0 lib/generators/locale/uploader/uploader_generator.rb
active_generator-5.1.0 lib/generators/locale/uploader/uploader_generator.rb
active_generator-5.0.0 lib/generators/locale/uploader/uploader_generator.rb