2018-05-22 20:22:03 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2012-06-07 20:07:41 +00:00
|
|
|
require 'bundler/setup'
|
2011-10-27 23:36:53 +00:00
|
|
|
require 'rspec/core/rake_task'
|
|
|
|
|
2013-08-26 14:31:21 +00:00
|
|
|
require 'capybara/poltergeist/version'
|
2012-06-04 12:46:39 +00:00
|
|
|
require 'coffee-script'
|
2012-01-06 10:51:36 +00:00
|
|
|
|
2015-04-16 16:19:45 +00:00
|
|
|
RSpec::Core::RakeTask.new('test')
|
2018-05-22 20:22:03 +00:00
|
|
|
task default: %i[compile test]
|
2015-04-16 16:19:45 +00:00
|
|
|
|
|
|
|
task(:autocompile) { system 'guard' }
|
2011-10-27 22:41:05 +00:00
|
|
|
|
2012-06-04 12:46:39 +00:00
|
|
|
task :compile do
|
2015-04-16 16:19:45 +00:00
|
|
|
path = 'lib/capybara/poltergeist/client'
|
|
|
|
Dir["#{path}/*.coffee"].each do |f|
|
|
|
|
compiled = "#{path}/compiled/#{File.basename(f, '.coffee')}.js"
|
|
|
|
File.open(compiled, 'w') do |out|
|
2012-06-04 12:48:48 +00:00
|
|
|
puts "Compiling #{f}"
|
2015-04-16 16:19:45 +00:00
|
|
|
out << CoffeeScript.compile(File.read(f), bare: true)
|
2012-06-04 12:46:39 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-01-06 10:51:36 +00:00
|
|
|
task :release do
|
2015-04-16 16:19:45 +00:00
|
|
|
version = Capybara::Poltergeist::VERSION
|
|
|
|
puts "Releasing #{version}, y/n?"
|
|
|
|
exit(1) unless STDIN.gets.chomp == 'y'
|
|
|
|
sh 'gem build poltergeist.gemspec && ' \
|
|
|
|
"gem push poltergeist-#{version}.gem && " \
|
|
|
|
"git tag v#{version} && " \
|
|
|
|
'git push --tags'
|
2012-01-06 10:51:36 +00:00
|
|
|
end
|