module Dizby

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

Constants

ClientArguments
INSECURE_METHODS
PROTOCOL_REGEX
SelfPipe
ServerArguments
SpawnArguments
VERSION

Public Class Methods

any_to_s(obj) click to toggle source
# File lib/dizby/utility/string.rb, line 8
def self.any_to_s(obj)
  "#{obj}:#{obj.class}"
rescue
  format '#<%s:0x%1x>', obj.class, obj.__id__
end
check_hidden_method(obj, msg_id) click to toggle source
# File lib/dizby/access/insecure.rb, line 24
def self.check_hidden_method(obj, msg_id)
  if obj.private_methods.include?(msg_id)
    desc = Dizby.any_to_s(obj)
    raise NoMethodError, "private method `#{msg_id}' called for #{desc}"
  elsif obj.protected_methods.include?(msg_id)
    desc = Dizby.any_to_s(obj)
    raise NoMethodError, "protected method `#{msg_id}' called for #{desc}"
  else
    true
  end
end
check_insecure_method(obj, msg_id) click to toggle source
# File lib/dizby/access/insecure.rb, line 12
def self.check_insecure_method(obj, msg_id)
  unless msg_id.is_a?(Symbol)
    raise ArgumentError, "#{Dizby.any_to_s(msg_id)} is not a symbol"
  end

  if INSECURE_METHODS.include?(msg_id)
    raise SecurityError, "insecure method `#{msg_id}'"
  end

  check_hidden_method(obj, msg_id)
end
get_obj(uri, ref) click to toggle source

returns [success, object]

# File lib/dizby/server/registration.rb, line 21
def self.get_obj(uri, ref)
  @servers.synchronize do
    local_server = @servers.find { |server| server && server.here?(uri) }

    [!local_server.nil?, local_server && local_server.to_obj(ref)]
  end
end
monitor(obj) click to toggle source
# File lib/dizby/utility/monitor.rb, line 10
def self.monitor(obj)
  obj.extend(MonitorMixin)
  obj
end
proxy_backtrace(prefix, exception) click to toggle source
# File lib/dizby/distributed/proxy.rb, line 42
def self.proxy_backtrace(prefix, exception)
  bt = exception.backtrace.reject { |trace| /`__send__'$/ =~ trace }
  bt.map { |trace| %r{\(drb://} =~ trace ? trace : "#{prefix}#{trace}" }
  # TODO: why do we only add the prefix if the trace doesn't start with drb?
  # What about the other schemes?
end
register_server(server) click to toggle source
# File lib/dizby/server/registration.rb, line 12
def self.register_server(server)
  @servers.synchronize { @servers << server }
end
unregister_server(server) click to toggle source
# File lib/dizby/server/registration.rb, line 16
def self.unregister_server(server)
  @servers.synchronize { @servers.delete(server) }
end