xdg 5.1.0 → 5.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/xdg/environment.rb +6 -18
- data/lib/xdg/identity.rb +1 -1
- data/lib/xdg/pair.rb +4 -12
- data/lib/xdg/paths/combined.rb +4 -12
- data/lib/xdg/paths/directory.rb +5 -15
- data/lib/xdg/paths/home.rb +5 -15
- metadata +13 -13
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94fe25ddbad33f6e84bb1167b8d44772c37a1b2443987402a637472eac0e6fb0
|
4
|
+
data.tar.gz: 9f7f080991b1353d5cc62b6e96bf3c5a8ce8b929114e9f61e0ccd1638ed4f8cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a47af1478f23173618062adae68bda0c25ec097bce38d152eafcfa08791421c72edaf408628b3a19efa82876d4e2d1c689788a4520d23e0a4d68f69262d3aeb5
|
7
|
+
data.tar.gz: 4958c541915eed9d72333e53ed2c5866fdaee6ae43c75036c4b70f233334fbdb8e491f30325f2da7e942c2e2b777cdb9e2b59126b95b1d52d3026a8f9befa6f9
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/xdg/environment.rb
CHANGED
@@ -8,29 +8,17 @@ module XDG
|
|
8
8
|
@data = Data.new home: home, directories: directories, environment: environment
|
9
9
|
end
|
10
10
|
|
11
|
-
def cache_home
|
12
|
-
cache.home
|
13
|
-
end
|
11
|
+
def cache_home = cache.home
|
14
12
|
|
15
|
-
def config_home
|
16
|
-
config.home
|
17
|
-
end
|
13
|
+
def config_home = config.home
|
18
14
|
|
19
|
-
def config_dirs
|
20
|
-
config.directories
|
21
|
-
end
|
15
|
+
def config_dirs = config.directories
|
22
16
|
|
23
|
-
def data_home
|
24
|
-
data.home
|
25
|
-
end
|
17
|
+
def data_home = data.home
|
26
18
|
|
27
|
-
def data_dirs
|
28
|
-
data.directories
|
29
|
-
end
|
19
|
+
def data_dirs = data.directories
|
30
20
|
|
31
|
-
def inspect
|
32
|
-
"#{cache.inspect} #{config.inspect} #{data.inspect}"
|
33
|
-
end
|
21
|
+
def inspect = "#{cache.inspect} #{config.inspect} #{data.inspect}"
|
34
22
|
|
35
23
|
private
|
36
24
|
|
data/lib/xdg/identity.rb
CHANGED
data/lib/xdg/pair.rb
CHANGED
@@ -5,21 +5,13 @@ module XDG
|
|
5
5
|
|
6
6
|
# A generic key-value pair (KVP).
|
7
7
|
Pair = Struct.new :key, :value do
|
8
|
-
def to_env
|
9
|
-
Hash[*values]
|
10
|
-
end
|
8
|
+
def to_env = Hash[*values]
|
11
9
|
|
12
|
-
def key?
|
13
|
-
key.to_s.size.positive?
|
14
|
-
end
|
10
|
+
def key? = key.to_s.size.positive?
|
15
11
|
|
16
|
-
def value?
|
17
|
-
value.to_s.size.positive?
|
18
|
-
end
|
12
|
+
def value? = value.to_s.size.positive?
|
19
13
|
|
20
|
-
def empty?
|
21
|
-
!(key? && value?)
|
22
|
-
end
|
14
|
+
def empty? = !(key? && value?)
|
23
15
|
|
24
16
|
def inspect
|
25
17
|
return "" unless key? || value?
|
data/lib/xdg/paths/combined.rb
CHANGED
@@ -11,21 +11,13 @@ module XDG
|
|
11
11
|
@initial_directories = initial_directories
|
12
12
|
end
|
13
13
|
|
14
|
-
def home
|
15
|
-
initial_home.dynamic
|
16
|
-
end
|
14
|
+
def home = initial_home.dynamic
|
17
15
|
|
18
|
-
def directories
|
19
|
-
initial_directories.dynamic
|
20
|
-
end
|
16
|
+
def directories = initial_directories.dynamic
|
21
17
|
|
22
|
-
def all
|
23
|
-
directories.prepend home
|
24
|
-
end
|
18
|
+
def all = directories.prepend(home)
|
25
19
|
|
26
|
-
def inspect
|
27
|
-
[initial_home.inspect, initial_directories.inspect].reject(&:empty?).join " "
|
28
|
-
end
|
20
|
+
def inspect = [initial_home.inspect, initial_directories.inspect].reject(&:empty?).join(" ")
|
29
21
|
|
30
22
|
private
|
31
23
|
|
data/lib/xdg/paths/directory.rb
CHANGED
@@ -13,9 +13,7 @@ module XDG
|
|
13
13
|
@environment = environment
|
14
14
|
end
|
15
15
|
|
16
|
-
def default
|
17
|
-
value.split(DELIMITER).map { |path| expand path }
|
18
|
-
end
|
16
|
+
def default = value.split(DELIMITER).map { |path| expand path }
|
19
17
|
|
20
18
|
def dynamic
|
21
19
|
String(environment[key]).then { |env_value| env_value.empty? ? value : env_value }
|
@@ -24,25 +22,17 @@ module XDG
|
|
24
22
|
.map { |path| expand path }
|
25
23
|
end
|
26
24
|
|
27
|
-
def inspect
|
28
|
-
[key, dynamic.join(DELIMITER)].reject(&:empty?).join XDG::PAIR_DELIMITER
|
29
|
-
end
|
25
|
+
def inspect = [key, dynamic.join(DELIMITER)].reject(&:empty?).join(XDG::PAIR_DELIMITER)
|
30
26
|
|
31
27
|
private
|
32
28
|
|
33
29
|
attr_reader :pair, :environment
|
34
30
|
|
35
|
-
def key
|
36
|
-
String pair.key
|
37
|
-
end
|
31
|
+
def key = String(pair.key)
|
38
32
|
|
39
|
-
def value
|
40
|
-
String pair.value
|
41
|
-
end
|
33
|
+
def value = String(pair.value)
|
42
34
|
|
43
|
-
def expand path
|
44
|
-
Pathname(path).expand_path
|
45
|
-
end
|
35
|
+
def expand(path) = Pathname(path).expand_path
|
46
36
|
end
|
47
37
|
end
|
48
38
|
end
|
data/lib/xdg/paths/home.rb
CHANGED
@@ -18,29 +18,19 @@ module XDG
|
|
18
18
|
@environment = environment
|
19
19
|
end
|
20
20
|
|
21
|
-
def default
|
22
|
-
expand String(value)
|
23
|
-
end
|
21
|
+
def default = expand(String(value))
|
24
22
|
|
25
|
-
def dynamic
|
26
|
-
String(environment[key]).then { |path| path.empty? ? default : expand(path) }
|
27
|
-
end
|
23
|
+
def dynamic = String(environment[key]).then { |path| path.empty? ? default : expand(path) }
|
28
24
|
|
29
|
-
def inspect
|
30
|
-
[pair.key, dynamic].compact.join XDG::PAIR_DELIMITER
|
31
|
-
end
|
25
|
+
def inspect = [pair.key, dynamic].compact.join(XDG::PAIR_DELIMITER)
|
32
26
|
|
33
27
|
private
|
34
28
|
|
35
29
|
attr_reader :pair, :environment
|
36
30
|
|
37
|
-
def expand path
|
38
|
-
home.join(path).expand_path
|
39
|
-
end
|
31
|
+
def expand(path) = home.join(path).expand_path
|
40
32
|
|
41
|
-
def home
|
42
|
-
Pathname environment.fetch(KEY)
|
43
|
-
end
|
33
|
+
def home = Pathname(environment.fetch(KEY))
|
44
34
|
end
|
45
35
|
end
|
46
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xdg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -10,9 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIC/
|
14
|
-
|
15
|
-
|
13
|
+
MIIC/jCCAeagAwIBAgIBBDANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
|
14
|
+
a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMTAzMTkxMjQ4MDZaFw0yMjAzMTkx
|
15
|
+
MjQ4MDZaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
|
16
16
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
|
17
17
|
xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
|
18
18
|
brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
|
@@ -20,15 +20,15 @@ cert_chain:
|
|
20
20
|
D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
|
21
21
|
3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
|
22
22
|
AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
|
23
|
-
2CdikiiE3fJhP/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAEjpaOXHHp8s/7GL2qCb
|
24
|
+
YAs7urOLv9VHSPfQWAwaTMVnSsIf3Sw4xzISOP/mmfEPBPXtz61K5esrE/uTFtgb
|
25
|
+
FyjxQk2H0sEWgrRXGGNHBWQRhhEs7LP/TByoC15A0br++xLxRz4r7HBLGAWQQDpg
|
26
|
+
66BJ2TBVjxS6K64tKbq7+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
|
27
|
+
cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
|
28
|
+
lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
|
29
|
+
W2A=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2021-
|
31
|
+
date: 2021-04-18 00:00:00.000000000 Z
|
32
32
|
dependencies: []
|
33
33
|
description:
|
34
34
|
email:
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
rubygems_version: 3.2.
|
77
|
+
rubygems_version: 3.2.16
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: Provides an implementation of the XDG Base Directory Specification.
|
metadata.gz.sig
CHANGED
Binary file
|