diff options
-rw-r--r-- | qpid/ruby/README.txt | 22 | ||||
-rw-r--r-- | qpid/ruby/RELEASE_NOTES | 5 | ||||
-rw-r--r-- | qpid/ruby/examples/hello-world.rb | 10 | ||||
-rw-r--r-- | qpid/ruby/examples/qmf-libvirt.rb | 1 |
4 files changed, 33 insertions, 5 deletions
diff --git a/qpid/ruby/README.txt b/qpid/ruby/README.txt new file mode 100644 index 0000000000..b68a41b7b4 --- /dev/null +++ b/qpid/ruby/README.txt @@ -0,0 +1,22 @@ += INSTALLATION = + +Extract the release archive into a directory of your choice and set +your RUBYLIB environment variable accordingly: + + tar -xzf qpid-ruby-<version>.tar.gz -C <install-prefix> + export RUBYLIB=<install-prefix>/qpid-<version>/ruby/lib + += GETTING STARTED = + +The ruby client includes a simple hello-world example that publishes +and consumes a message: + + cp <install-prefix>/qpid-<version>/ruby/examples/hello-world.rb . + ./hello-world.rb + += RUNNING THE TESTS = + +The "tests" directory contains a collection of unit tests for the ruby +client. These can be run with the Rakefile provided: + + ./rake test diff --git a/qpid/ruby/RELEASE_NOTES b/qpid/ruby/RELEASE_NOTES index 6b40f54eb0..29760bd83a 100644 --- a/qpid/ruby/RELEASE_NOTES +++ b/qpid/ruby/RELEASE_NOTES @@ -2,8 +2,7 @@ Apache Qpid Ruby M4 Release Notes --------------------------------- The Qpid M4 release of the ruby client contains support the for AMQP -0-10 & 0-8 specifications (as well as support for the non-WIP portion -of the 0-9 specification). See: +0-10 & 0-8 specifications. See: http://jira.amqp.org/confluence/display/AMQP/Download @@ -12,3 +11,5 @@ our project page at: http://cwiki.apache.org/confluence/display/qpid/Index +The README file provided contains some details on installing and using +the ruby client that is included with this distribution. 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() |