Module: Shaf

Includes:
Tasks
Defined in:
lib/shaf/app.rb,
lib/shaf/yard.rb,
lib/shaf/tasks.rb,
lib/shaf/utils.rb,
lib/shaf/errors.rb,
lib/shaf/logger.rb,
lib/shaf/parser.rb,
lib/shaf/router.rb,
lib/shaf/command.rb,
lib/shaf/helpers.rb,
lib/shaf/profile.rb,
lib/shaf/version.rb,
lib/shaf/formable.rb,
lib/shaf/profiles.rb,
lib/shaf/settings.rb,
lib/shaf/generator.rb,
lib/shaf/responder.rb,
lib/shaf/spec/base.rb,
lib/shaf/extensions.rb,
lib/shaf/serializer.rb,
lib/shaf/command/new.rb,
lib/shaf/parser/base.rb,
lib/shaf/parser/json.rb,
lib/shaf/yard/parser.rb,
lib/shaf/command/base.rb,
lib/shaf/command/test.rb,
lib/shaf/helpers/vary.rb,
lib/shaf/resource_doc.rb,
lib/shaf/spec/fixture.rb,
lib/shaf/authenticator.rb,
lib/shaf/formable/form.rb,
lib/shaf/generator/doc.rb,
lib/shaf/responder/hal.rb,
lib/shaf/spec/fixtures.rb,
lib/shaf/tasks/db_task.rb,
lib/shaf/command/server.rb,
lib/shaf/extensions/log.rb,
lib/shaf/formable/field.rb,
lib/shaf/generator/base.rb,
lib/shaf/immutable_attr.rb,
lib/shaf/link_relations.rb,
lib/shaf/responder/base.rb,
lib/shaf/responder/html.rb,
lib/shaf/command/console.rb,
lib/shaf/command/upgrade.rb,
lib/shaf/command/version.rb,
lib/shaf/generator/forms.rb,
lib/shaf/generator/model.rb,
lib/shaf/helpers/payload.rb,
lib/shaf/tasks/test_task.rb,
lib/shaf/upgrade/package.rb,
lib/shaf/upgrade/version.rb,
lib/shaf/command/generate.rb,
lib/shaf/formable/builder.rb,
lib/shaf/generator/helper.rb,
lib/shaf/generator/policy.rb,
lib/shaf/helpers/paginate.rb,
lib/shaf/parser/form_data.rb,
lib/shaf/profile/relation.rb,
lib/shaf/spec/system_spec.rb,
lib/shaf/upgrade/manifest.rb,
lib/shaf/yard/link_object.rb,
lib/shaf/generator/profile.rb,
lib/shaf/helpers/json_html.rb,
lib/shaf/profile/attribute.rb,
lib/shaf/profile/evaluator.rb,
lib/shaf/profile/unique_id.rb,
lib/shaf/tasks/routes_task.rb,
lib/shaf/authenticator/base.rb,
lib/shaf/generator/scaffold.rb,
lib/shaf/profiles/shaf_form.rb,
lib/shaf/spec/authenticator.rb,
lib/shaf/spec/payload_utils.rb,
lib/shaf/command/test/filter.rb,
lib/shaf/command/test/runner.rb,
lib/shaf/generator/migration.rb,
lib/shaf/helpers/http_header.rb,
lib/shaf/profiles/shaf_basic.rb,
lib/shaf/profiles/shaf_error.rb,
lib/shaf/registrable_factory.rb,
lib/shaf/responder/alps_json.rb,
lib/shaf/yard/profile_object.rb,
lib/shaf/alps/json_serializer.rb,
lib/shaf/extensions/authorize.rb,
lib/shaf/generator/controller.rb,
lib/shaf/generator/serializer.rb,
lib/shaf/spec/serializer_spec.rb,
lib/shaf/yard/resource_object.rb,
lib/shaf/authenticator/request.rb,
lib/shaf/extensions/api_routes.rb,
lib/shaf/helpers/cache_control.rb,
lib/shaf/middleware/request_id.rb,
lib/shaf/spec/integration_spec.rb,
lib/shaf/yard/attribute_object.rb,
lib/shaf/helpers/authentication.rb,
lib/shaf/responder/problem_json.rb,
lib/shaf/spec/http_method_utils.rb,
lib/shaf/supported_http_methods.rb,
lib/shaf/yard/nested_attributes.rb,
lib/shaf/authenticator/challenge.rb,
lib/shaf/authenticator/parameter.rb,
lib/shaf/yard/serializer_handler.rb,
lib/shaf/alps/relation_serializer.rb,
lib/shaf/authenticator/basic_auth.rb,
lib/shaf/extensions/resource_uris.rb,
lib/shaf/generator/migration/base.rb,
lib/shaf/generator/migration/type.rb,
lib/shaf/yard/base_method_handler.rb,
lib/shaf/yard/link_method_handler.rb,
lib/shaf/alps/attribute_serializer.rb,
lib/shaf/generator/migration/empty.rb,
lib/shaf/generator/migration/types.rb,
lib/shaf/extensions/symbolic_routes.rb,
lib/shaf/extensions/controller_hooks.rb,
lib/shaf/yard/profile_method_handler.rb,
lib/shaf/command/test/runnable_method.rb,
lib/shaf/generator/migration/add_index.rb,
lib/shaf/yard/attribute_method_handler.rb,
lib/shaf/generator/migration/add_column.rb,
lib/shaf/generator/migration/drop_column.rb,
lib/shaf/generator/migration/create_table.rb,
lib/shaf/generator/migration/rename_column.rb

Defined Under Namespace

Modules: ALPS, ApiRoutes, Authentication, Authenticator, Authorize, CacheControl, Command, ControllerHooks, Errors, Formable, Generator, Helpers, HttpHeader, ImmutableAttr, JsonHtml, Log, Middleware, Paginate, Parser, Payload, Profiles, RegistrableFactory, ResourceUris, Responder, Spec, SymbolicRoutes, Tasks, Upgrade, UriHelper, UriHelperMethods, Utils, Vary, Yard Classes: App, CreateUriMethods, Error, LinkRelations, MethodBuilder, Profile, ResourceDoc, Router, Serializer, Settings

Constant Summary collapse

VERSION =
'3.0.1'
SUPPORTED_HTTP_METHODS =
[
  :get,
  :put,
  :post,
  :patch,
  :delete,
  :head,
  :options,
  :link,
  :unlink
]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.logger=(value) ⇒ Object (writeonly)

Sets the attribute logger

Parameters:

  • value

    the value to set the attribute logger to.



5
6
7
# File 'lib/shaf/logger.rb', line 5

def logger=(value)
  @logger = value
end

Class Method Details

.extensionsObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/shaf/extensions.rb', line 9

def self.extensions
  [
    Log,
    ResourceUris,
    ControllerHooks,
    Authorize,
    SymbolicRoutes,
    ApiRoutes # This extension must be registered after `SymbolicRoutes`!
  ]
end

.helpersObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/shaf/helpers.rb', line 10

def self.helpers
  [
    CacheControl,
    JsonHtml,
    Paginate,
    Payload,
    HttpHeader,
    Authentication,
    Vary,
  ]
end

.logObject Also known as: logger



7
8
9
# File 'lib/shaf/logger.rb', line 7

def log
  @logger ||= Logger.new('/dev/null')
end