diff options
| author | Rafael H. Schloming <rhs@apache.org> | 2008-12-09 21:44:26 +0000 |
|---|---|---|
| committer | Rafael H. Schloming <rhs@apache.org> | 2008-12-09 21:44:26 +0000 |
| commit | 9a841e70f1c69d1a009cdf489fda36e29e7cdbeb (patch) | |
| tree | d19b659a7a3c8ceaf4d2aafaa0e06865970797c2 /qpid/ruby/examples | |
| parent | b8d419092b87652996ab341eff482bff32c2f386 (diff) | |
| download | qpid-python-9a841e70f1c69d1a009cdf489fda36e29e7cdbeb.tar.gz | |
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
Diffstat (limited to 'qpid/ruby/examples')
| -rw-r--r-- | qpid/ruby/examples/hello-world.rb | 10 | ||||
| -rw-r--r-- | qpid/ruby/examples/qmf-libvirt.rb | 1 |
2 files changed, 8 insertions, 3 deletions
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 [ <broker> [ <port> ] ]" + 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() |
