Stowing Yer Libraries Off in the Cut-n-Paste #
Starting with what we’ve seen before.
ruby -ropen-uri -e 'eval(open("http://go.hobix.com/").read)'
Then, Francis Hwang gave us urirequire
:
ruby -rurirequire -e 'require "http://go.hobix.com/0.4/"'
Either of these above techniques can be used to execute code from the new cut-and-paste service cl1p. You’ll want to read the code from d.cl1p.net, which serves up the plain/text. Here’s an example which loads Peter Cooper’s text adventure skeleton.
ruby -ropen-uri -e \ 'eval(open("http://d.cl1p.net/ruby/adventure/slightlybetter").read)'
But let’s push this beyond. What if we could add URLs to the lib path?
require 'open-uri' eval(open("http://d.cl1p.net/.rb").read) $HTTP_LOAD_PATH << "http://code.whytheluckystiff.net/svn/parkplace/trunk/lib" require 'parkplace' ParkPlace.serve
Check that out. Instant apps, straight from Subversion! I dare you.
James
Like this?
why
Crap, everybody’s already done everything.
jeem
You were the first to ‘splain programming with cartoon foxes. Of course your book is pretty similar to Jeem’s Doleful Tome o’Fortran 88 (with Cartoony Jackels!) published over decade ago.
All copies have since been destroyed, but everyone says my honesty is beyond reproach, so you can believe me.
why
jeem: Right that’s the one, oh sure sure I think I remember destroying my old copy!! I was 12 and the VCR was paused and my mom was loudly calling out the names of fruit in the other room. I vividly remember urinating on your book right before smashing it with a hammer made of quicklime!! What a feeling. I did this act with ABSOLUTELY NO DISREPECT to you or your fine legacy, those were just the express instructions I deduced from the various motifs you employed.
Now, years later, here you are, and I am utterly unprepared for your visit, my knees are quivering and I am babbling, “cantaloupe… cantaloupe…,” over and over in my mother’s voice. I’ve idolized you now for one-sixth of a century and I just want you to like me back. DO YOU ? DO YOU ??
James: On further inspection of your code, I have made a few notable improvements. The one mentioned above mimicks $LOADED_FEATURES, uses require internally rather than eval, runs $LOAD_PATH in the proper order and has no syntax errors.
Danno
This is like playing golf with bazookas!
I like it!
FlashHater
Perhaps it’s just windows, but I had to modify my parkplacesvn.rb to require camping, mongrel, and sqlite3.
FlashHater
hrm, an idea just came to me. this could be used to create a kind of “Ruby WebStart” with ACLs and everything!
why
FlashHater: It works just right on Windows unless RubyGems is loaded prior to running. Maybe you’ve got
RUBYOPT="-rubygems"
or it got loaded in irb or something. I wonder what the deal is.FlashHater
It might have rubygems loaded on the command line. The Ruby “One Click” Installer does some wierd things with batch files.
aberant
reminds me of how we used to do the same thing back in the day. we would just package up all our punched cards into a box and mail them out. sure the lag was more then this fancy internet thing, but we liked it…
cmo
mmm. side question? Does anyone has similar thing 4 emacs!
Comments are closed for this entry.