Class: Ecm::Galleries::Generators::InstallGenerator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ InstallGenerator

Returns a new instance of InstallGenerator.



10
11
12
13
# File 'lib/generators/ecm/galleries/install/install_generator.rb', line 10

def initialize(*args)
  super
  @base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::FrontendController' }
end

Instance Attribute Details

#base_controller_class_nameObject (readonly)

Returns the value of attribute base_controller_class_name.



8
9
10
# File 'lib/generators/ecm/galleries/install/install_generator.rb', line 8

def base_controller_class_name
  @base_controller_class_name
end

Instance Method Details

#generate_initializerObject



15
16
17
# File 'lib/generators/ecm/galleries/install/install_generator.rb', line 15

def generate_initializer
  template 'initializer.rb', 'config/initializers/ecm_galleries.rb'
end

#generate_routesObject



19
20
21
# File 'lib/generators/ecm/galleries/install/install_generator.rb', line 19

def generate_routes
  route File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source'))
end