Sha256: 74ffe530f30ced339b55c8529b1f528ebe20f84ad60fb1576ae0f025e377af80
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
module Ecm module Cms module Generators class InstallGenerator < Rails::Generators::Base desc 'Generates the initializer' source_root File.expand_path('../templates', __FILE__) attr_reader :base_controller_class_name def initialize(*args) super @base_controller_class_name = ENV.fetch('BASE_CONTROLLER_CLASS_NAME') { '::FrontendController' } end def generate_initializer template 'initializer.rb', 'config/initializers/ecm_cms.rb' end def generate_controller copy_file 'frontend_controller.rb', 'app/controllers/frontend_controller.rb' end def generate_routes inject_into_file 'config/routes.rb', before: "\nend" do File.read(File.join(File.expand_path('../templates', __FILE__), 'routes.source')) end end # def add_homepages # if yes? "Do you want to add homepages?" # AddHomepagesService.call # end # end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems