tenderlove / nokogiri

Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser with XPath and CSS selector support.

This URL has Read+Write access

nokogiri / lib / nokogiri.rb
08450f39 » tenderlove 2008-08-19 auto generating the IDL int... 1 require 'nokogiri/version'
34102644 » tenderlove 2008-07-18 adding the html and xml parser 2 require 'nokogiri/xml'
5ff03ff3 » tenderlove 2008-08-24 adding xslt support 3 require 'nokogiri/xslt'
34102644 » tenderlove 2008-07-18 adding the html and xml parser 4 require 'nokogiri/html'
221a44e7 » tenderlove 2008-09-15 adding decoration to nokogi... 5 require 'nokogiri/decorators'
38d3bfbd » tenderlove 2008-09-17 starting the css selector ast 6 require 'nokogiri/css'
221a44e7 » tenderlove 2008-09-15 adding decoration to nokogi... 7 require 'nokogiri/html/builder'
8a45571f » flavorjones 2008-09-15 added Nokogiri(), Nokogiri.... 8 require 'nokogiri/hpricot'
85b1f6d7 » tenderlove 2008-09-11 starting the move to C 9 require 'nokogiri/native'
e7f98b6c » tenderlove 2008-07-14 initial checkin 10
9eebaa08 » tenderlove 2008-07-14 breaking up nokogiri 11 module Nokogiri
e7f98b6c » tenderlove 2008-07-14 initial checkin 12 class << self
449e7c5a » tenderlove 2008-07-18 working on new api 13 def parse(string, url = nil, encoding = nil, options = 32)
14 doc =
15 if string =~ /^\s*<[^Hh>]*html/i # Probably html
34102644 » tenderlove 2008-07-18 adding the html and xml parser 16 Nokogiri::HTML.parse(string, url, encoding, options)
449e7c5a » tenderlove 2008-07-18 working on new api 17 else
34102644 » tenderlove 2008-07-18 adding the html and xml parser 18 Nokogiri::XML.parse(string, url, encoding, options)
449e7c5a » tenderlove 2008-07-18 working on new api 19 end
20 yield doc if block_given?
21 doc
e7f98b6c » tenderlove 2008-07-14 initial checkin 22 end
8a45571f » flavorjones 2008-09-15 added Nokogiri(), Nokogiri.... 23
24 def XML(string)
25 Nokogiri::XML.parse(string)
26 end
1c4e553b » flavorjones 2008-09-16 implemented NodeSet.wrap() ... 27
28 def make(input = nil, opts = {}, &blk)
29 if input
30 Nokogiri::XML::Node.new_from_str(input)
31 else
32 Nokogiri &blk
33 end
34 end
8a45571f » flavorjones 2008-09-15 added Nokogiri(), Nokogiri.... 35 end
36 end
37
38 def Nokogiri(*args, &block)
39 if block_given?
1c4e553b » flavorjones 2008-09-16 implemented NodeSet.wrap() ... 40 builder = Nokogiri::HTML::Builder.new(&block)
8a45571f » flavorjones 2008-09-15 added Nokogiri(), Nokogiri.... 41 return builder.doc
42 else
43 Nokogiri::HTML.parse(*args)
e7f98b6c » tenderlove 2008-07-14 initial checkin 44 end
45 end