Sha256: c7b736c8dea2bffd6fbaafa41d7a55df05ad411200db746f162b22d7507520ba

Contents?: true

Size: 1.14 KB

Versions: 17

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

class ThinkingSphinx::Commander
  def self.call(command, configuration, options, stream = STDOUT)
    raise ThinkingSphinx::UnknownCommand unless registry.keys.include?(command)

    registry[command].call configuration, options, stream
  end

  def self.registry
    @registry ||= {
      :clear_real_time  => ThinkingSphinx::Commands::ClearRealTime,
      :clear_sql        => ThinkingSphinx::Commands::ClearSQL,
      :configure        => ThinkingSphinx::Commands::Configure,
      :index_sql        => ThinkingSphinx::Commands::IndexSQL,
      :index_real_time  => ThinkingSphinx::Commands::IndexRealTime,
      :merge            => ThinkingSphinx::Commands::Merge,
      :merge_and_update => ThinkingSphinx::Commands::MergeAndUpdate,
      :prepare          => ThinkingSphinx::Commands::Prepare,
      :rotate           => ThinkingSphinx::Commands::Rotate,
      :running          => ThinkingSphinx::Commands::Running,
      :start_attached   => ThinkingSphinx::Commands::StartAttached,
      :start_detached   => ThinkingSphinx::Commands::StartDetached,
      :stop             => ThinkingSphinx::Commands::Stop
    }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.5.1 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.5.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.4.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.3.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.2.1 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.2.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.1.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-5.0.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.4.1 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.4.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.3.2 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.3.1 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.3.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.2.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.1.0 lib/thinking_sphinx/commander.rb
thinking-sphinx-4.0.0 lib/thinking_sphinx/commander.rb