Class: RailsImporter::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



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

def copy_initializer
  template "rails_importer.rb", "config/initializers/rails_importer.rb"
end

#include_spree_importer_core_from_libObject



12
13
14
15
16
17
18
19
# File 'lib/generators/rails_importer/install_generator.rb', line 12

def include_spree_importer_core_from_lib
  inject_into_file 'config/application.rb',
  "\n\t\t# Load application's importers"\
  "\n\t\tDir.glob(File.join(File.dirname(__FILE__), \"../lib/rails_importer/*_importer.rb\")) do |c|"\
  "\n\t\t\tRails.configuration.cache_classes ? require(c) : load(c)"\
  "\n\t\tend\n",
  :after => "< Rails::Application", :verbose => true
end