Sha256: a4ee54b161b2517590a782aa4660320b77b3e724540c699b575db90a444fcc1f

Contents?: true

Size: 848 Bytes

Versions: 2

Compression:

Stored size: 848 Bytes

Contents

module Ecm
  module Cms
    module Generators
      class InstallGenerator < Rails::Generators::Base
        desc 'Generates the initializer'

        source_root File.expand_path('../templates', __FILE__)

        def generate_initializer
          copy_file '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

2 entries across 2 versions & 1 rubygems

Version Path
ecm_cms2-4.1.1 lib/generators/ecm/cms/install/install_generator.rb
ecm_cms2-4.1.0 lib/generators/ecm/cms/install/install_generator.rb