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

36 lines
975 B
Text
Raw Normal View History

2012-06-07 21:07:41 +01:00
require 'bundler/setup'
require 'rspec/core/rake_task'
2012-01-06 10:51:36 +00:00
base = File.dirname(__FILE__)
require base + "/lib/capybara/poltergeist/version"
2012-06-04 14:46:39 +02:00
require 'coffee-script'
require 'rspec-rerun'
2012-01-06 10:51:36 +00:00
2011-10-27 23:34:14 +01:00
task :autocompile do
2012-06-04 15:00:57 +02:00
system "guard"
2011-10-27 23:34:14 +01:00
end
2011-10-27 23:41:05 +01:00
2012-06-04 14:46:39 +02:00
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|
2012-06-04 14:48:48 +02:00
puts "Compiling #{f}"
2012-06-04 14:46:39 +02:00
out << CoffeeScript.compile(File.read(f), :bare => true)
end
end
end
RSpec::Core::RakeTask.new('test')
2011-10-27 23:41:05 +01:00
2012-06-04 14:48:48 +02:00
task :default => [:compile, :test]
task :ci => 'rspec-rerun:spec'
2012-01-06 10:51:36 +00:00
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