Module: Toys::StandardMixins::XDG

Includes:
Mixin
Defined in:
core-docs/toys/standard_mixins/xdg.rb

Overview

A mixin that provides tools for working with the XDG Base Directory Specification.

This mixin provides an instance of Utils::XDG, which includes utility methods that locate base directories and search paths for application state, configuration, caches, and other data, according to the XDG Base Directory Spec version 0.8.

Defined in the toys-core gem

Examples:


include :xdg

def run
  # Get config file paths, in order from most to least inportant
  config_files = xdg.lookup_config("my-config.toml")
  config_files.each { |path| read_my_config(path) }
end

Constant Summary collapse

KEY =

Context key for the XDG object.

Returns:

  • (Object)
::Toys::UniqueKey.new("Toys::StandardMixins::XDG::KEY")

Instance Method Summary collapse

Methods included from Mixin

create

Instance Method Details

#xdg ⇒ Toys::Utils::XDG

Access XDG utility methods.

Returns:



39
40
41
# File 'core-docs/toys/standard_mixins/xdg.rb', line 39

def xdg
  # Source available in the toys-core gem
end