Sha256: 4f3c89d964d1fd26ebd4b1e1171bb2f923e9834e13f6ecc7f1c23b5a2088405e

Contents?: true

Size: 914 Bytes

Versions: 9

Compression:

Stored size: 914 Bytes

Contents

# frozen_string_literal: true
require 'rails/generators'

module Blacklight
  class Solr4Generator < Rails::Generators::Base

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

    class_option :jettywrapper, type: :boolean, default: false, desc: "Use jettywrapper to download and control Jetty"

    desc <<-EOS
      This generator makes the following changes to your application:
       1. Installs jettywrapper into your application
       2. Adds rsolr to your Gemfile
    EOS

    def install_jettywrapper
      return unless options[:jettywrapper]

      gem "jettywrapper".dup, ">= 2.0"
      copy_file "config/jetty.yml", "config/jetty.yml"

      append_to_file "Rakefile",
        "\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.4.zip\"\n" \
        "require 'jettywrapper'\n"
    end

    def add_rsolr_gem
      gem "rsolr".dup, "~> 1.0"
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
blacklight-6.5.0 lib/generators/blacklight/solr4_generator.rb
blacklight-6.4.2 lib/generators/blacklight/solr4_generator.rb
blacklight-6.4.1 lib/generators/blacklight/solr4_generator.rb
blacklight-6.4.0 lib/generators/blacklight/solr4_generator.rb
blacklight-6.3.3 lib/generators/blacklight/solr4_generator.rb
blacklight-6.3.1 lib/generators/blacklight/solr4_generator.rb
blacklight-6.3.0 lib/generators/blacklight/solr4_generator.rb
blacklight-6.2.0 lib/generators/blacklight/solr4_generator.rb
blacklight-6.1.0 lib/generators/blacklight/solr4_generator.rb