teampoltergeist--poltergeist/Rakefile

34 lines
905 B
Ruby
Raw Normal View History

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 12:46:39 +00:00
require 'coffee-script'
2012-01-06 10:51:36 +00:00
2011-10-27 22:34:14 +00:00
task :autocompile do
2012-06-04 13:00:57 +00:00
system "guard"
2011-10-27 22:34:14 +00:00
end
2011-10-27 22:41:05 +00:00
2012-06-04 12:46:39 +00: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 12:48:48 +00:00
puts "Compiling #{f}"
2012-06-04 12:46:39 +00:00
out << CoffeeScript.compile(File.read(f), :bare => true)
end
end
end
RSpec::Core::RakeTask.new('test') do
2011-10-27 22:41:05 +00:00
end
2012-06-04 12:48:48 +00:00
task :default => [:compile, :test]
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