Category: ruby

  • LibraryFind 0.8.3 tagged

    Jeremy I’m sure will get the tgz version of the file up and ready on the LF site soon, but the 0.8.3 instance of libraryfind has been tagged.  If you are interested in finding out more about libraryfind, see: http://www.libraryfind.org.   –TR

  • LibraryFind code refactoring

    I’ve been spending time this weekend refactoring a major piece of the LibraryFind code partly in an effort to make it easier to add protocol classes.  This change affects a lot of the current API code-base, but the biggest change comes in the meta_search.rb file where nearly all the business logic relating to searching, etc.…

  • Ruby and Date classes

    I’d seen this somewhere before, but thought I’d benchmark it to see if it was true.  Ruby has 3 classes for doing dates.  There is Date, DateTime and Time classes.  In languages like C# and PHP, the equivalent DateTime class is the one that is generally utilized to do date/time manipulations.  However, in Ruby, DateTime…

  • Why I miss strong variable typing in scripting languages

    I love strong typed languages.  Languages that require you to define all variables before use.  They save me from myself, or, from my attrocious spelling.  I was working on LibraryFind, OSU’s opensource metasearch service, three days ago making a few tweaks and changes.  One of the things that this tool has that is somewhat researchy…

  • Google Spell API — Ruby

    Someone had asked if I could post the ruby code we use to interact with the google toolbar spell api.  Well, here it is. require ‘net/https’ require ‘uri’ require ‘rexml/document’ class GoogleSpell def GetWords(phrase) results = [] x = 0 i = 0 phrase = phrase.downcase phrase = phrase.gsub(“&”, “&”) phrase = phrase.gsub(“”, “>”) word_frag…

  • ruby-oai 0.0.3 — thanks ed

    Ed posted revisions to the ruby-oai package.  It includes the ability to utilize libxml as the xml parser.    For those interested, this can now be coupled with the following class to parse a normal dublin core unqualified record into an object version of the record. BTW, I realize that this code makes some use…

  • ruby-oai and processing metadata elements

    Since modifying the ruby-oai module to work with libxml — I’ve found extracting the data from “metadata” to be much easier.  And the nice part — using libxml, I was able to do an initial metadata harvest from 4 collections in under 10 seconds.  Here’s the code from the harvesting component — see below. –TR…

  • More reasons to avoid REXML (like the plague)

    I’ve been having a great time playing with ruby — but one of the things that I find myself constantly running up against is the “ruby way”.  The place where I notice this most is when dealing with XML.  One of the things I’ve noticed in working with XML in ruby is that the ruby…