Sha256: 236a59cd6c93719b1d0fd9e200132d6bd37b84b9fb4102c32bb814f2a7c702d4

Contents?: true

Size: 985 Bytes

Versions: 31

Compression:

Stored size: 985 Bytes

Contents

#require 'hpricot/htmlinfo'

def Hpricot(input = nil, opts = {}, &blk)
  Hpricot.make(input, opts, &blk)
end

module Hpricot
  # Exception class used for any errors related to deficiencies in the system when
  # handling the character encodings of a document.
  class EncodingError < StandardError; end

  # Hpricot.parse parses <i>input</i> and return a document tree.
  # represented by Hpricot::Doc.
  def Hpricot.parse(input = nil, opts = {}, &blk)
    make(input, opts, &blk)
  end

  # Hpricot::XML parses <i>input</i>, disregarding all the HTML rules
  # and returning a document tree.
  def Hpricot.XML(input = nil, opts = {}, &blk)
    opts.merge! :xml => true
    make(input, opts, &blk)
  end

  # :stopdoc:

  def Hpricot.make(input = nil, opts = {}, &blk)
    if blk
      doc = Hpricot.build(&blk)
      doc.instance_variable_set("@options", opts)
      doc
    else
      Hpricot.scan(input, opts)
    end
  end

  # :startdoc:
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
green_shoes-1.1.374 lib/ext/hpricot/parse.rb
green_shoes-1.1.373 lib/ext/hpricot/parse.rb
green_shoes-1.1.367 lib/ext/hpricot/parse.rb
green_shoes-1.1.366 lib/ext/hpricot/parse.rb
green_shoes-1.1.365 lib/ext/hpricot/parse.rb
green_shoes-1.1.364 lib/ext/hpricot/parse.rb
green_shoes-1.1.363 lib/ext/hpricot/parse.rb
green_shoes-1.1.362 lib/ext/hpricot/parse.rb
green_shoes-1.1.358 lib/ext/hpricot/parse.rb
green_shoes-1.1.357 lib/ext/hpricot/parse.rb
green_shoes-1.1.354 lib/ext/hpricot/parse.rb
green_shoes-1.1.348 lib/ext/hpricot/parse.rb
green_shoes-1.0.337 lib/ext/hpricot/parse.rb
green_shoes-1.0.331 lib/ext/hpricot/parse.rb
green_shoes-1.0.322 lib/ext/hpricot/parse.rb
green_shoes-1.0.320 lib/ext/hpricot/parse.rb
green_shoes-1.0.309 lib/ext/hpricot/parse.rb
green_shoes-1.0.303 lib/ext/hpricot/parse.rb
green_shoes-1.0.282 lib/ext/hpricot/parse.rb
green_shoes-1.0.273 lib/ext/hpricot/parse.rb