mirror of
https://github.com/teampoltergeist/poltergeist.git
synced 2022-11-09 12:05:00 -05:00

It's an unfortunate reality that PhantomJS does crash from time to time, and when you have over 500 tests running on 6 different rubies there is a high chance that at least on of those runs will fail. So hopefully this will help mitigate that.
35 lines
975 B
Ruby
35 lines
975 B
Ruby
require 'bundler/setup'
|
|
require 'rspec/core/rake_task'
|
|
|
|
base = File.dirname(__FILE__)
|
|
require base + "/lib/capybara/poltergeist/version"
|
|
require 'coffee-script'
|
|
require 'rspec-rerun'
|
|
|
|
task :autocompile do
|
|
system "guard"
|
|
end
|
|
|
|
task :compile do
|
|
Dir.glob("lib/capybara/poltergeist/client/*.coffee").each do |f|
|
|
compiled = "lib/capybara/poltergeist/client/compiled/#{f.split("/").last.split(".").first}.js"
|
|
File.open(compiled, "w") do |out|
|
|
puts "Compiling #{f}"
|
|
out << CoffeeScript.compile(File.read(f), :bare => true)
|
|
end
|
|
end
|
|
end
|
|
|
|
RSpec::Core::RakeTask.new('test')
|
|
|
|
task :default => [:compile, :test]
|
|
task :ci => 'rspec-rerun:spec'
|
|
|
|
task :release do
|
|
puts "Releasing #{Capybara::Poltergeist::VERSION}, y/n?"
|
|
exit(1) unless STDIN.gets.chomp == "y"
|
|
sh "gem build poltergeist.gemspec && " \
|
|
"gem push poltergeist-#{Capybara::Poltergeist::VERSION}.gem && " \
|
|
"git tag v#{Capybara::Poltergeist::VERSION} && " \
|
|
"git push --tags"
|
|
end
|