Module: Goliath

Defined in:
lib/goliath/goliath.rb,
lib/goliath/env.rb,
lib/goliath/api.rb,
lib/goliath/server.rb,
lib/goliath/runner.rb,
lib/goliath/request.rb,
lib/goliath/headers.rb,
lib/goliath/version.rb,
lib/goliath/response.rb,
lib/goliath/constants.rb,
lib/goliath/connection.rb,
lib/goliath/rack/jsonp.rb,
lib/goliath/rack/tracer.rb,
lib/goliath/rack/params.rb,
lib/goliath/test_helper.rb,
lib/goliath/application.rb,
lib/goliath/rack/render.rb,
lib/goliath/rack/heartbeat.rb,
lib/goliath/plugins/latency.rb,
lib/goliath/http_status_codes.rb,
lib/goliath/rack/formatters/xml.rb,
lib/goliath/rack/formatters/html.rb,
lib/goliath/rack/formatters/json.rb,
lib/goliath/rack/validation_error.rb,
lib/goliath/rack/default_mime_type.rb,
lib/goliath/rack/default_response_format.rb,
lib/goliath/rack/validation/boolean_value.rb,
lib/goliath/rack/validation/numeric_range.rb,
lib/goliath/rack/validation/required_value.rb,
lib/goliath/rack/validation/request_method.rb,
lib/goliath/rack/validation/default_params.rb,
lib/goliath/rack/validation/required_param.rb

Overview

The Goliath Framework

Defined Under Namespace

Modules: Constants, Plugin, Rack, TestHelper, Validation Classes: API, Env, Runner

Constant Summary

VERSION =

The current version of Goliath

'0.9.1'
HTTP_STATUS_CODES =

Every standard HTTP code mapped to the appropriate message.

Author:

  • Mongrel.

{
  100 => 'Continue',
  101 => 'Switching Protocols',
  200 => 'OK',
  201 => 'Created',
  202 => 'Accepted',
  203 => 'Non-Authoritative Information',
  204 => 'No Content',
  205 => 'Reset Content',
  206 => 'Partial Content',
  300 => 'Multiple Choices',
  301 => 'Moved Permanently',
  302 => 'Moved Temporarily',
  303 => 'See Other',
  304 => 'Not Modified',
  305 => 'Use Proxy',
  400 => 'Bad Request',
  401 => 'Unauthorized',
  402 => 'Payment Required',
  403 => 'Forbidden',
  404 => 'Not Found',
  405 => 'Method Not Allowed',
  406 => 'Not Acceptable',
  407 => 'Proxy Authentication Required',
  408 => 'Request Time-out',
  409 => 'Conflict',
  410 => 'Gone',
  411 => 'Length Required',
  412 => 'Precondition Failed',
  413 => 'Request Entity Too Large',
  414 => 'Request-URI Too Large',
  415 => 'Unsupported Media Type',
  500 => 'Internal Server Error',
  501 => 'Not Implemented',
  502 => 'Bad Gateway',
  503 => 'Service Unavailable',
  504 => 'Gateway Time-out',
  505 => 'HTTP Version not supported'
}

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) dev?

Determines if we are in the development environment

Returns:

  • (Boolean)

    true if current environemnt is development, false otherwise



39
40
41
# File 'lib/goliath/goliath.rb', line 39

def dev?
  @env == :development
end

- (String) env

Retrieves the current goliath environment

Returns:

  • (String)

    the current environment



14
15
16
# File 'lib/goliath/goliath.rb', line 14

def env
  @env
end

- (Object) env=(env)

Sets the current goliath environment

Parameters:

  • (String) env

    the environment string of [dev|prod|test]



21
22
23
24
25
26
27
# File 'lib/goliath/goliath.rb', line 21

def env=(env)
  case(env.to_s)
  when 'dev'  then @env = :development
  when 'prod' then @env = :production
  when 'test' then @env = :test
  end
end

- (Boolean) prod?

Determines if we are in the production environment

Returns:

  • (Boolean)

    true if current environemnt is production, false otherwise



32
33
34
# File 'lib/goliath/goliath.rb', line 32

def prod?
  @env == :production
end

- (Boolean) test?

Determines if we are in the test environment

Returns:

  • (Boolean)

    true if current environemnt is test, false otherwise



46
47
48
# File 'lib/goliath/goliath.rb', line 46

def test?
  @env == :test
end