Results for: "Array"

No documentation available
No documentation available
No documentation available

Generates a index files for use as a gem server.

See ‘gem help generate_index`

No documentation available
No documentation available

Raised when there is an error while building extensions.

No documentation available

Raised when you haven’t provided enough input to your MockGemUi

No documentation available
No documentation available
No documentation available
No documentation available

A header for a tar file

A test case for Gem::Package::Tar* classes

Allows writing of tar files

A FetchError exception wraps up the various possible IO and HTTP failures that could happen while downloading from the internet.

A FetchError that indicates that the reason for not being able to fetch data was that the host could not be contacted

Raised when a bad requirement is encountered

A set which represents the installed gems. Respects all the normal settings that control where to look for installed gems.

No documentation available

Raised if a parameter such as %e, %i, %o or %n is used without fetching a specific field.

No documentation available
No documentation available

AbstractServlet allows HTTP server modules to be reused across multiple servers and allows encapsulation of functionality.

By default a servlet will respond to GET, HEAD (through an alias to GET) and OPTIONS requests.

By default a new servlet is initialized for every request. A servlet instance can be reused by overriding ::get_instance in the AbstractServlet subclass.

A Simple Servlet

class Simple < WEBrick::HTTPServlet::AbstractServlet
  def do_GET request, response
    status, content_type, body = do_stuff_with request

    response.status = status
    response['Content-Type'] = content_type
    response.body = body
  end

  def do_stuff_with request
    return 200, 'text/plain', 'you got a page'
  end
end

This servlet can be mounted on a server at a given path:

server.mount '/simple', Simple

Servlet Configuration

Servlets can be configured via initialize. The first argument is the HTTP server the servlet is being initialized for.

class Configurable < Simple
  def initialize server, color, size
    super server
    @color = color
    @size = size
  end

  def do_stuff_with request
    content = "<p " \
              %q{style="color: #{@color}; font-size: #{@size}"} \
              ">Hello, World!"

    return 200, "text/html", content
  end
end

This servlet must be provided two arguments at mount time:

server.mount '/configurable', Configurable, 'red', '2em'
Search took: 4ms  ·  Total Results: 1642