lib/recipes/sphinx.rb in capigen-0.1.3 vs lib/recipes/sphinx.rb in capigen-0.1.4

- old
+ new

@@ -4,21 +4,21 @@ after "sphinx:setup", "sphinx:setup_monit" desc "Install sphinx" task :install do # Dependencies: gcc-c++ - script_install("sphinx/install.sh.erb") + script.install("sphinx/install.sh.erb") end desc "Setup sphinx for application" task :setup do sphinx_bin_path = "#{sphinx_prefix}/bin" sphinx_conf_path = "#{shared_path}/config/sphinx.conf" sphinx_pid_path = "#{shared_path}/pids/searchd.pid" - put load_template("sphinx/sphinx_app.initd.centos.erb", binding), "/tmp/sphinx.initd" + put template.load("sphinx/sphinx_app.initd.centos.erb"), "/tmp/sphinx.initd" sudo "install -o root /tmp/sphinx.initd /etc/init.d/sphinx_#{application}" sudo "/sbin/chkconfig --level 345 sphinx_#{application} on" @@ -26,23 +26,23 @@ end desc "Create monit configuration for sphinx" task :setup_monit do sphinx_pid_path = "#{shared_path}/pids/searchd.pid" - put load_template("sphinx/sphinx.monitrc.erb", binding), "/tmp/sphinx_#{application}.monitrc" + put template.load("sphinx/sphinx.monitrc.erb"), "/tmp/sphinx_#{application}.monitrc" sudo "install -o root /tmp/sphinx_#{application}.monitrc /etc/monit/sphinx_#{application}.monitrc" end desc "Update sphinx for application" task :update_code do - rails_root = current_path - index_root = "#{shared_path}/var/index"; - log_root = "#{shared_path}/log" - pid_root = "#{shared_path}/pids" + set :rails_root, current_path + set :index_root, "#{shared_path}/var/index"; + set :log_root, "#{shared_path}/log" + set :pid_root, "#{shared_path}/pids" - put load_project_template("config/templates/sphinx.conf.erb", binding), "#{shared_path}/config/sphinx.conf" + put template.project("config/templates/sphinx.conf.erb"), "#{shared_path}/config/sphinx.conf" end desc "Rotate sphinx index for application" task :rotate_all do run "#{sphinx_prefix}/bin/indexer --config #{shared_path}/config/sphinx.conf --rotate --all" \ No newline at end of file