lib/config.rb
# Define a new group and its associated hosts.
# Usage:
#   group :db,  "db1.example.com", "db2.example.com"
#   group :app, "app1.example.com", "app2.example.com"
#
Define a new group and its associated hosts.
Define a new group and its associated hosts .
def group(which, *args)
    which = which.to_sym
    $hosts[which] ||= []
    args.each { |host| $hosts[which] << host }
  end
def group ( which , * args ) which = which . to_sym $hosts [ which ] ||= [ ] args . each { | host | $hosts [ which ] << host } end
Define a new group and its associated hosts.
Define a new group and its associated hosts .
# The groups Hash is defined so that unrecognized keys always auto-initialize # to a new Group instance (see the assignment in the initialize_with_groups method, # above). However, we explicitly assign here so that group declarations will # vivify the group object even if there are no host arguments. (Otherwise, # group(:app) won't actually instantiate a Group object for :app.)
which
<not_specific>
args
<not_specific>