Sha256: bd002b4c6c1ac4d47b70387c68ab4db17e72ac593ac4b7db8e7bb02369be566d
Contents?: true
Size: 677 Bytes
Versions: 11
Compression:
Stored size: 677 Bytes
Contents
# frozen_string_literal: true require "forwardable" require "pathname" module Runcom module Paths # A XDG home path that prefers local over global path. class Home extend Forwardable delegate %i[key value default] => :standard def initialize pair, environment = ENV @standard = XDG::Paths::Home.new pair, environment end def dynamic String(value).then do |path| File.exist?(path) ? Pathname(path).expand_path : standard.dynamic end end def inspect [standard.key, dynamic].compact.join XDG::PAIR_DELIMITER end private attr_reader :standard end end end
Version data entries
11 entries across 11 versions & 1 rubygems