rails_generators/culerity/templates/lib/tasks/culerity.rake in culerity-0.2.3 vs rails_generators/culerity/templates/lib/tasks/culerity.rake in culerity-0.2.4
- old
+ new
@@ -1,22 +1,22 @@
namespace 'culerity' do
namespace 'rails' do
desc "Starts a rails server for cucumber/culerity tests"
- task :start => :environment do
+ task :start do
port = ENV['PORT'] || 3001
- environment = 'culerity_development'
+ environment = ENV["RAILS_ENV"] || 'culerity_development'
pid_file = RAILS_ROOT + "/tmp/culerity_rails_server.pid"
if File.exists?(pid_file)
puts "culerity rails server already running; if not, delete tmp/culerity_rails_server.pid and try again"
exit 1
end
rails_server = IO.popen("script/server -e #{environment} -p #{port}", 'r+')
File.open(pid_file, "w") { |file| file << rails_server.pid }
end
desc "Stops the running rails server for cucumber/culerity tests"
- task :stop => :environment do
+ task :stop do
pid_file = RAILS_ROOT + "/tmp/culerity_rails_server.pid"
if File.exists?(pid_file)
pid = File.read(pid_file).to_i
Process.kill(6, pid)
File.delete(pid_file)
@@ -28,10 +28,10 @@
desc "Restarts the rails server for cucumber/culerity tests"
task :restart => [:stop, :start]
end
desc "Install required gems into jruby"
- task :install => :environment do
+ task :install do
jgem_cmd = `which jruby`.strip
raise "ERROR: You need to install jruby to use culerity and celerity." if jgem_cmd.blank?
sh "#{jgem_cmd} -S gem install jarib-celerity --source=http://gems.github.com"
end
end