Sha256: ed18e6e425f2170e89390d8cf77f82b45fccc73d11ff803f4ca3d673b43c391f
Contents?: true
Size: 742 Bytes
Versions: 13
Compression:
Stored size: 742 Bytes
Contents
# frozen_string_literal: true require "forwardable" require "refinements/pathnames" module Runcom module Paths # Provides common path/functionality for all XDG enhanced objects. class Common extend Forwardable using Refinements::Pathnames delegate %i[inspect] => :xdg attr_reader :relative def initialize relative, context: Context.new @relative = Pathname relative @context = context end def namespace = relative.parent def file_name = relative.basename def current = all.select(&:file?).find(&:exist?) def all = xdg.all.map { |root| root.join relative } private attr_reader :context def xdg = context.xdg end end end
Version data entries
13 entries across 13 versions & 1 rubygems