From: g-3 Date: 2002-02-06T17:36:18+09:00 Subject: Re: WWW Library Thanks for the help, I will try out with Ruby 1.7.2. but there is not much document on this topic. thanks ganesan >Hi, > >At Wed, 6 Feb 2002 14:05:43 +0900, >g-3 wrote: >> I am searching for a class / or sample in Ruby for getting the Host >> name and File Paht from a url... >> Just like the URL class in Java. >> >> for Example url = "http://www.hostname.com/~testme/test.html" >> host = getHost ( url ) >> and soo on.. > >URI class is contained in 1.7 standard library. > > $ ruby -v -ruri -e ' > > uri = URI.parse("http://www.hostname.com/~testme/test.html") > > p uri.host' > ruby 1.7.2 (2002-02-05) [i686-linux] > "www.hostname.com" > >Or you can get it from `rough' in cvs. Login following >instruction at , and >export rough/lib/uri. > > $ cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src login > (Logging in to anonymous@cvs.ruby-lang.org) > CVS password: # just type `anonymous' here. > $ cvs -d :pserver:anonymous@cvs.ruby-lang.org:/src export -rHEAD rough/lib/uri > >-- >Nobu Nakada -- g-3 mailto:ganesan-ml@ganekun.com