Sha256: 6ace0c860b4822538fb6dc0d96b78adcfe5fda54ea2f22eb2b62cd7d94d158ea

Contents?: true

Size: 623 Bytes

Versions: 4

Compression:

Stored size: 623 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module Runcom
  module XDG
    # A XDG cache that adheres to specification defaults.
    class Cache
      extend Forwardable

      HOME_PAIR = Pair.new("XDG_CACHE_HOME", ".cache").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(Runcom::Pair.new, 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/cache.rb
runcom-4.2.0 lib/runcom/xdg/cache.rb
runcom-4.1.0 lib/runcom/xdg/cache.rb
runcom-4.0.0 lib/runcom/xdg/cache.rb