lib/xdg/paths/directory.rb in xdg-3.0.2 vs lib/xdg/paths/directory.rb in xdg-3.1.0
- old
+ new
@@ -16,15 +16,26 @@
def default
paths.split(DELIMITER).map(&method(:expand))
end
def dynamic
- environment.fetch(pair.key, paths).split(DELIMITER).uniq.map(&method(:expand))
+ String(environment[key]).then { |env_paths| env_paths.empty? ? paths : env_paths }
+ .split(DELIMITER)
+ .uniq
+ .map(&method(:expand))
end
+ def inspect
+ [key, dynamic.join(DELIMITER)].reject(&:empty?).join XDG::PAIR_DELIMITER
+ end
+
private
attr_reader :pair, :environment
+
+ def key
+ String pair.key
+ end
def paths
String pair.value
end