Sha256: 99cdd03b09030b05feed6be179488254d942c1ffd60234d959794640c0d6d349
Contents?: true
Size: 756 Bytes
Versions: 2
Compression:
Stored size: 756 Bytes
Contents
require 'drb' require 'drb/acl' require 'thread' # Load the access control list config = $HELPERS['drb_server'] permissions = [] # For greater control over the ACL if config['raw_acl'] permissions = config['raw_acl'].flatten else [config['deny']].flatten.each { |ip| permissions << "deny" << ip } [config['allow']].flatten.each { |ip| permissions << "allow" << ip } end DRb.install_acl ACL.new(permissions) host = config['host'] || 'localhost' port = config['port'] || 9050 DRb.start_service "druby://#{host}:#{port}", PBX log "Started DRb server on #{DRb.uri}." log "DRb Server Access Control List:" 0.step permissions.length-1, 2 do |i| log " #{permissions[i].upcase} #{permissions[i+1]}" end $HUTDOWN.hook do DRb.stop_service end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
adhearsion-0.7.4 | apps/default/helpers/drb_server.rb |
adhearsion-0.7.5 | apps/default/helpers/drb_server.rb |