Sha256: 143f59c6a55cb1ce468a1bb71b006139c146fb16df36d526011aa4abf59ef79a

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

module Ecm
  module Tags
    module Backend
      module Generators
        class InstallGenerator < Rails::Generators::Base
          desc 'Generates the intializer'

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

          def generate_initializer
            copy_file 'initializer.rb', 'config/initializers/ecm_tags_backend.rb'
          end

          def add_to_itsf_backend
            insert_into_itsf_backend_config(Ecm::Tags::Backend::Engine)
          end

          private

          def insert_into_itsf_backend_config(engine_name)
            inject_into_file 'config/initializers/001_itsf_backend.rb', after: "config.backend_engines = %w(\n" do
              "    #{engine_name}\n"
            end
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ecm_tags_backend-0.0.4 lib/generators/ecm/tags/backend/install/install_generator.rb
ecm_tags_backend-0.0.3 lib/generators/ecm/tags/backend/install/install_generator.rb