Hi everyone, I'm pleased to announce the release of Ruby/Google 0.4.0. This version of the software introduces slight incompatibilities with previous releases: - The directoryCategories member of the Struct::Response returned by Search.new is now of type Struct::DirectoryCategory. A Struct::DirectoryCategory contains two attributes, fullViewableName and specialEncoding. - For consistency with the above change, the directoryName member of the Struct::ResultElement returned by ResultElement.new was renamed fullViewableName. The directoryEncoding member of the Struct::ResultElement was renamed specialEncoding. The following new features have been added: - A new class method, Search.query_length_ok?, was added. This takes a String parameter and returns either true or false, depending on whether or not the query string is within the limits specified by the Google Web API. - A new class method, Search.query_words_ok?, was added. This takes a String parameter and returns either true or false, depending on whether or not the number of words in the query string is within the limits specified by the Google Web API. - A new class method, Search.query_sites_ok?, was added. This takes a String parameter and returns either true or false, depending on whether or not the number of 'site:'restict clauses in the query string is within the limits specified by the Google Web API. - A new class method, Search.query_ok?, was added. This encapsulating method takes a String parameter and returns either true or false, depending on whether or not the query string passes all of the tests imposed by the Search.query_length_ok?, Search.query_words_ok? and Search.query_sites_ok? methods. - A new class method, Search.restrict, was added. This takes two parameters, type and *data, and assembles a query term consisting of a restrict type and its parameters. If type is phrase, a double-quoted copy of each string passed as *data is returned. If type is daterange, the first three parameters of *data must be the year, month, and day of a start date. The next three parameters, if given, form the year, month, and day of an end date. If these last three parameters are not given, today's date will be substituted. Other supported restrict types are site, intitle, allintitle, inurl, allinurl, allintext, allinlinks, filetype, notfiletype, info, link, related, cache, include and exclude. Some of these names differ slightly from those given in section 2.2 of APIs_Reference.html in order to simplify their use and memorability. When the restrict type is neither phrase nor daterange, it's possible to assemble multiple restrict terms of the same type in a single call to Search#restrict, by simply extending the parameter list when you invoke the method. The code has been cleaned up in several places and the documentation has been expanded and improved. As always, the software can be found at http://www.caliban.org/ruby/ Suggestions for improvements are, as ever, gratefully received. Ian -- Ian Macdonald | The gent who wakes up and finds himself a ian / caliban.org | success hasn't been asleep. | | |