Class: RailsImporter::Generators::ImporterGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/rails_importer/importer_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_importer_classObject



8
9
10
# File 'lib/generators/rails_importer/importer_generator.rb', line 8

def add_importer_class
  template('importer.rb', "lib/rails_importer/#{file_name}_importer.rb")
end

#add_to_importersObject



12
13
14
# File 'lib/generators/rails_importer/importer_generator.rb', line 12

def add_to_importers
  insert_into_file "config/initializers/rails_importer.rb", "\tconfig.importers << #{class_name}Importer\n", :before => "end"
end