From: Jack Dempsey Date: 2002-01-07T11:45:43+09:00 Subject: [ruby-talk:30403] Re: snippet exchange (was: Re: Re: chomp for arrays?) Sounds great! Perhaps something like 'net-require' or 'net-load'...I'll write a small version of it tonight... Jack ----- Original Message ----- From: "Mark Hahn" To: "ruby-talk ML" Sent: Sunday, January 06, 2002 9:29 PM Subject: [ruby-talk:30398] Re: snippet exchange (was: Re: Re: chomp for arrays?) Thanks. I'd be happy to host the repository. I could get a unique .org domain name so that if the repository moves, it can still be accesed with this domain name and super-require won't break. Anyone got a better name than 'super-require'? The domain name could be the same name as the command. It would be nice if each snippet was simply some url like: "http://rubystore.org/autoload/xlib.gem" where the require code is "super_require 'xlib'". This implies the super-require name (xlib) be unique in the repository. -----Original Message----- From: Jack Dempsey [mailto:dabigdemp@hotmail.com] Sent: Sunday, January 06, 2002 5:42 PM To: Mark Hahn Subject: Re: [ruby-talk:30369] Re: snippet exchange (was: Re: Re: chomp for arrays?) I don't think that would be very hard to implement...I suppose it could work as follows: 1. attempt to include the file 2. if this fails, connect to the server 3. download the file 4. include it then then you'd have it in the future... i think before we write this method though we'd need that repository...i'll keep it in mind if our snippet exchange idea takes off... Jack ----- Original Message ----- From: "Mark Hahn" To: "ruby-talk ML" Sent: Sunday, January 06, 2002 4:31 PM Subject: [ruby-talk:30369] Re: snippet exchange (was: Re: Re: chomp for arrays?) A daydream of mine is a "super-require" that if the file was not found, the loader would go to a central place on the web and load it (sort of like marimba). I don't tend to use other people's modules just because I'm too lazy to find and install them. ----- Original Message ----- From: "David Alan Black" To: "ruby-talk ML" Sent: Sunday, January 06, 2002 10:05 AM Subject: [ruby-talk:30357] snippet exchange (was: Re: Re: chomp for arrays?) > Hello -- > > On Sat, 5 Jan 2002, Massimiliano Mirra wrote: > > > On Sat, Jan 05, 2002 at 04:53:14AM +0900, Adam Spitz wrote: > > > > > I want to see a big collection of all the methods that people have > > > added to the built-in Ruby classes. I want to look over them and > > > take the ones that look cool and play with them myself and improve > > > them if I can. > > > > Well, at least your snippet has earned a one way ticket to *my* > > xenumerable.rb. each_send is a great idea. > > > > Which leads me to: this is a context where size does *not* matter. > > Sometimes after banging my head against the wall for an hour to solve > > a problem, I come up with a one- or two-liner that solves it elegantly > > and go ``Cool!''. > > > > Then I think that it would be nice to share it with others, yet the > > RAA is no place for one-liners and the list doesn't seem appropriate > > for snippets unless requested (for one thing, more people could easily > > post very similar snippets in time). This is not limited to > > x[object].rb's but also regards idioms and solutions not pertaining to > > builtin classes extension. > > See [ruby-talk:14556] for a kind of cry-from-the-deep about this from > last May. I continue to think that we're underutilizing what we've > got. That may be true in other language communities too -- but Ruby > lends itself to... well, like I said, see 14556 :-) > > > Does anyone see such a repository of ``molecules'' as possible? It > > looks like it sits in the same domain of RubyGems, RAA.succ etc., > > i.e. a system to store and classify some things against various > > parameters and allow people to post, get and update such elements. > > I definitely see it as possible, especially if you're talking about > adding methods rather than changing methods. Actually I was aiming > for both in Ruby Behaviors (see [ruby-talk:18803], also my talk on > http://www.chadfowler.com/rubyconf.html), which may be why that > project is still resting comfortably in a pre-alpha-ish stage. (Aside > to David Simmons: finished selector namespaces for Ruby yet? :-) > > I've talked to Ryan "Ruby Gems" L. quite a bit about the relation > between Ruby Gems and Ruby Behaviors (the latter being not necessarily > identical to what you're envisioning, but relevant enough for > comparison), and our feeling (Ryan? yes? :-) has always been that > something like a Behaviors package, or cluster of small additions to > Ruby, could itself be packaged as a Gem. So it wouldn't have to be a > different or parallel distribution system -- it could just essentially > be 'require'd at runtime like any Gem/library/etc. Then behind the > scenes, or before the fact, so to speak, it could all have been > organized and cleared for namespace conflicts and so on prior to > becoming a Gem. > > I have to admit, though, I wouldn't mind seeing more code-sharing at > the snippet level, with some at least serviceable management of > namespace conflicts, even before all this packaging stuff is sorted > out. > > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav >