Sha256: 3466fee47e09a8380b1e84c1378e66bb2079ecf5edf796d6d63e81df240b124c
Contents?: true
Size: 713 Bytes
Versions: 9
Compression:
Stored size: 713 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::DELIMITER end private attr_reader :standard end end end
Version data entries
9 entries across 9 versions & 1 rubygems