From: John Ydil Date: 2010-03-04T19:06:11+09:00 Subject: Re: Url parsing in ruby Robert Klemme wrote: > 2010/3/4 John Ydil : >> >>> Maybe we should start over with you describing what you are trying to >>> do. �Your initial posting read like "I have an URL and need to extract >>> a particular part of it". �That's what Brian and I have answered. �I'm >>> afraid, you'll probably have to provide more context or explain where >>> exactly you are stuck. > >> Ok,I'm coding a web page with Ruby. > > And how do you interface with the web server? If you are using Cgi you > can use > http://www.ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html > > Kind regards > > robert I think this lib is for generate html, I didn't see method to get the URL How it works : I told my web server (apache) to use ruby (.rbx extension) In my web page, I use ruby to write html which is interpreted by apache. It looks like : mywebpage.rbx #!/usr/bin/env ruby print "Content-type: text/html\r\n\r\n" require 'rubygems' require 'net/ssh' HOST = '192.168.0.121' USER = 'root' PASS = 'xxxx' Net::SSH.start( HOST, USER, :password => PASS ) do|ssh| result = ssh.exec!('/root/checknas.rb --list') print " Info " print "{html stuff}" print "" end Maybe I don't have the good way of doing this but at least, it works, my web pages are displayed. -- Posted via http://www.ruby-forum.com/.