A Source
knows how to list and fetch gems from a RubyGems marshal index.
There are other Source
subclasses for installed gems, local gems, the bundler dependency API and so-forth.
The Specification
class contains the information for a Gem. Typically defined in a .gemspec file or a Rakefile, and looks like this:
Gem::Specification.new do |s| s.name = 'example' s.version = '0.1.0' s.licenses = ['MIT'] s.summary = "This is an example!" s.description = "Much longer explanation of the example!" s.authors = ["Ruby Coder"] s.email = 'rubycoder@example.com' s.files = ["lib/example.rb"] s.homepage = 'https://rubygems.org/gems/example' end
Starting in RubyGems 2.0, a Specification
can hold arbitrary metadata. See metadata
for restrictions on the format and size of metadata items you may add to a specification.
Gem::StubSpecification
reads the stub: line from the gemspec. This prevents us having to eval the entire gemspec in order to find out certain information.
Validator
performs various gem file and gem database validation
In order to execute a command on your OS, you need to define it as a Shell
method.
Alternatively, you can execute any command via Shell::CommandProcessor#system
even if it is not defined.
Not a URI
.
Not a URI
component.
A generic logging class
Base TCP server class. You must subclass GenericServer
and provide a run
method.
Provides remote procedure calls to a XML-RPC server.
After setting the connection-parameters with XMLRPC::Client.new
which creates a new XMLRPC::Client
instance, you can execute a remote procedure by sending the XMLRPC::Client#call
or XMLRPC::Client#call2
message to this new instance.
The given parameters indicate which method to call on the remote-side and of course the parameters for the remote procedure.
require "xmlrpc/client" server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80) begin param = server.call("michael.add", 4, 5) puts "4 + 5 = #{param}" rescue XMLRPC::FaultException => e puts "Error:" puts e.faultCode puts e.faultString end
or
require "xmlrpc/client" server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80) ok, param = server.call2("michael.add", 4, 5) if ok then puts "4 + 5 = #{param}" else puts "Error:" puts param.faultCode puts param.faultString end
Raised when the remote procedure returns a fault-structure, which has two accessor-methods faultCode
an Integer
, and faultString
a String.
This is the base class for all XML-RPC server-types (CGI
, standalone). You can add handler and set a default handler. Do not use this server, as this is/should be an abstract class.
The arity (number of accepted arguments) of a handler (method or Proc
object) is compared to the given arguments submitted by the client for a RPC, or Remote Procedure Call.
A handler is only called if it accepts the number of arguments, otherwise the search for another handler will go on. When at the end no handler was found, the default_handler, XMLRPC::BasicServer#set_default_handler
will be called.
With this technique it is possible to do overloading by number of parameters, but only for Proc
handler, because you cannot define two methods of the same name in the same class.
Implements a servlet for use with WEBrick
, a pure Ruby (HTTP) server framework.
require "webrick" require "xmlrpc/server" s = XMLRPC::WEBrickServlet.new s.add_handler("michael.add") do |a,b| a + b end s.add_handler("michael.div") do |a,b| if b == 0 raise XMLRPC::FaultException.new(1, "division by zero") else a / b end end s.set_default_handler do |name, *args| raise XMLRPC::FaultException.new(-99, "Method #{name} missing" + " or wrong number of parameters!") end httpserver = WEBrick::HTTPServer.new(:Port => 8080) httpserver.mount("/RPC2", s) trap("HUP") { httpserver.shutdown } # use 1 instead of "HUP" on Windows httpserver.start
This module provides instance methods for a digest implementation object to calculate message digest values.
Adds basic type aliases to the including class for use with Fiddle::Importer
.
The aliases added are uint
and u_int
(unsigned int
) and ulong
and u_long
(unsigned long
)
Use SSLContext
to set up the parameters for a TLS (former SSL
) connection. Both client and server TLS connections are supported, SSLSocket
and SSLServer
may be used in conjunction with an instance of SSLContext
to set up connections.
let rdoc know about mOSSL
Net::HTTP
exception class. You cannot use Net::HTTPExceptions
directly; instead, you must use its subclasses.
Acceptable argument classes. Now contains DecimalInteger, OctalInteger and DecimalNumeric. See Acceptable argument classes (in source code).
Adds named attributes to an object.