Sha256: dc2cb19018832bf57ec9413da085e459fa0491ac481ff0b4315769462dca8c83
Contents?: true
Size: 749 Bytes
Versions: 9
Compression:
Stored size: 749 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 { |path| Pathname path } .then { |path| [path.expand_path, standard.dynamic] } end def inspect [ standard.key, dynamic.join(XDG::Paths::Directory::DELIMITER) ].compact.join(XDG::PAIR_DELIMITER) end private attr_reader :standard end end end
Version data entries
9 entries across 9 versions & 1 rubygems