Sha256: 7d9aeb4817b69dd738d4929780ecbb841e3cecfdab11f5caf7f62b67e0a5d94d

Contents?: true

Size: 741 Bytes

Versions: 5

Compression:

Stored size: 741 Bytes

Contents

module Ecm
  module Core
    module Generators
      class InstallGenerator < Rails::Generators::Base
        desc 'Installs the initializer, routes and itsf_backend integration'

        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_core.rb'
        end

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ecm_core-0.4.0 lib/generators/ecm/core/install/install_generator.rb
ecm_core-0.3.0 lib/generators/ecm/core/install/install_generator.rb
ecm_core-0.2.2 lib/generators/ecm/core/install/install_generator.rb
ecm_core-0.2.1 lib/generators/ecm/core/install/install_generator.rb
ecm_core-0.2.0 lib/generators/ecm/core/install/install_generator.rb