The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Stowing Yer Libraries Off in the Cut-n-Paste

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
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Stowing Yer Libraries Off in the Cut-n-Paste Posted: Apr 12, 2006 12:44 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Stowing Yer Libraries Off in the Cut-n-Paste
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

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.

Read: Stowing Yer Libraries Off in the Cut-n-Paste

Topic: ZenTest 3.2.0 Released Previous Topic   Next Topic Topic: Children of the night: RTFM!

Sponsored Links



Google
  Web Artima.com   

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