Module: Praxis

Defined in:
lib/praxis/multipart/parser.rb,
lib/praxis.rb,
lib/praxis/links.rb,
lib/praxis/route.rb,
lib/praxis/stage.rb,
lib/praxis/stats.rb,
lib/praxis/config.rb,
lib/praxis/plugin.rb,
lib/praxis/router.rb,
lib/praxis/request.rb,
lib/praxis/version.rb,
lib/praxis/response.rb,
lib/praxis/callbacks.rb,
lib/praxis/exception.rb,
lib/praxis/bootloader.rb,
lib/praxis/collection.rb,
lib/praxis/controller.rb,
lib/praxis/dispatcher.rb,
lib/praxis/file_group.rb,
lib/praxis/media_type.rb,
lib/praxis/application.rb,
lib/praxis/handlers/xml.rb,
lib/praxis/error_handler.rb,
lib/praxis/handlers/json.rb,
lib/praxis/notifications.rb,
lib/praxis/api_definition.rb,
lib/praxis/multipart/part.rb,
lib/praxis/plugin_concern.rb,
lib/praxis/responses/http.rb,
lib/praxis/types/multipart.rb,
lib/praxis/api_general_info.rb,
lib/praxis/action_definition.rb,
lib/praxis/exceptions/config.rb,
lib/praxis/handlers/www_form.rb,
lib/praxis/response_template.rb,
lib/praxis/simple_media_type.rb,
lib/praxis/resource_definition.rb,
lib/praxis/response_definition.rb,
lib/praxis/exceptions/validation.rb,
lib/praxis/media_type_collection.rb,
lib/praxis/media_type_identifier.rb,
lib/praxis/request_stages/action.rb,
lib/praxis/restful_doc_generator.rb,
lib/praxis/exceptions/config_load.rb,
lib/praxis/request_stages/response.rb,
lib/praxis/request_stages/validate.rb,
lib/praxis/types/media_type_common.rb,
lib/praxis/exceptions/invalid_trait.rb,
lib/praxis/bootloader_stages/routing.rb,
lib/praxis/exceptions/stage_not_found.rb,
lib/praxis/responses/validation_error.rb,
lib/praxis/exceptions/invalid_response.rb,
lib/praxis/request_stages/load_request.rb,
lib/praxis/exceptions/config_validation.rb,
lib/praxis/plugins/praxis_mapper_plugin.rb,
lib/praxis/request_stages/request_stage.rb,
lib/praxis/bootloader_stages/environment.rb,
lib/praxis/bootloader_stages/file_loader.rb,
lib/praxis/bootloader_stages/plugin_setup.rb,
lib/praxis/bootloader_stages/plugin_loader.rb,
lib/praxis/request_stages/validate_payload.rb,
lib/praxis/responses/internal_server_error.rb,
lib/praxis/skeletor/restful_routing_config.rb,
lib/praxis/exceptions/invalid_configuration.rb,
lib/praxis/bootloader_stages/subgroup_loader.rb,
lib/praxis/bootloader_stages/plugin_config_load.rb,
lib/praxis/bootloader_stages/warn_unloaded_files.rb,
lib/praxis/action_definition/headers_dsl_compiler.rb,
lib/praxis/bootloader_stages/plugin_config_prepare.rb,
lib/praxis/request_stages/validate_params_and_headers.rb

Overview

Plugin for applications which use the ‘praxis-mapper’ gem.

This plugin provides the following features:

1. Sets up the PraxisMapper::IdentityMap for your application and assigns
   it to the controller's request.identity_map for access from your
   application.
2. Connects to your database and dumps a log of database interaction stats
   (if enabled via the :log_stats option).

This plugin accepts one of the following options:

1. config_file: A String indicating the path where this plugin's config
   file exists.
2. config_data: A Hash of data that is merged into the YAML hash loaded
   from config_file.

The config_data Hash contains the following keys:

1. repositories: A Hash containing the configs for the database repositories
   queried through praxis-mapper. This parameter is a Hash where a key is
   the identifier for a repository and the value is the options one
   would give to the 'sequel' gem. For example:
        repositories: {
          default: {
            host: 127.0.0.1,
            username: root,
            password: nil,
            database: myapp_dev,
            adapter: mysql2
          }
        }
2. log_stats: A String indicating what kind of DB stats you would like
   output into the Praxis::Application.instance.logger app log. Possible
   values are: "detailed", "short", and "skip" (i.e. do not print the stats
   at all).
3. stats_log_level: the logging level with which the statistics should be logged.

See praxis-framework.io/reference/plugins/ for further details on how to use a plugin and pass it options.

Defined Under Namespace

Modules: BootloaderStages, Callbacks, Controller, Exceptions, Handlers, Notifications, PluginConcern, Plugins, RequestStages, ResourceDefinition, Responses, Skeletor, Stats, StructCollection, Types Classes: ActionDefinition, ApiDefinition, ApiGeneralInfo, Application, Bootloader, Collection, Config, Dispatcher, ErrorHandler, Exception, FileGroup, Links, MediaType, MediaTypeCollection, MediaTypeIdentifier, Multipart, MultipartParser, MultipartPart, Plugin, Request, Response, ResponseDefinition, ResponseTemplate, RestfulDocGenerator, Route, Router, SimpleMediaType, Stage

Constant Summary collapse

VERSION =
'0.15.0'
CONTEXT_FOR =
{
  params: [Attributor::AttributeResolver::ROOT_PREFIX, "params".freeze],
  headers: [Attributor::AttributeResolver::ROOT_PREFIX, "headers".freeze],
  payload: [Attributor::AttributeResolver::ROOT_PREFIX, "payload".freeze]
}.freeze