xdg 4.3.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/README.adoc +2 -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 +6 -16
- data/lib/xdg/paths/home.rb +5 -15
- metadata +15 -211
- 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/README.adoc
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
[link=http://badge.fury.io/rb/xdg]
|
8
8
|
image::https://badge.fury.io/rb/xdg.svg[Gem Version]
|
9
|
+
[link=https://www.alchemists.io/projects/code_quality]
|
10
|
+
image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
|
9
11
|
[link=https://circleci.com/gh/bkuhlmann/xdg]
|
10
12
|
image::https://circleci.com/gh/bkuhlmann/xdg.svg?style=svg[Circle CI Status]
|
11
13
|
|
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,36 +13,26 @@ module XDG
|
|
13
13
|
@environment = environment
|
14
14
|
end
|
15
15
|
|
16
|
-
def default
|
17
|
-
value.split(DELIMITER).map(&method(:expand))
|
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 }
|
22
20
|
.split(DELIMITER)
|
23
21
|
.uniq
|
24
|
-
.map
|
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:
|
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/jCCAeagAwIBAgIBBDANBg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UG2YYBxwhu+GPdAGQPxpf9
|
28
|
+
lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
|
29
|
+
W2A=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date:
|
32
|
-
dependencies:
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: bundler-audit
|
35
|
-
requirement: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '0.6'
|
40
|
-
type: :development
|
41
|
-
prerelease: false
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - "~>"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0.6'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: gemsmith
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
50
|
-
requirements:
|
51
|
-
- - "~>"
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '14.2'
|
54
|
-
type: :development
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - "~>"
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '14.2'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: git-lint
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '1.0'
|
68
|
-
type: :development
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '1.0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: guard-rspec
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '4.7'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '4.7'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: pry
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0.13'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0.13'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: pry-byebug
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '3.9'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '3.9'
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: rake
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '13.0'
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '13.0'
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: reek
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
134
|
-
requirements:
|
135
|
-
- - "~>"
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
version: '6.0'
|
138
|
-
type: :development
|
139
|
-
prerelease: false
|
140
|
-
version_requirements: !ruby/object:Gem::Requirement
|
141
|
-
requirements:
|
142
|
-
- - "~>"
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: '6.0'
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
name: rspec
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - "~>"
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '3.9'
|
152
|
-
type: :development
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - "~>"
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '3.9'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: rubocop
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: '0.89'
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '0.89'
|
173
|
-
- !ruby/object:Gem::Dependency
|
174
|
-
name: rubocop-performance
|
175
|
-
requirement: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '1.5'
|
180
|
-
type: :development
|
181
|
-
prerelease: false
|
182
|
-
version_requirements: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '1.5'
|
187
|
-
- !ruby/object:Gem::Dependency
|
188
|
-
name: rubocop-rake
|
189
|
-
requirement: !ruby/object:Gem::Requirement
|
190
|
-
requirements:
|
191
|
-
- - "~>"
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: '0.5'
|
194
|
-
type: :development
|
195
|
-
prerelease: false
|
196
|
-
version_requirements: !ruby/object:Gem::Requirement
|
197
|
-
requirements:
|
198
|
-
- - "~>"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '0.5'
|
201
|
-
- !ruby/object:Gem::Dependency
|
202
|
-
name: rubocop-rspec
|
203
|
-
requirement: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '1.39'
|
208
|
-
type: :development
|
209
|
-
prerelease: false
|
210
|
-
version_requirements: !ruby/object:Gem::Requirement
|
211
|
-
requirements:
|
212
|
-
- - "~>"
|
213
|
-
- !ruby/object:Gem::Version
|
214
|
-
version: '1.39'
|
215
|
-
- !ruby/object:Gem::Dependency
|
216
|
-
name: simplecov
|
217
|
-
requirement: !ruby/object:Gem::Requirement
|
218
|
-
requirements:
|
219
|
-
- - "~>"
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: '0.19'
|
222
|
-
type: :development
|
223
|
-
prerelease: false
|
224
|
-
version_requirements: !ruby/object:Gem::Requirement
|
225
|
-
requirements:
|
226
|
-
- - "~>"
|
227
|
-
- !ruby/object:Gem::Version
|
228
|
-
version: '0.19'
|
31
|
+
date: 2021-04-18 00:00:00.000000000 Z
|
32
|
+
dependencies: []
|
229
33
|
description:
|
230
34
|
email:
|
231
35
|
- brooke@alchemists.io
|
@@ -263,14 +67,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
263
67
|
requirements:
|
264
68
|
- - "~>"
|
265
69
|
- !ruby/object:Gem::Version
|
266
|
-
version: '
|
70
|
+
version: '3.0'
|
267
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
268
72
|
requirements:
|
269
73
|
- - ">="
|
270
74
|
- !ruby/object:Gem::Version
|
271
75
|
version: '0'
|
272
76
|
requirements: []
|
273
|
-
rubygems_version: 3.
|
77
|
+
rubygems_version: 3.2.16
|
274
78
|
signing_key:
|
275
79
|
specification_version: 4
|
276
80
|
summary: Provides an implementation of the XDG Base Directory Specification.
|
metadata.gz.sig
CHANGED
Binary file
|