Set the path to the method or function we want to execute on the remote
machine. Examples:
mod/scorm/functionname
auth/mnet/methodname
In the case of auth and enrolment plugins, an object will be created and
the method on that object will be called
437876
function set_method($xmlrpcpath) {
        if (is_string($xmlrpcpath)) {
            $this->method = $xmlrpcpath;
            $this->params = array();
            return true;
        }
        $this->method = '';
        $this->params = array();
        return false;
    }
1253560
function execute(context, action) {
    if (!remote) return fail(context, "Not connected to a server");
    
    // prepare source path
    if (context.args.length < 1) return fail(context, "Remote path missing");
    var path = remote.join(remotePath, context.args[0]);
    action(path);
}
522163
def __set_method(self, value):
        '''
        
        '''
        if value not in [DELIVERY_METHOD_EMAIL, DELIVERY_METHOD_SMS,
                         DELIVERY_METHOD_SNAILMAIL]:
            raise ValueError("Invalid deliveries method '%s'" % value)

        self.__method = value
211235
def _route(self, action, method):
        

        # First thing, determine the path for the method
        path = method._wsgi_path
        methods = None
        if path is None:
            map_rule = self.wsgi_method_map.get(method.__name__)
            if map_rule is None:
                # Can't connect this method
                LOG.warning("No path specified for action method %s() of "
                            "resource %s" % (method.__name__, self.wsgi_name))
                return

            # Compute the path and the method list
            path = utils.norm_path(map_rule[0] % self.wsgi_name)
            methods = map_rule[1]

        # Compute route name
        name = '%s_%s' % (self.wsgi_name, action)

        # Set up path
        path = getattr(self, 'wsgi_path_prefix', '') + path

        # Build up the conditions
        conditions = {}
        if hasattr(method, '_wsgi_methods'):
            conditions['method'] = methods if methods else method._wsgi_methods
        if hasattr(method, '_wsgi_condition'):
            conditions['function'] = method._wsgi_condition

        # Create the route
        self.wsgi_mapper.connect(name, path,
                                 controller=self,
                                 action=action,
                                 conditions=conditions,
                                 **getattr(method, '_wsgi_keywords', {}))
1352092
def install_alias_method(to, from, override = NO_OVERRIDE)
      to = to.id2name unless to.kind_of?(String)
      from = from.id2name unless from.kind_of?(String)

      if override == OVERRIDE_ALL or
	  (override == OVERRIDE_PRIVATE_ONLY) && !respond_to?(to) or
	  (override == NO_OVERRIDE) &&  !respond_to?(to, true)
	target = self
	(class<<self;self;end).instance_eval{
	  if target.respond_to?(to, true) && 
	      !target.respond_to?(EXCB.irb_original_method_name(to), true)
	    alias_method(EXCB.irb_original_method_name(to), to) 
	  end
	  alias_method to, from
	}
      else
	print "irb: warn: can't alias #{to} from #{from}.\n"
      end
    end
888027
def remote_call(request, cls, method, args, kw):
    '''
    '''
    actor = request.actor
    name = 'remote_%s' % cls.__name__
    if not hasattr(actor, name):
        object = cls(actor)
        setattr(actor, name, object)
    else:
        object = getattr(actor, name)
    method_name = '%s%s' % (PREFIX, method)
    return getattr(object, method_name)(request, *args, **kw)
1335113
def call(method, path, options = {})
      self.logs = []
      clone_config = self.config.clone
      #on occation path will already have prefix (sync cancel)
      path = clone_config[:api_path] + path unless path.start_with?(clone_config[:api_path])

      headers = clone_config[:headers].clone

      get_params = options[:params] if options[:params]
      path = combine_get_params(path, get_params) if get_params

      client_options = {}
      client_options[:timeout] = clone_config[:timeout] if clone_config[:timeout]
      client_options[:open_timeout] = clone_config[:open_timeout] if clone_config[:open_timeout]
      client_options[:verify_ssl] = clone_config[:verify_ssl] unless clone_config[:verify_ssl].nil?

      if clone_config[:oauth]
        self.logger.warn('[DEPRECATION] Pulp oauth is deprecated.  Please use cert_auth instead.')
        headers = add_oauth_header(method, path, headers)
        headers['pulp-user'] = clone_config[:user]
      elsif clone_config[:cert_auth]
        if !clone_config[:cert_auth][:ssl_client_cert] || !clone_config[:cert_auth][:ssl_client_key]
          fail Runcible::ConfigurationUndefinedError, "Missing SSL certificate or key configuration."
        end
        client_options[:ssl_client_cert] = clone_config[:cert_auth][:ssl_client_cert]
        client_options[:ssl_client_key] = clone_config[:cert_auth][:ssl_client_key]
      else
        client_options[:user] = clone_config[:user]
        client_options[:password] = config[:http_auth][:password]
      end

      client_options[:ssl_ca_file] = config[:ca_cert_file] unless config[:ca_cert_file].nil?
      client = RestClient::Resource.new(clone_config[:url], client_options)

      args = [method]
      args << generate_payload(options) if [:post, :put].include?(method)
      args << headers
      starting_arg = options[:no_log_payload] == true ? 2 : 1
      self.logs << ([method.upcase, URI.join(client.url, path)] + args[starting_arg..-1]).join(': ')

      response = get_response(client, path, *args)
      processed = process_response(response)
      self.logs << "Response: #{response.code}: #{response.body}"
      log_debug
      processed
    rescue RestClient::ResourceNotFound => e
      self.logs << exception_to_log(e)
      log_info
      raise e
    rescue => e
      self.logs << exception_to_log(e)
      log_exception
      raise e
    end
