Ruby Sockets (Server and Client)

I’ve needed a server and client Ruby programs and found the following from a Google seach:

[I]require ‘socket’ # Get sockets from stdlib

server = # Socket to listen on port 2000
loop { # Servers run forever
client = server.accept # Wait for a client to connect
client.puts( # Send the time to the client
client.puts “Closing the connection. Bye!”
client.close # Disconnect from the client

[I]require ‘socket’ # Sockets are in standard library

hostname = ‘localhost’
port = 2000

s =, port)

while line = s.gets # Read lines from the socket
puts line.chop # And print with platform line terminator
s.close # Close the socket when done[/I]

What I need to know is how can I execute a ruby script from the client to the server?

I’m trying to write a test harness using Ruby and so far I’ve written a bunch of test cases I can execute on the locale PC. But now I need to be able to execute these test cases remotely and have the results sent back to the “server”.

Can any kind soul lend me a helping hand.

Thank you