Sha256: a7775f98902e907306c03b8f364bc99af43d0c1920bcddcabc2ef7686495c47f

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module XDG
  class Config
    extend Forwardable

    HOME_PAIR = Pair.new("XDG_CONFIG_HOME", ".config").freeze
    DIRS_PAIR = Pair.new("XDG_CONFIG_DIRS", "/etc/xdg").freeze

    delegate %i[home directories all] => :combined

    def initialize home: Paths::Standard, directories: Paths::Directory, environment: ENV
      @combined = Paths::Combined.new home.new(HOME_PAIR, environment),
                                      directories.new(DIRS_PAIR, environment)
    end

    private

    attr_reader :combined
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xdg-3.0.1 lib/xdg/config.rb
xdg-3.0.0 lib/xdg/config.rb