Sha256: 485d0f8fdc065a6c9d6ac28636a0f9ce38823b0125f8b7380e45d6eb6119d617
Contents?: true
Size: 1.06 KB
Versions: 3
Compression:
Stored size: 1.06 KB
Contents
# frozen_string_literal: true class ThinkingSphinx::Commands::Base include ThinkingSphinx::WithOutput def self.call(configuration, options, stream = STDOUT) new(configuration, options, stream).call_with_handling end def call_with_handling call rescue Riddle::CommandFailedError => error handle_failure error.command_result end private delegate :controller, :to => :configuration def command(command, extra_options = {}) ThinkingSphinx::Commander.call( command, configuration, options.merge(extra_options), stream ) end def command_output(output) return "See above\n" if output.nil? "\n\t" + output.gsub("\n", "\n\t") end def handle_failure(result) stream.puts <<-TXT The Sphinx #{type} command failed: Command: #{result.command} Status: #{result.status} Output: #{command_output result.output} There may be more information about the failure in #{configuration.searchd.log}. TXT exit(result.status || 1) end def log(message) return if options[:silent] stream.puts message end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
thinking-sphinx-4.2.0 | lib/thinking_sphinx/commands/base.rb |
thinking-sphinx-4.1.0 | lib/thinking_sphinx/commands/base.rb |
thinking-sphinx-4.0.0 | lib/thinking_sphinx/commands/base.rb |