Sha256: 44709de63ac46f622a4bb27bfc0d8129a4543b7c0530af15424b66cbe10d72b2

Contents?: true

Size: 640 Bytes

Versions: 8

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require "xdg/pair"

module XDG
  # Provides data support.
  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::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/data.rb
xdg-7.1.2 lib/xdg/data.rb
xdg-7.1.1 lib/xdg/data.rb
xdg-7.1.0 lib/xdg/data.rb
xdg-7.0.3 lib/xdg/data.rb
xdg-7.0.2 lib/xdg/data.rb
xdg-7.0.1 lib/xdg/data.rb
xdg-7.0.0 lib/xdg/data.rb