Class: Ecm::Galleries::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Ecm::Galleries::Generators::InstallGenerator
- Defined in:
- lib/generators/ecm/galleries/install/install_generator.rb
Instance Attribute Summary collapse
-
#base_controller_class_name ⇒ Object
readonly
Returns the value of attribute base_controller_class_name.
Instance Method Summary collapse
- #generate_initializer ⇒ Object
- #generate_routes ⇒ Object
-
#initialize(*args) ⇒ InstallGenerator
constructor
A new instance of InstallGenerator.
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_name ⇒ Object (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_initializer ⇒ Object
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_routes ⇒ Object
19 20 21 |
# File 'lib/generators/ecm/galleries/install/install_generator.rb', line 19 def generate_routes route File.read(File.join(File.('../templates', __FILE__), 'routes.source')) end |