Sha256: a1dabd514c7947f6807a6f6c75af77bc2379b59d342c1e01e0b78b978529c4b9

Contents?: true

Size: 1.39 KB

Versions: 23

Compression:

Stored size: 1.39 KB

Contents

module Celerity
  Jars = Dir[File.dirname(__FILE__) + '/htmlunit/*.jar']
  Jars.each { |jar| require(jar) }

  module JsxHelper
    def method_missing(meth, *args, &blk)
      m = ["jsxGet_#{meth}", "jsx_get_#{meth}"].find { |m| respond_to?(m) }
      m ? __send__(m) : super
    end
  end
end

module HtmlUnit
  include_package 'com.gargoylesoftware.htmlunit'

  module Html
    include_package 'com.gargoylesoftware.htmlunit.html'
  end

  module Util
    include_package 'com.gargoylesoftware.htmlunit.util'
  end

end

module Java::OrgW3cDom::NamedNodeMap
  include Enumerable

  def each
    0.upto(getLength - 1) do |idx|
      yield item(idx)
    end
  end
end

module Java::JavaLang::Iterable
  include Enumerable

  def each
    it = iterator
    yield it.next while it.hasNext
  end

end unless Java::JavaLang::Iterable < Enumerable # depends on JRuby version

class Java::ComGargoylesoftwareHtmlunitHtml::HtmlPage
  def inspect
    '#<HtmlPage:0x%s(%s)>' % [self.hash.to_s(16), getWebResponse.getWebRequest.getUrl.toString]
  end
end

class Java::ComGargoylesoftwareHtmlunitHtml::HtmlElement
  def inspect
    '#<%s:0x%s>' % [self.class.name.split("::").last, self.hash.to_s(16)]
  end
end

class Java::ComGargoylesoftwareHtmlunitJavascriptHostHtml::HTMLElement
  include Celerity::JsxHelper
end

class Java::ComGargoylesoftwareHtmlunitJavascriptHostCss::CSSStyleDeclaration
  include Celerity::JsxHelper
end

Version data entries

23 entries across 23 versions & 5 rubygems

Version Path
celerity_thingista-0.9.3 lib/celerity/htmlunit.rb
celerity_thingista-0.9.2 lib/celerity/htmlunit.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/htmlunit.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/htmlunit.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/htmlunit.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/htmlunit.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/htmlunit.rb
celerity-0.9.2 lib/celerity/htmlunit.rb
celerity-0.9.1 lib/celerity/htmlunit.rb
no-click-exception-celerity-0.9.0 lib/celerity/htmlunit.rb
celerity-0.9.0 lib/celerity/htmlunit.rb
celerity-0.8.9 lib/celerity/htmlunit.rb
celerity-0.8.9.pre lib/celerity/htmlunit.rb
celerity-0.8.8 lib/celerity/htmlunit.rb
celerity-0.8.7 lib/celerity/htmlunit.rb
celerity-0.8.6 lib/celerity/htmlunit.rb
celerity-0.8.5 lib/celerity/htmlunit.rb
celerity-0.8.4 lib/celerity/htmlunit.rb
celerity-0.8.2 lib/celerity/htmlunit.rb
celerity-0.8.1 lib/celerity/htmlunit.rb