Sha256: a047790fd2bda637b4513f9a5a2181d86a140a27a9abb3f6e008905e31ba8569

Contents?: true

Size: 625 Bytes

Versions: 3

Compression:

Stored size: 625 Bytes

Contents

namespace 'unicorn' do
  desc 'start server'
  task :start, [:env, :config] do |task, args|
    args = { :env => 'development', :config => 'unicorn.rb' }.merge args.to_hash
    cmd = 'unicorn_rails'
    cmd << ' -c ' << args[:config] if args.has_key?(:config) && File.exists?(File.join(Rails.root, args[:config]))
    cmd << ' -E ' << args[:env] if args.has_key?(:env)
    sys cmd << ' -D'
  end
  
  desc 'stop server'
  task :stop do
    sys 'kill -QUIT `cat tmp/unicorn.pid`' if File.exists? File.join(Rails.root, 'tmp/unicorn.pid')
  end
  
  desc 'restart server'
  task :restart, [:env, :config] => [:stop, :start]
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
zfben_rails_rake-0.0.9 lib/zfben_rails_rake/tasks/unicorn.rb
zfben_rails_rake-0.0.8 lib/zfben_rails_rake/tasks/unicorn.rb
zfben_rails_rake-0.0.6 tasks/unicorn.rb