From 9a841e70f1c69d1a009cdf489fda36e29e7cdbeb Mon Sep 17 00:00:00 2001 From: "Rafael H. Schloming" Date: Tue, 9 Dec 2008 21:44:26 +0000 Subject: updated release notes, added a readme, and tweaked examples git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@724905 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/ruby/examples/hello-world.rb | 10 ++++++++-- qpid/ruby/examples/qmf-libvirt.rb | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'qpid/ruby/examples') diff --git a/qpid/ruby/examples/hello-world.rb b/qpid/ruby/examples/hello-world.rb index 9cddf93ae0..755d13bd54 100644 --- a/qpid/ruby/examples/hello-world.rb +++ b/qpid/ruby/examples/hello-world.rb @@ -18,11 +18,17 @@ # under the License. # -require "rubygems" require "qpid" require "socket" -conn = Qpid::Connection.new(TCPSocket.new("localhost", 5672)) +broker = if ARGV.length > 0 then ARGV[0] else "localhost" end +port = if ARGV.length > 1 then ARGV[1].to_i else 5672 end +if ARGV.length > 2 then + puts "usage: hello-world.rb [ [ ] ]" + exit 1 +end + +conn = Qpid::Connection.new(TCPSocket.new(broker, port)) conn.start(10) ssn = conn.session("test") diff --git a/qpid/ruby/examples/qmf-libvirt.rb b/qpid/ruby/examples/qmf-libvirt.rb index 128cfb95ee..492f4fe8d6 100644 --- a/qpid/ruby/examples/qmf-libvirt.rb +++ b/qpid/ruby/examples/qmf-libvirt.rb @@ -18,7 +18,6 @@ # under the License. # -require "rubygems" require "qpid" s = Qpid::Qmf::Session.new() -- cgit v1.2.1