Sha256: ee01567f681897d02073cc7d8c5dc4f15b34bdaaa6baf3e135b11cdcb79e1ad3

Contents?: true

Size: 771 Bytes

Versions: 3

Compression:

Stored size: 771 Bytes

Contents

class ThinkingSphinx::Interfaces::Daemon
  include ThinkingSphinx::WithOutput

  def start
    if running?
      raise ThinkingSphinx::SphinxAlreadyRunning, 'searchd is already running'
    end

    if options[:nodetach]
      ThinkingSphinx::Commands::StartAttached.call configuration, options
    else
      ThinkingSphinx::Commands::StartDetached.call configuration, options
    end
  end

  def status
    if running?
      stream.puts "The Sphinx daemon searchd is currently running."
    else
      stream.puts "The Sphinx daemon searchd is not currently running."
    end
  end

  def stop
    ThinkingSphinx::Commands::Stop.call configuration, options
  end

  private

  delegate :controller, :to => :configuration
  delegate :running?,   :to => :controller
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinking-sphinx-3.4.2 lib/thinking_sphinx/interfaces/daemon.rb
thinking-sphinx-3.4.1 lib/thinking_sphinx/interfaces/daemon.rb
thinking-sphinx-3.4.0 lib/thinking_sphinx/interfaces/daemon.rb