1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00
teampoltergeist--poltergeist/Rakefile
2012-06-04 14:48:48 +02:00

35 lines
1 KiB
Ruby

require 'rspec/core/rake_task'
base = File.dirname(__FILE__)
require base + "/lib/capybara/poltergeist/version"
require 'coffee-script'
task :autocompile do
system "coffee --compile --bare --watch " \
"--output lib/capybara/poltergeist/client/compiled " \
"lib/capybara/poltergeist/client/*.coffee"
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') do
end
task :default => [:compile, :test]
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