From: "Ara.T.Howard" Date: 2004-02-12T23:54:58+09:00 Subject: Re: ruby-dev summary: 22688-22826 On Thu, 12 Feb 2004, Tanaka Akira wrote: > Date: Thu, 12 Feb 2004 13:50:54 +0900 > From: Tanaka Akira > Newsgroups: comp.lang.ruby > Subject: Re: ruby-dev summary: 22688-22826 > > In article , > "Ara.T.Howard" writes: > > > * link > > > > as in ld. i say this because it would be used primarily with > > packages/libraires trying to 'link' to dependancies... > > > > the sematics of link would be > > > > - first try relative > > - then try $: > > I can't imagine a situation that needs relative path and $: in single method > because I know a file which pointed by the relative path is exist or not > when I write link '...'. If the file exists, $: is never used. If not, > 'require' can be used instead. the situation is the one where you include a module, say strinio or yaml, with your distribution because it is not yet part of ruby. you would like, however, for your 'require' line to pick up the system one if it is installed locally - i've been here before... > > * relative > > > > a keyword/method to transform a path into a relative one > > The relative keyword needs language change. It's too drastic to this issue. > > I feel the relative method is too tricky. how so? wouldn't a simple method to transform a path suffice? ~/eg/ruby > cat relative.rb require 'pathname' module Kernel def relative path File.join( Pathname.new(File.dirname(File.expand_path(__FILE__))).realpath.to_s, path ) end end p(relative('foo')) p(relative('foo.rb')) p(relative('foo/bar')) #require relative 'foo' ~/eg/ruby > ruby relative.rb "/home/ahoward/eg/ruby/foo" "/home/ahoward/eg/ruby/foo.rb" "/home/ahoward/eg/ruby/foo/bar" am i missing something? > > > * include > > It is already used as Module#include. yes - meant to delete that before sending. regards. -a -- ATTN: please update your address books with address below! =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | STP :: http://www.ngdc.noaa.gov/stp/ | NGDC :: http://www.ngdc.noaa.gov/ | NESDIS :: http://www.nesdis.noaa.gov/ | NOAA :: http://www.noaa.gov/ | US DOC :: http://www.commerce.gov/ | | The difference between art and science is that science is what we | understand well enough to explain to a computer. | Art is everything else. | -- Donald Knuth, "Discover" | | /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' ===============================================================================