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