Rakefile in watir-webdriver-0.0.1.dev5 vs Rakefile in watir-webdriver-0.0.1.dev6
- old
+ new
@@ -9,15 +9,17 @@
gem.description = %Q{WebDriver-backed Watir}
gem.email = "jari.bakken@gmail.com"
gem.homepage = "http://github.com/jarib/watir-webdriver"
gem.authors = ["Jari Bakken"]
- gem.add_dependency "selenium-webdriver"
+ gem.add_dependency "selenium-webdriver", '>= 0.0.18'
gem.add_development_dependency "rspec"
gem.add_development_dependency "webidl"
- gem.add_development_dependency "sinatra"
+ gem.add_development_dependency "sinatra", ">= 1.0"
+ gem.add_development_dependency "sinatra", ">= 1.0"
+ gem.add_development_dependency "activesupport", ">= 2.3.5" # for pluralization during code generation
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
@@ -37,37 +39,27 @@
task :spec => :check_dependencies
namespace :html5 do
IDL_PATH = "support/html5/html5.idl"
- EXTRAS_PATH = "support/html5/html5_extras.idl"
SPEC_URI = "http://dev.w3.org/html5/spec/Overview.html" # TODO: use http://www.whatwg.org/specs/web-apps/current-work/source
+ desc "Print IDL parts from #{SPEC_URI}"
task :extract do
- require 'support/html5/idl_extractor'
-
- idl = IdlExtractor.new(SPEC_URI)
- idl.write_idl_to IDL_PATH
- idl.write_extras_to "#{EXTRAS_PATH}.txt"
-
- puts "\n\n"
- puts "Some HTML elements does not have an interface declaration defined in the spec."
- puts "You will need to create the IDL by hand and remove the .txt extension from #{EXTRAS_PATH}.txt before running the html5:generate task."
- puts "We're also adding an extended attribute to specify TagName - you may need to look through #{IDL_PATH} to make sure the syntax is correct."
+ require "nokogiri"
+ require "open-uri"
+ doc = Nokogiri.HTML(open(SPEC_URI))
+ puts doc.search("//pre[@class='idl']").map { |e| e.inner_text }.join("\n\n")
end
desc 'Re-enerate the base Watir element classes from the spec '
task :generate do
require "support/html5/watir_visitor"
- raise Errno::ENOENT, EXTRAS_PATH unless File.exist?(EXTRAS_PATH)
code = WatirVisitor.generate_from(IDL_PATH)
- code << "# from extras: \n\n"
- code << WatirVisitor.generate_from(EXTRAS_PATH)
+ old_file = "lib/watir-webdriver/elements/generated.rb"
- old_file = "lib/watir/elements/generated.rb"
-
File.open("#{old_file}.new", "w") { |file| file << code }
if File.exist?(old_file)
system "diff -Naut #{old_file} #{old_file}.new | less"
end
end
@@ -96,10 +88,12 @@
task :default => :spec
begin
require 'yard'
require 'support/yard_handlers'
- YARD::Rake::YardocTask.new
+ YARD::Rake::YardocTask.new do |task|
+ task.options = %w[--debug] # this is pretty slow, so nice with some output
+ end
rescue LoadError
task :yard do
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
end
end