Sha256: 7610fc1086c4b0b1ad3ddb3b62dba44574121309d31caf983bf7ff17680dfa0b

Contents?: true

Size: 692 Bytes

Versions: 4

Compression:

Stored size: 692 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module Runcom
  module XDG
    # A XDG configuration that adheres to specification defaults.
    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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
runcom-4.2.1 lib/runcom/xdg/config.rb
runcom-4.2.0 lib/runcom/xdg/config.rb
runcom-4.1.0 lib/runcom/xdg/config.rb
runcom-4.0.0 lib/runcom/xdg/config.rb