lib/celerity.rb in celerity-0.0.3 vs lib/celerity.rb in celerity-0.0.4

- old
+ new

@@ -4,16 +4,22 @@ Jars = Dir[File.dirname(__FILE__) + '/celerity/htmlunit/*.jar'] end if RUBY_PLATFORM =~ /java/ require 'java' + JavaString = java.lang.String + Celerity::Jars.each { |jar| require(jar) } module HtmlUnit include_package 'com.gargoylesoftware.htmlunit' + + module Html + include_package 'com.gargoylesoftware.htmlunit.html' + end end - JavaString = java.lang.String + else raise "Celerity only works on JRuby at the moment." end # require "rjb" # Rjb::load(Celerity::Jars.join(";")) @@ -33,11 +39,12 @@ require "celerity/container" require "celerity/element" require "celerity/input_element" require "celerity/non_control_elements" Dir[File.dirname(__FILE__) + "/celerity/elements/*.rb"].each { |f| require(f) } -require "celerity/ie" +require "celerity/element_map" +require "celerity/browser" require "celerity/watir_compatibility" require "logger" require "uri" @@ -45,8 +52,9 @@ require "time" Log = Logger.new($DEBUG ? $stderr : nil) Log.level = Logger::DEBUG # undefine deprecated methods to use them for Element attributes -Object.send :undef_method, :id -Object.send :undef_method, :type - +if ["id", "type"].any? { |meth| Object.instance_methods.include?(meth) } + Object.send :undef_method, :id + Object.send :undef_method, :type +end