Sha256: 8488eb126105619c9ce760c108185fd8281ee83e4dad17beee8bb25eebf346a5

Contents?: true

Size: 428 Bytes

Versions: 49

Compression:

Stored size: 428 Bytes

Contents

module Webrat

  def self.hpricot_document(stringlike)
    return stringlike.dom if stringlike.respond_to?(:dom)

    if Hpricot::Doc === stringlike
      stringlike
    elsif Hpricot::Elements === stringlike
      stringlike
    elsif StringIO === stringlike
      Hpricot(stringlike.string)
    elsif stringlike.respond_to?(:body)
      Hpricot(stringlike.body.to_s)
    else
      Hpricot(stringlike.to_s)
    end
  end

end

Version data entries

49 entries across 49 versions & 21 rubygems

Version Path
aslakhellesoy-webrat-0.4.4.1 lib/webrat/core/xml/hpricot.rb
casebook-webrat-0.4.4.1 lib/webrat/core/xml/hpricot.rb
cavalle-webrat-0.4.4.1 lib/webrat/core/xml/hpricot.rb
cavalle-webrat-0.4.4.2 lib/webrat/core/xml/hpricot.rb
davidtrogers-webrat-0.4.4.2 lib/webrat/core/xml/hpricot.rb
dbrady-webrat-0.4.4.1 lib/webrat/core/xml/hpricot.rb
dbrady-webrat-0.4.4.2 lib/webrat/core/xml/hpricot.rb
dbrady-webrat-0.4.4 lib/webrat/core/xml/hpricot.rb
diabolo-diabolo-webrat-0.4.4 lib/webrat/core/xml/hpricot.rb
diabolo-webrat-0.4.3 lib/webrat/core/xml/hpricot.rb
diabolo-webrat-0.4.4.1 lib/webrat/core/xml/hpricot.rb
diabolo-webrat-0.4.4.2 lib/webrat/core/xml/hpricot.rb
diabolo-webrat-0.4.4 lib/webrat/core/xml/hpricot.rb
dstrelau-webrat-0.5.1 lib/webrat/core/xml/hpricot.rb
emipair-webrat-0.0.1 lib/webrat/core/xml/hpricot.rb
futuresinc-webrat-0.4.4.100 lib/webrat/core/xml/hpricot.rb
futuresinc-webrat-0.4.4.99 lib/webrat/core/xml/hpricot.rb
garnierjm-webrat-0.4.5 lib/webrat/core/xml/hpricot.rb
hardbap-webrat-0.5.1 lib/webrat/core/xml/hpricot.rb
hardbap-webrat-0.5.2 lib/webrat/core/xml/hpricot.rb