YukiHelper.Config (YukiHelper v0.1.0) View Source

Loads configuration files.

Loading configuration files are the following:

  1. ~/.yukihelper.config.yml
  2. ~/.config/yukihelper/.config.yml
  3. ./yuki_helper.config.yml

If there are multiple configuration filles, any same option is overridden.

Configuration File

# .yuki_helper.default.config.yml
testcase:
  # Positive integer value more than 10.
  # If `bundile` is 100, directory of testcase for problem 10 is `testcase/100/p10`.
  bundle: null
  # Root direcotry of testcases to download
  directory: "testcase"
  # Prefix of testcase `testcase/p10` and source code `lib/p10.ex`
  prefix: "p"
yukicoder:
  # Access Token for Yukicoder. Be careful to treat.
  access_token: "your access token"

Link to this section Summary

Functions

Returns files to load.

returns headers for HTTPoison.

Loads a configuration file.

Loads all configuration files with ignoring any error.

Merges two configurations. Prioritizes to select a not nil value as well as possible.

returns options for HTTPoison.

Link to this section Types

Specs

t() :: %YukiHelper.Config{testcase: term(), yukicoder: term()}

Link to this section Functions

Specs

get_target_files() :: [Path.t()]

Returns files to load.

Specs

headers(t()) :: {:ok, list()} | {:error, term()}

returns headers for HTTPoison.

Specs

headers!(t()) :: list()

Specs

load(Path.t()) :: {:ok, t()} | {:error, term()}

Loads a configuration file.

Specs

load_all() :: t()

Loads all configuration files with ignoring any error.

Merges two configurations. Prioritizes to select a not nil value as well as possible.

Specs

new() :: t()

Specs

new(map() | nil) :: t()

Specs

options(t()) :: {:ok, list()} | {:error, term()}

returns options for HTTPoison.

Specs

options!(t()) :: list()