This post originated from an RSS feed registered with Ruby Buzz
by James Britt.
Original Post: HyperActiveRequire
Feed Title: James Britt: Ruby Development
Feed URL: http://feeds.feedburner.com/JamesBritt-Home
Feed Description: James Britt: Playing with better toys
Some months ago , Francis Hwang made a post to ruby-talk about his code for munging Kernel#require so that one could write Ruby such as this:
require 'http://www.foobar/baz/somelib'
And Ruby would happily load the code served up from that URL.
I've been a fan of URLs for everything for some time, so I liked this, but I wasn't crazy about the developer having to know the complete URL, or even that the file migt not be local.
I added to the thread with my own version, which allows one to add URLs to LOAD_PATH; from then on, Ruby would try to fetch the required code from Web sites just as it would from the local file system. (The code just handles HTTP, but expanding it would be fairly trivial.)
I then pretty much forgot about it.
However, it seems that Francis has been revamping his Web site, causing older posts to resurface in my RSS reader.
This prompted me to take another look at my code and write up an example for the O'Reilly Ruby blog, showing off what I dubbed HyperActiveRequire