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 | d4dc240d771dafda758761612567b96ac6b5bae7 (patch) | |
| tree | 780f8255d1204e4c0d70757ee1ea33726ecfd65c /ruby/examples | |
| parent | 02b38cd26fd964beff65f4afde6d10e44b84e3d1 (diff) | |
| download | qpid-python-d4dc240d771dafda758761612567b96ac6b5bae7.tar.gz | |
updated release notes, added a readme, and tweaked examples
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@724905 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'ruby/examples')
| -rw-r--r-- | ruby/examples/hello-world.rb | 10 | ||||
| -rw-r--r-- | ruby/examples/qmf-libvirt.rb | 1 |
2 files changed, 8 insertions, 3 deletions
diff --git a/ruby/examples/hello-world.rb b/ruby/examples/hello-world.rb index 9cddf93ae0..755d13bd54 100644 --- a/ruby/examples/hello-world.rb +++ b/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/ruby/examples/qmf-libvirt.rb b/ruby/examples/qmf-libvirt.rb index 128cfb95ee..492f4fe8d6 100644 --- a/ruby/examples/qmf-libvirt.rb +++ b/ruby/examples/qmf-libvirt.rb @@ -18,7 +18,6 @@ # under the License. # -require "rubygems" require "qpid" s = Qpid::Qmf::Session.new() |
