Sha256: ccfe27030c3b2d6a6502ec02bb451fef86261f9ddbaed94468fd9cc5eee132c0

Contents?: true

Size: 654 Bytes

Versions: 17

Compression:

Stored size: 654 Bytes

Contents

module SolrWrapper
  # An abstract class for running commands in the shell
  class Runner
    def initialize(cmd, options, config)
      @cmd = cmd
      @silence_output = !options.delete(:output)
      @options = options
      @config = config
    end

    attr_reader :cmd, :options, :config

    def silence_output?
      @silence_output
    end

    private

    def argument_list
      [config.solr_binary, cmd] + config.solr_options.merge(options).map do |k, v|
        case v
        when true
          "-#{k}"
        when false, nil
          nil
        else
          ["-#{k}", v.to_s]
        end
      end.flatten.compact
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
solr_wrapper-4.1.0 lib/solr_wrapper/runner.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/solr_wrapper-4.0.2/lib/solr_wrapper/runner.rb
solr_wrapper-4.0.2 lib/solr_wrapper/runner.rb
solr_wrapper-4.0.1 lib/solr_wrapper/runner.rb
solr_wrapper-4.0.0 lib/solr_wrapper/runner.rb
solr_wrapper-3.1.3 lib/solr_wrapper/runner.rb
solr_wrapper-3.1.2 lib/solr_wrapper/runner.rb
solr_wrapper-3.1.1 lib/solr_wrapper/runner.rb
solr_wrapper-3.1.0 lib/solr_wrapper/runner.rb
solr_wrapper-3.0.2 lib/solr_wrapper/runner.rb
solr_wrapper-3.0.1 lib/solr_wrapper/runner.rb
solr_wrapper-3.0.0 lib/solr_wrapper/runner.rb
solr_wrapper-2.2.0 lib/solr_wrapper/runner.rb
solr_wrapper-2.1.0 lib/solr_wrapper/runner.rb
solr_wrapper-2.0.0 lib/solr_wrapper/runner.rb
solr_wrapper-1.2.0 lib/solr_wrapper/runner.rb
solr_wrapper-1.1.0 lib/solr_wrapper/runner.rb