Module: StrapiRuby

Extended by:
Configuration, Interface
Defined in:
lib/strapi_ruby/markdown.rb,
lib/strapi_ruby.rb,
lib/strapi_ruby/client.rb,
lib/strapi_ruby/config.rb,
lib/strapi_ruby/railtie.rb,
lib/strapi_ruby/version.rb,
lib/strapi_ruby/formatter.rb,
lib/strapi_ruby/interface.rb,
lib/strapi_ruby/validations.rb,
lib/strapi_ruby/configuration.rb,
lib/strapi_ruby/errors/logger.rb,
lib/strapi_ruby/endpoint/query.rb,
lib/strapi_ruby/endpoint/builder.rb,
lib/strapi_ruby/errors/client_error.rb,
lib/strapi_ruby/errors/error_message.rb,
lib/strapi_ruby/endpoint/strapi_parameters.rb,
lib/strapi_ruby/errors/configuration_error.rb

Overview

Use with Markdown.instance.to_html

Defined Under Namespace

Modules: Configuration, Endpoint, Interface, Validations Classes: BadRequestError, Client, ClientError, Config, ConfigurationError, ConnectionError, ErrorMessage, ForbiddenError, Formatter, JSONParsingError, Markdown, NotFoundError, Railtie, ServerError, UnauthorizedError, UnprocessableEntityError

Constant Summary collapse

VERSION =
"0.1.4"

Class Attribute Summary collapse

Method Summary

Methods included from Configuration

config, configure

Methods included from Interface

delete, escape_empty_answer, get, post, put

Methods included from Validations

#validate_config, #validate_data_presence, #validate_options

Class Attribute Details

.loggerObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/strapi_ruby/errors/logger.rb', line 7

def logger
  @logger ||= Logger.new($stdout).tap do |log|
    log.progname = name
    log.formatter = proc do |severity, datetime, progname, msg|
      case severity
      when "ERROR"
        "[#{datetime.strftime("%Y-%m-%d %H:%M:%S")}] #{progname} - #{severity}: #{msg}".red
      else
        "[#{datetime.strftime("%Y-%m-%d %H:%M:%S")}] #{progname} - #{severity}: #{msg}"
      end
    end
  end
end