1075667
def run_key(self, key):
        '''
        
        '''
        def func(*args, **kwargs):
            '''
            Run a remote call
            '''
            args = list(args)
            for _key, _val in kwargs:
                args.append('{0}={1}'.format(_key, _val))
            return self.local.cmd(self.minion, key, args)
        return func
1328722
def add_method(self, m, **kwargs):
        
        if isinstance(m, types.FunctionType):
            self['function', id(m)] = m
        else:
            f, obj = get_method_vars(m)
            wrkey = (f, id(obj))
            self[wrkey] = obj
1136588
def method_call_path(method_call_tag)
      # r method_call_tag.values_at(:name, :receiver)
      name, receiver, scope = method_call_tag.values_at(:name, :receiver, :scope)
      scope = scope.join("::")

      if receiver == :class
        scope = "Kernel" if scope.empty?
        new_method_path(scope, :class, name)
      elsif receiver == :instance
        scope = "Kernel" if scope.empty?
        new_method_path(scope, :instance, name)
      else
        receiver = receiver.join("::")
        new_method_path(Reflexive.constant_lookup(receiver, scope), :class, name)
      end

#    if receiver.last == :instance
#      new_method_path(receiver[0..-2].join("::"), :instance, name)
#    else
#      new_method_path(receiver.join("::"), :class, name)
#    end rescue(r(method_call_tag))
    end
758281
def map_path_to(*args)
    script_name = args.shift if args.first.to_s =~ %r{^/\w.*}
    path_mapped(script_name, *locations_get_from(*args))
  end
530776
def method_missing(method, *args, &block)
      if method[-1] == '='
        # setter
        key = method.slice(0...-1).to_sym

        unless has_key?(key)
          super
        end
        self[key] = args[0]
      else
        unless has_key?(method)
          super
        end

        prop = self[method]
        if prop.is_a? JSFunction
          prop.call_with_instance(self, *args, &block)
        else
          prop
        end
      end
    end
117781
function setServer(msg, done) {
  var seneca = this
  var context = msg.context || locals.context
  var adapter = msg.adapter || locals.adapter
  var options = msg.options || locals.options
  var auth = msg.auth || locals.auth
  var routes = msg.routes

  // If the adapter is a string, we look up the
  // adapters collection in opts.adapters.
  if (!_.isFunction(adapter)) {
    return done(new Error('Provide a function as adapter'))
  }

  // either replaced or the same. Regardless
  // this sets what is called by mapRoutes.
  locals = {
    context: context,
    adapter: adapter,
    auth: auth,
    options: options
  }

  // If we have routes in the msg map them and
  // let the matter handle the callback
  if (routes) {
    mapRoutes.call(seneca, { routes: routes }, done)
  } else {
    // no routes to process, let the
    // caller know everything went ok.
    done(null, { ok: true })
  }
}
68517
def method_missing(m, *args, &block)
      if args.any?
        args = args.first if args.length == 1
        @var << { m.to_sym => args }
        instance_variable_set "@#{m}", args
      else
        instance_variable_get "@#{m}"
      end
    end
1067697
def call(self, method, *args, **kw):
        
        if args and kw:
            raise ValueError("JSON-RPC method calls allow only either named or positional arguments.")
        if not method:
            raise ValueError("JSON-RPC method call requires a method name.")

        request = self._data_serializer.assemble_request(
            method, args or kw or None
        )

        if self._in_batch_mode:
            self._requests.append(request)
            return request.get('id')
        else:
            return request
413009
def set_root_path!
       raise 'APP_ROOT is not set' unless defined?(::APP_ROOT)
       raise 'APP_ROOT is not a directory' unless File.directory?(::APP_ROOT)

       @root_path =
         # Pathname is incompatible with Windows, but Windows doesn't have
         # real symlinks so File.expand_path is safe.
         if RUBY_PLATFORM =~ /(:?mswin|mingw)/
           File.expand_path(::APP_ROOT)

         # Otherwise use Pathname#realpath which respects symlinks.
         else
           Pathname.new(::APP_ROOT).realpath.to_s
         end

       Object.const_set(:RELATIVE_APP_ROOT, ::APP_ROOT.dup) unless defined?(::RELATIVE_APP_ROOT)
       ::APP_ROOT.replace @root_path
     end
245166
def path_dispatch_rename(rename_like_method):
        

        def _wrapper_method(self, old_path, new_path):
            old_path, _old_path, old_sentinel =  _split_path(old_path);
            new_path, _new_path, new_sentinel =  _split_path(new_path);

            if old_sentinel != new_sentinel:
                raise ValueError('Does not know how to move things across contents manager mountpoints')
            else:
                sentinel = new_sentinel


            man = self.managers.get(sentinel, None)
            if man is not None:
                rename_meth = getattr(man, rename_like_method.__name__)
                sub = rename_meth('/'.join(_old_path), '/'.join(_new_path))
                return sub
            else :
                return rename_meth(self, old_path, new_path)
        return _wrapper_method