Sha256: 4a31522aabb3c14a6559a9944c07b1c8109b0b5bbf2a7aaaa2c83eb742e4a2d4

Contents?: true

Size: 631 Bytes

Versions: 8

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require "xdg/pair"

module XDG
  # Provides configuration support.
  class Config
    extend Forwardable

    HOME_PAIR = Pair["XDG_CONFIG_HOME", ".config"].freeze
    DIRS_PAIR = Pair["XDG_CONFIG_DIRS", "/etc/xdg"].freeze

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

    def initialize home: Paths::Home, 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

8 entries across 8 versions & 1 rubygems

Version Path
xdg-7.1.3 lib/xdg/config.rb
xdg-7.1.2 lib/xdg/config.rb
xdg-7.1.1 lib/xdg/config.rb
xdg-7.1.0 lib/xdg/config.rb
xdg-7.0.3 lib/xdg/config.rb
xdg-7.0.2 lib/xdg/config.rb
xdg-7.0.1 lib/xdg/config.rb
xdg-7.0.0 lib/xdg/config.rb