Sha256: 9a649b92637049da7d701ec7bb9f2881f924f2cee4de786021c51689c10816c4

Contents?: true

Size: 1.72 KB

Versions: 20

Compression:

Stored size: 1.72 KB

Contents

# octocatalog-diff v1 API documentation: config

## Overview

`config` reads and parses an [octocatalog-diff configuration file](/doc/configuration.md).

```
options = OctocatalogDiff::API::V1.config(
  filename: "String",
  logger: Logger,
  test: <true|false>
)
```

## Options

- **`:filename`** (String, optional): Full path to configuration file to read. If not provided, the configuration file will be searched as described in [Configuration](/doc/configuration.md).

- **`:logger`** (Logger, optional): Logger object. If provided, debug messages and fatal errors will be logged to this object.

- **`:test`** (Boolean, optional): Test mode, defaults to false. If true, the value of the configuration settings will be logged to the logger (with priority DEBUG) and an exception will be raised if the configuration file cannot be located.

## Return value

If the configuration file is located and valid, the return value is a Hash consisting of the options defined in the configuration file.

If the configuration file cannot be found, the return value is an empty Hash (`{}`). Except, with `:test => true`, an exception will be raised.

## Exceptions

- `OctocatalogDiff::Errors::ConfigurationFileContentError`

  Raised if the configuration file could not be evaluated. A more specific error message will help identify the cause. Possible causes include the file not being valid ruby, the file not containing the expected structure or methods, or the method returning something other than a Hash.

- `OctocatalogDiff::Errors::ConfigurationFileNotFoundError`

  Raised if the configuration file could not be found, *and* `:test => true` was supplied. (Note, if no configuration file is found, but `:test => false`, no error is raised, and `{}` is returned.)

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
octocatalog-diff-2.3.1 doc/dev/api/v1/calls/config.md
octocatalog-diff-2.3.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-2.1.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-2.0.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.6.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.5.4 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.5.3 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.5.2 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.5.1 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.5.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.4.1 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.4.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.3.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.2.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.1.0 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.0.4 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.0.3 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.0.2 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.0.1 doc/dev/api/v1/calls/config.md
octocatalog-diff-1.0.0 doc/dev/api/v1/calls/config.md