Sha256: af0e9419c15e2c0e4219be8230bdd4d1024f2a267497d9ee4f051aa485fdd093

Contents?: true

Size: 1.03 KB

Versions: 2

Compression:

Stored size: 1.03 KB

Contents

# encoding: UTF-8
class RielesGenerator < Rails::Generators::Base
  source_root File.expand_path('../templates', __FILE__)
  class_option :keep_current_inflections, :type => :boolean, :default => false, :desc => 'Indica si en lugar de tratar de sobreescribir el archivo de inflections, se debe crear un archivo adicional (inflections_es)'

  def copy_files
    copy_file 'inflections.rb', "config/initializers/#{file_name}.rb"
    copy_file 'es.yml', 'config/locales/es.yml'
    copy_file 'index.html.erb', 'lib/templates/erb/scaffold/index.html.erb'
    copy_file 'edit.html.erb', 'lib/templates/erb/scaffold/edit.html.erb'
    copy_file 'new.html.erb', 'lib/templates/erb/scaffold/new.html.erb'
    copy_file 'show.html.erb', 'lib/templates/erb/scaffold/show.html.erb'
    copy_file '_form.html.erb', 'lib/templates/erb/scaffold/_form.html.erb'
    copy_file '_error_messages.html.erb', 'app/views/application/_error_messages.html.erb'
  end

  private

  def file_name
    file_name = options.keep_current? ? 'inflections_es' : 'inflections'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rieles-0.0.2 lib/generators/rieles/rieles_generator.rb
rieles-0.0.1 lib/generators/rieles/rieles_generator.rb