instiki/vendor/madeleine-0.7.1/samples/dictionary_client.rb
2005-01-15 20:26:54 +00:00

24 lines
351 B
Ruby
Executable file

#
# Dictionary client
#
# See dictionary_server.rb for details
#
require 'drb'
DRb.start_service
dictionary = DRbObject.new(nil, "druby://localhost:1234")
if ARGV.length == 1
puts dictionary.lookup(ARGV[0])
elsif ARGV.length == 2
dictionary.add(ARGV[0], ARGV[1])
puts "Stored"
else
puts "Usage: dictionary_client <key> [<value>]"
end