The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
HyperActiveRequire

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Britt

Posts: 1319
Nickname: jamesbritt
Registered: Apr, 2003

James Britt is a principal in 30 Second Rule, and runs ruby-doc.org and rubyxml.com
HyperActiveRequire Posted: Jan 3, 2006 12:16 AM
Reply to this message Reply

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
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by James Britt
Latest Posts From James Britt: Ruby Development

Advertisement

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

 

Read: HyperActiveRequire

Topic: Ruby 1.8.4 preview3 Previous Topic   Next Topic Topic: Using Hashes to Memoize

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use