Creates a new Resolv::Hosts
, using filename
for its data source.
Creates a new DNS
resolver.
config_info
can be:
Uses /etc/resolv.conf.
String
Path to a file using /etc/resolv.conf’s format.
Hash
Must contain :nameserver, :search and :ndots keys.
:nameserver_port can be used to specify port number of nameserver address.
The value of :nameserver should be an address string or an array of address strings.
:nameserver => ‘8.8.8.8’
:nameserver => [‘8.8.8.8’, ‘8.8.4.4’]
The value of :nameserver_port should be an array of pair of nameserver address and port number.
:nameserver_port => [[‘8.8.8.8’, 53], [‘8.8.4.4’, 53]]
Example:
Resolv::DNS.new(:nameserver => ['210.251.121.21'], :search => ['ruby-lang.org'], :ndots => 1)
Creates a new one-shot Multicast DNS
(mDNS) resolver.
config_info
can be:
Uses the default mDNS addresses
Hash
Must contain :nameserver or :nameserver_port like Resolv::DNS#initialize.
Creates a new DRbObjectTemplate
that will match against uri
and ref
.
Creates a new TupleSpaceProxy
to wrap ts
.
Creates a new SimpleRenewer
that keeps an object alive for another sec
seconds.
Advertises ts
on the given addresses
at port
.
If addresses
is omitted only the UDP broadcast address is used.
addresses
can contain multiple addresses. If a multicast address is given in addresses
then the RingServer
will listen for multicast queries.
If you use IPv4 multicast you may need to set an address of the inbound interface which joins a multicast group.
ts = Rinda::TupleSpace.new rs = Rinda::RingServer.new(ts, [['239.0.0.1', '9.5.1.1']])
You can set addresses as an Array
Object
. The first element of the Array
is a multicast address and the second is an inbound interface address. If the second is omitted then ‘0.0.0.0’ is used.
If you use IPv6 multicast you may need to set both the local interface address and the inbound interface index:
rs = Rinda::RingServer.new(ts, [['ff02::1', '::1', 1]])
The first element is a multicast address and the second is an inbound interface address. The third is an inbound interface index.
At this time there is no easy way to get an interface index by name.
If the second is omitted then ‘::1’ is used. If the third is omitted then 0 (default interface) is used.
Creates a new RingFinger
that will look for RingServers at port
on the addresses in broadcast_list
.
If broadcast_list
contains a multicast address then multicast queries will be made using the given multicast_hops
and multicast_interface.
Creates a RingProvider
that will provide a klass
service running on front
, with a description
. renewer
is optional.
Creates a TupleEntry
based on ary
with an optional renewer or expiry time sec
.
A renewer must implement the renew
method which returns a Numeric
, nil, or true to indicate when the tuple has expired.
Creates a new NotifyTemplateEntry
that watches place
for +event+s that match tuple
.
Creates a new TupleSpace
. period
is used to control how often to look for dead tuples after modifications to the TupleSpace
.
If no dead tuples are found period
seconds after the last modification, the TupleSpace
will stop looking for dead tuples.
Initializes a generic gem command named command
. summary
is a short description displayed in ‘gem help commands`. defaults
are the default options. Defaults should be mirrored in defaults_str
, unless there are none.
When defining a new command subclass, use add_option
to add command-line switches.
Unhandled arguments (gem names, files, etc.) are left in options[:args]
.
Register all the subcommands supported by the gem command.
Create the config file object. args
is the list of arguments from the command line.
The following command line options are handled early here rather than later at the time most command options are processed.
--config-file
, --config-file==NAME
Obviously these need to be handled by the ConfigFile
object to ensure we get the right config file.
--backtrace
Backtrace needs to be turned on early so that errors before normal option parsing can be properly handled.
--debug
Enable Ruby level debug messages. Handled early for the same reason as –backtrace.