Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] nokogiri 1.4.0 Released

Reply
Thread Tools

[ANN] nokogiri 1.4.0 Released

 
 
Aaron Patterson
Guest
Posts: n/a
 
      10-31-2009
Hi everyone! One year ago, I released the first version of nokogiri.
With the help of my extremely handsome partner in crime, Mike Dalessio,
we present to you the latest and greatest of our fine codes.

While you're downloading the new gem, you should check out Nokogiri's
new website at:

http://nokogiri.org/

If you like the cut of that website's jib, you should know it was
designed by one "Shane Becker". Shane was wrongly convicted of an ATM
robbery and broke out of jail. If you can find him, you can hire him.
(Actually, I know where to find him).

nokogiri version 1.4.0 has been released!

* <http://nokogiri.org>
* <http://github.com/tenderlove/nokogiri/wikis>
* <http://github.com/tenderlove/nokogiri/tree/master>
* <http://groups.google.com/group/nokogiri-talk>
* <http://github.com/tenderlove/nokogiri/issues>

Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser. Among Nokogiri's
many features is the ability to search documents via XPath or CSS3
selectors.

XML is like violence - if it doesn’t solve your problems, you are not
using enough of it.

Changes:

### 1.4.0 / 2009/10/30

* Happy Birthday!

* New Features

* Node#at_xpath returns the first element of the NodeSet matching the
XPath
expression.
* Node#at_css returns the first element of the NodeSet matching the CSS
selector.
* NodeSet#| for unions GH #119 (Thanks Serabe!)
* NodeSet#inspect makes prettier output
* Node#inspect implemented for more rubyish document inspecting
* Added XML:TD#external_id
* Added XML:TD#system_id
* Added XML::ElementContent for DTD Element content validity
* Better namespace declaration support in Nokogiri::XML::Builder
* Added XML::Node#external_subset
* Added XML::Node#create_external_subset
* Added XML::Node#create_internal_subset
* XML Builder can append raw strings (GH #141, patch from dudleyf)
* XML::SAX:arserContext added
* XML:ocument#remove_namespaces! for the namespace-impaired

* Bugfixes

* returns nil when HTML documents do not declare a meta encoding tag.
GH #115
* Uses RbConfig::CONFIG['host_os'] to adjust ENV['PATH'] GH #113
* NodeSet#search is more efficient GH #119 (Thanks Serabe!)
* NodeSet#xpath handles custom xpath functions
* Fixing a SEGV when XML::Reader gets attributes for current node
* Node#inner_html takes the same arguments as Node#to_html GH #117
* DocumentFragment#css delegates to it's child nodes GH #123
* NodeSet#[] works with slices larger than NodeSet#length GH #131
* Reparented nodes maintain their namespace. GH #134
* Fixed SEGV when adding an XML:ocument to NodeSet
* XML::SyntaxError can be duplicated. GH #148

* Deprecations

* Hpricot compatibility layer removed

## FEATURES:

* XPath support for document searching
* CSS3 selector support for document searching
* XML/HTML builder

Nokogiri parses and searches XML/HTML very quickly, and also has
correctly implemented CSS3 selector support as well as XPath support.

Here is a speed test:

* http://gist.github.com/24605

## SUPPORT:

The Nokogiri {mailing list}[http://groups.google.com/group/nokogiri-talk]
is available here:

* http://groups.google.com/group/nokogiri-talk

The bug tracker is available here:

* http://github.com/tenderlove/nokogiri/issues

The IRC channel is #nokogiri on freenode.

## SYNOPSIS:

require 'nokogiri'
require 'open-uri'

# Get a Nokogiri::HTMLocument for the page we’re interested in...

doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove'))

# Do funky things with it using Nokogiri::XML::Node methods...

####
# Search for nodes by css
doc.css('h3.r a.l').each do |link|
puts link.content
end

####
# Search for nodes by xpath
doc.xpath('//h3/a[@class="l"]').each do |link|
puts link.content
end

####
# Or mix and match.
doc.search('h3.r a.l', '//h3/a[@class="l"]').each do |link|
puts link.content
end


## REQUIREMENTS:

* ruby 1.8 or 1.9
* libxml2
* libxml2-dev
* libxslt
* libxslt-dev

## INSTALL:

* sudo gem install nokogiri

--
Aaron Patterson
http://tenderlovemaking.com/

 
Reply With Quote
 
 
 
 
Robert Gleeson
Guest
Posts: n/a
 
      10-31-2009
Great work, again! I'm a bit sad to see the hpricot compatiability
layer removed but oh well. Changing times.

Thanks for your work!
Rob
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] nokogiri 1.0.7 Released Aaron Patterson Ruby 1 12-03-2008 04:48 PM
[ANN] nokogiri 1.0.6 Released Aaron Patterson Ruby 2 11-18-2008 03:19 PM
[ANN] nokogiri 1.0.5 Released Aaron Patterson Ruby 4 11-13-2008 09:26 PM
[ANN] nokogiri 1.0.3 Released Aaron Patterson Ruby 0 11-04-2008 10:12 PM
[ANN] nokogiri 1.0.0 Released Aaron Patterson Ruby 0 10-31-2008 01:31 AM



Advertisments