Sha256: 958630f8f4a89499653bac4090034f9f6300f4daf8051f6569a935f1e96a994f

Contents?: true

Size: 1.07 KB

Versions: 21

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require 'rails/generators'

module Blacklight
  class SolrGenerator < Rails::Generators::Base
    source_root ::File.expand_path('../templates', __FILE__)

    desc <<-EOF
      This generator makes the following changes to your application:
       1. Installs solr_wrapper into your application
       2. Copies default blacklight solr config directory into your application
       3. Copies default .solr_wrapper into your application
       4. Adds rsolr to your Gemfile
    EOF

    def install_solrwrapper
      gem_group :development, :test do
        gem 'solr_wrapper', '>= 0.3'
      end

      append_to_file "Rakefile", "\nrequire 'solr_wrapper/rake_task' unless Rails.env.production?\n"
    end

    def copy_solr_conf
      directory 'solr'
    end

    def solr_wrapper_config
      copy_file '.solr_wrapper.yml'
    end

    def add_rsolr_gem
      gem 'rsolr', '>= 1.0', '< 3'
    end

    def bundle_install
      inside destination_root do
        Bundler.with_unbundled_env do
          run "bundle install"
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
blacklight-8.6.1 lib/generators/blacklight/solr_generator.rb
blacklight-8.6.0 lib/generators/blacklight/solr_generator.rb
blacklight-8.5.1 lib/generators/blacklight/solr_generator.rb
blacklight-8.5.0 lib/generators/blacklight/solr_generator.rb
blacklight-8.4.0 lib/generators/blacklight/solr_generator.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/lib/generators/blacklight/solr_generator.rb
blacklight-8.3.0 lib/generators/blacklight/solr_generator.rb
blacklight-8.2.2 lib/generators/blacklight/solr_generator.rb
blacklight-8.2.1 lib/generators/blacklight/solr_generator.rb
blacklight-8.2.0 lib/generators/blacklight/solr_generator.rb
blacklight-8.1.0 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.1 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta8 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta7 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta6 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta5 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta4 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta3 lib/generators/blacklight/solr_generator.rb
blacklight-8.0.0.beta2 lib/generators/blacklight/solr_generator.rb