class Object

Public Instance Methods

config() click to toggle source
# File lib/thinking_sphinx_monit/tasks/monit.rb, line 25
def config
  ThinkingSphinx::Configuration.instance
end
searchd() click to toggle source
# File lib/thinking_sphinx_monit/tasks/monit.rb, line 29
def searchd
  con = config.controller
  "#{con.bin_path}#{con.searchd_binary_name}"
end
sudo_if_needed(command) click to toggle source
# File lib/thinking_sphinx_monit/tasks/capistrano.rb, line 69
def sudo_if_needed(command)
  if fetch(:thinking_sphinx_use_sudo)
    sudo command
  else
    execute command
  end
end
template_sphinx(from, to) click to toggle source
# File lib/thinking_sphinx_monit/tasks/monit.rb, line 34
def template_sphinx(from, to)
  [
      "lib/thinking_sphinx_monit/templates/#{from}.erb",
      "config/deploy/templates/#{from}.erb",
      File.expand_path("../../templates/#{from}.erb", __FILE__)
  ].each do |path|
    if File.file?(path)
      erb = File.read(path)
      File.write(to, StringIO.new(ERB.new(erb, nil, '-').result(binding)).read)
      break
    end
  end
end
ts_monit_service_name() click to toggle source
# File lib/thinking_sphinx_monit/tasks/capistrano.rb, line 65
def ts_monit_service_name
  fetch(:ts_monit_service_name, "thinking_sphinx_#{fetch(:application)}_#{fetch(:stage)}")
end