Sha256: 9f4fd47f4639ded0e261e49b32d02a2695abb38e3eea02517c3e44c6adb4558c

Contents?: true

Size: 807 Bytes

Versions: 2

Compression:

Stored size: 807 Bytes

Contents

# frozen_string_literal: true

module Europeana
  module Blacklight
    class Install < Rails::Generators::Base
      source_root File.expand_path('templates', __dir__)

      argument :europeana_api_key, type: :string
      argument :controller_name, type: :string, default: 'catalog'

      def disable_solr_gems
        comment_lines('Gemfile', /gem 'solr_wrapper'/)
        comment_lines('Gemfile', /gem 'rsolr'/)
      end

      def bundle_install
        Bundler.with_clean_env do
          run 'bundle install'
        end
      end

      def create_configuration_files
        template 'config/blacklight.yml', 'config/blacklight.yml'
      end

      def generate_controller
        template 'catalog_controller.rb', "app/controllers/#{controller_name}_controller.rb"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
europeana-blacklight-1.3.1 lib/generators/europeana/blacklight/install_generator.rb
europeana-blacklight-1.3.0 lib/generators/europeana/blacklight/install_generator.rb