Sha256: c396c95f5434af9662b1ee55d67e31ef0b79c20d87295c01ef0bebee8a624367
Contents?: true
Size: 1.24 KB
Versions: 6
Compression:
Stored size: 1.24 KB
Contents
=begin Copyright 2010-2015 Tasos Laskos <tasos.laskos@arachni-scanner.com> This file is part of the Arachni Framework project and is subject to redistribution and commercial restrictions. Please see the Arachni Framework web site for more information on licensing and terms of use. =end module Arachni require Options.paths.lib + 'rpc/client/base' module RPC class Client # RPC Dispatcher client # # @author Tasos "Zapotek" Laskos <tasos.laskos@arachni-scanner.com> class Dispatcher attr_reader :node def initialize( opts, url ) @client = Base.new( opts, url ) @node = Proxy.new( @client, 'node' ) # map Dispatcher handlers Dir.glob( "#{Options.paths.services}*.rb" ).each do |handler| name = File.basename( handler, '.rb' ) self.class.send( :attr_reader, name.to_sym ) instance_variable_set( "@#{name}".to_sym, Proxy.new( @client, name ) ) end end def url @client.url end def close @client.close end private # Used to provide the illusion of locality for remote methods def method_missing( sym, *args, &block ) @client.call( "dispatcher.#{sym.to_s}", *args, &block ) end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems