[ANN] nokogiri 1.4.0 Released

Discussion in 'Ruby' started by Aaron Patterson, Oct 31, 2009.

  1. 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::DTD#external_id
    * Added XML::DTD#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::parserContext added
    * XML::Document#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::Document 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::HTML:Document 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/
    Aaron Patterson, Oct 31, 2009
    #1
    1. Advertising

  2. Re: nokogiri 1.4.0 Released

    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/.
    Robert Gleeson, Oct 31, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aaron Patterson

    [ANN] nokogiri 1.0.0 Released

    Aaron Patterson, Oct 31, 2008, in forum: Ruby
    Replies:
    0
    Views:
    98
    Aaron Patterson
    Oct 31, 2008
  2. Aaron Patterson

    [ANN] nokogiri 1.0.3 Released

    Aaron Patterson, Nov 4, 2008, in forum: Ruby
    Replies:
    0
    Views:
    114
    Aaron Patterson
    Nov 4, 2008
  3. Aaron Patterson

    [ANN] nokogiri 1.0.5 Released

    Aaron Patterson, Nov 13, 2008, in forum: Ruby
    Replies:
    4
    Views:
    160
    Marcin Raczkowski
    Nov 13, 2008
  4. Aaron Patterson

    [ANN] nokogiri 1.0.6 Released

    Aaron Patterson, Nov 17, 2008, in forum: Ruby
    Replies:
    2
    Views:
    105
    Aaron Patterson
    Nov 18, 2008
  5. Aaron Patterson

    [ANN] nokogiri 1.0.7 Released

    Aaron Patterson, Dec 3, 2008, in forum: Ruby
    Replies:
    1
    Views:
    118
    Avdi Grimm
    Dec 3, 2008
Loading...

Share This Page