Sha256: 1d1e2ee6bd8cf6d9f4cedc5ce514fed3d62537e37fc7d52864d66e76600971a4

Contents?: true

Size: 598 Bytes

Versions: 2

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module XDG
  class Data
    extend Forwardable

    HOME_PAIR = Pair["XDG_DATA_HOME", ".local/share"].freeze
    DIRS_PAIR = Pair["XDG_DATA_DIRS", "/usr/local/share:/usr/share"].freeze

    delegate %i[home directories all inspect] => :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.1.1 lib/xdg/data.rb
xdg-3.1.0 lib/xdg/data.rb