xdg 10.2.0 → 10.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +91 -74
- data/lib/xdg/environment.rb +5 -2
- data/lib/xdg/paths/any.rb +36 -0
- data/lib/xdg/paths/directory.rb +1 -13
- data/lib/xdg/paths/home.rb +8 -23
- data/lib/xdg/runtime.rb +27 -0
- data/lib/xdg.rb +2 -0
- data/xdg.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -2
- 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: dff59b5802f4d0b6bd151e03e62e04de6313f7735f5d49e888922583156fc752
|
|
4
|
+
data.tar.gz: 96fff0863fbf4a5df4f7b52d77e488b967adbfc4b1e6c04bd865e6d8bd424110
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ddf7eab480fde881d5c91cab56439eae63949b25c8acd8e449ef1660d132bd7792e8aebcdf11a5ee1bf5962b7b5b6e012cf3b3e9524ca18d24b4a4794f38623d
|
|
7
|
+
data.tar.gz: 77615ccaa6169c1bafc9851dd62fd28d78408859196fb811e5c50ffb66037205391483a44af3c89f109a3cdd34a0141dad3edb156aa852637bec1e734565388c
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/README.adoc
CHANGED
|
@@ -16,13 +16,14 @@ toc::[]
|
|
|
16
16
|
|
|
17
17
|
== Features
|
|
18
18
|
|
|
19
|
-
* Provides a `XDG` object that adheres to the _XDG Base Directory Specification_ with access to the following environment
|
|
20
|
-
**
|
|
21
|
-
**
|
|
22
|
-
**
|
|
23
|
-
**
|
|
24
|
-
**
|
|
25
|
-
**
|
|
19
|
+
* Provides a `XDG` object that adheres to the _XDG Base Directory Specification_ with access to the following environment variables:
|
|
20
|
+
** `XDG_CACHE_HOME`
|
|
21
|
+
** `XDG_CONFIG_HOME`
|
|
22
|
+
** `XDG_CONFIG_DIRS`
|
|
23
|
+
** `XDG_DATA_HOME`
|
|
24
|
+
** `XDG_DATA_DIRS`
|
|
25
|
+
** `XDG_RUNTIME_DIR`
|
|
26
|
+
** `XDG_STATE_HOME`
|
|
26
27
|
|
|
27
28
|
== Requirements
|
|
28
29
|
|
|
@@ -71,12 +72,13 @@ To get up and running quickly, use `XDG.new` as follows:
|
|
|
71
72
|
[source,ruby]
|
|
72
73
|
----
|
|
73
74
|
xdg = XDG.new
|
|
74
|
-
xdg.cache_home # Answers computed
|
|
75
|
-
xdg.config_home # Answers computed
|
|
76
|
-
xdg.config_dirs # Answers computed
|
|
77
|
-
xdg.data_home # Answers computed
|
|
78
|
-
xdg.data_dirs # Answers computed
|
|
79
|
-
xdg.
|
|
75
|
+
xdg.cache_home # Answers computed `XDG_CACHE_HOME` value.
|
|
76
|
+
xdg.config_home # Answers computed `XDG_CONFIG_HOME` value.
|
|
77
|
+
xdg.config_dirs # Answers computed `XDG_CONFIG_DIRS` value.
|
|
78
|
+
xdg.data_home # Answers computed `XDG_DATA_HOME` value.
|
|
79
|
+
xdg.data_dirs # Answers computed `XDG_DATA_DIRS` value.
|
|
80
|
+
xdg.runtime_dir # Answers computed `XDG_RUNTIME_DIR` value.
|
|
81
|
+
xdg.state_home # Answers computed `XDG_STATE_HOME` value.
|
|
80
82
|
----
|
|
81
83
|
|
|
82
84
|
Behinds the scenes, use of `XDG.new` wraps `XDG::Environment.new` which provides a unified Object API to the following objects:
|
|
@@ -86,15 +88,16 @@ Behinds the scenes, use of `XDG.new` wraps `XDG::Environment.new` which provides
|
|
|
86
88
|
cache = XDG::Cache.new
|
|
87
89
|
config = XDG::Config.new
|
|
88
90
|
data = XDG::Data.new
|
|
91
|
+
runtime = XDG::Runtime.new
|
|
89
92
|
state = XDG::State.new
|
|
90
93
|
----
|
|
91
94
|
|
|
92
95
|
Generally, use of `XDG.new` is all you need but knowing you can create a specialized instance of any aspect of the XDG specification can be handy for specific use cases. Additionally, the `cache`, `config`, `data`, and `state` objects share the same API which means you can send the following messages:
|
|
93
96
|
|
|
94
|
-
* `#home`: Answers the home directory as computed via the
|
|
95
|
-
* `#directories`: Answers an array directories as computed via the
|
|
96
|
-
* `#all`: Answers an array of _all_ directories as computed from the combined
|
|
97
|
-
|
|
97
|
+
* `#home`: Answers the home directory as computed via the `+XDG_*_HOME+` key.
|
|
98
|
+
* `#directories`: Answers an array directories as computed via the `+XDG_*_DIRS+` key.
|
|
99
|
+
* `#all`: Answers an array of _all_ directories as computed from the combined `+XDG_*_HOME+` and
|
|
100
|
+
`+XDG_*_DIRS+` values (with `+XDG_*_HOME+` prefixed at the start of the array).
|
|
98
101
|
* `#to_s`: Answers an _explicit_ string cast for the current environment.
|
|
99
102
|
* `#to_str`: Answers an _implicit_ string cast for the current environment.
|
|
100
103
|
* `#inspect`: Answers object inspection complete with object type, object ID, and all environment variables.
|
|
@@ -115,54 +118,63 @@ xdg = XDG.new
|
|
|
115
118
|
cache = XDG::Cache.new
|
|
116
119
|
config = XDG::Config.new
|
|
117
120
|
data = XDG::Data.new
|
|
121
|
+
runtime = XDG::Runtime.new
|
|
118
122
|
state = XDG::State.new
|
|
119
123
|
|
|
120
124
|
# Paths
|
|
121
125
|
|
|
122
|
-
xdg.cache_home
|
|
123
|
-
xdg.config_home
|
|
124
|
-
xdg.config_dirs
|
|
125
|
-
xdg.data_home
|
|
126
|
-
xdg.data_dirs
|
|
127
|
-
xdg.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
cache.
|
|
131
|
-
cache.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
config.
|
|
135
|
-
config.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
data.
|
|
139
|
-
data.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
state.
|
|
126
|
+
xdg.cache_home # "#<Pathname:/Users/demo/.cache>"
|
|
127
|
+
xdg.config_home # "#<Pathname:/Users/demo/.config>"
|
|
128
|
+
xdg.config_dirs # ["#<Pathname:/etc/xdg>"]
|
|
129
|
+
xdg.data_home # "#<Pathname:/Users/demo/.local/share>"
|
|
130
|
+
xdg.data_dirs # ["#<Pathname:/usr/local/share>", "#<Pathname:/usr/share>"]
|
|
131
|
+
xdg.runtime_dir # "#<Pathname:>"
|
|
132
|
+
xdg.state_home # "#<Pathname:/Users/demo/.local/state>"
|
|
133
|
+
|
|
134
|
+
cache.home # "#<Pathname:/Users/demo/.cache>"
|
|
135
|
+
cache.directories # []
|
|
136
|
+
cache.all # ["#<Pathname:/Users/demo/.cache>"]
|
|
137
|
+
|
|
138
|
+
config.home # "#<Pathname:/Users/demo/.config>"
|
|
139
|
+
config.directories # ["#<Pathname:/etc/xdg>"]
|
|
140
|
+
config.all # ["#<Pathname:/Users/demo/.config>", "#<Pathname:/etc/xdg>"]
|
|
141
|
+
|
|
142
|
+
data.home # "#<Pathname:/Users/demo/.local/share>"
|
|
143
|
+
data.directories # ["#<Pathname:/usr/local/share>", "#<Pathname:/usr/share>"]
|
|
144
|
+
data.all # ["#<Pathname:/Users/demo/.local/share>", "#<Pathname:/usr/local/share>", "#<Pathname:/usr/share>"]
|
|
145
|
+
|
|
146
|
+
runtime.home # "#<Pathname:>"
|
|
147
|
+
runtime.directories # []
|
|
148
|
+
runtime.all # ["#<Pathname:>"]
|
|
149
|
+
|
|
150
|
+
state.home # "#<Pathname:/Users/demo/.local/state>"
|
|
151
|
+
state.directories # []
|
|
152
|
+
state.all # ["#<Pathname:/Users/demo/.local/state>"]
|
|
153
|
+
|
|
154
|
+
# Strings (explicit and implicit)
|
|
155
|
+
|
|
156
|
+
xdg.to_s # "XDG_CACHE_HOME=/Users/demo/.cache XDG_CONFIG_HOME=/Users/demo/.config XDG_CONFIG_DIRS=/etc/xdg XDG_DATA_HOME=/Users/demo/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share XDG_RUNTIME_DIR= XDG_STATE_HOME=/Users/demo/.local/state"
|
|
157
|
+
cache.to_s # "XDG_CACHE_HOME=/Users/demo/.cache"
|
|
158
|
+
config.to_s # "XDG_CONFIG_HOME=/Users/demo/.config XDG_CONFIG_DIRS=/etc/xdg"
|
|
159
|
+
data.to_s # "XDG_DATA_HOME=/Users/demo/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share"
|
|
160
|
+
runtime.to_s # "XDG_RUNTIME_DIR="
|
|
161
|
+
state.to_s # "XDG_STATE_HOME=/Users/demo/.local/state"
|
|
162
|
+
|
|
163
|
+
xdg.to_str # "XDG_CACHE_HOME=/Users/demo/.cache XDG_CONFIG_HOME=/Users/demo/.config XDG_CONFIG_DIRS=/etc/xdg XDG_DATA_HOME=/Users/demo/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share XDG_RUNTIME_DIR= XDG_STATE_HOME=/Users/demo/.local/state"
|
|
164
|
+
cache.to_str # "XDG_CACHE_HOME=/Users/demo/.cache"
|
|
165
|
+
config.to_str # "XDG_CONFIG_HOME=/Users/demo/.config XDG_CONFIG_DIRS=/etc/xdg"
|
|
166
|
+
data.to_str # "XDG_DATA_HOME=/Users/demo/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share"
|
|
167
|
+
runtime.to_str # "XDG_RUNTIME_DIR="
|
|
168
|
+
state.to_str # "XDG_STATE_HOME=/Users/demo/.local/state"
|
|
158
169
|
|
|
159
170
|
# Inspection
|
|
160
171
|
|
|
161
|
-
xdg.inspect
|
|
162
|
-
cache.inspect
|
|
163
|
-
config.inspect
|
|
164
|
-
data.inspect
|
|
165
|
-
|
|
172
|
+
xdg.inspect # "#<XDG::Environment:1456 XDG_CACHE_HOME=/Users/demo/.cache XDG_CONFIG_HOME=/Users/demo/.config XDG_CONFIG_DIRS=/etc/xdg XDG_DATA_HOME=/Users/demo/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share XDG_RUNTIME_DIR= XDG_STATE_HOME=/Users/demo/.local/state>"
|
|
173
|
+
cache.inspect # "#<XDG::Cache:2040 XDG_CACHE_HOME=/Users/demo/.cache>"
|
|
174
|
+
config.inspect # "#<XDG::Config:2060 XDG_CONFIG_HOME=/Users/demo/.config XDG_CONFIG_DIRS=/etc/xdg>"
|
|
175
|
+
data.inspect # "#<XDG::Data:2080 XDG_DATA_HOME=/Users/demo/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share>"
|
|
176
|
+
runtime.inspect # "#<XDG::Runtime:1496 XDG_RUNTIME_DIR=>"
|
|
177
|
+
state.inspect # "#<XDG::State:2100 XDG_STATE_HOME=/Users/demo/.local/state>"
|
|
166
178
|
----
|
|
167
179
|
|
|
168
180
|
=== Variable Defaults
|
|
@@ -171,15 +183,15 @@ The _XDG Base Directory Specification_ defines environment variables and associa
|
|
|
171
183
|
when not defined or empty. The following defaults, per specification, are implemented by the `XDG`
|
|
172
184
|
objects:
|
|
173
185
|
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
186
|
+
* `XDG_CACHE_HOME="$HOME/.cache"`
|
|
187
|
+
* `XDG_CONFIG_HOME="$HOME/.config"`
|
|
188
|
+
* `XDG_CONFIG_DIRS="/etc/xdg"`
|
|
189
|
+
* `XDG_DATA_HOME="$HOME/.local/share"`
|
|
190
|
+
* `XDG_DATA_DIRS="/usr/local/share/:/usr/share/"`
|
|
191
|
+
* `XDG_RUNTIME_DIR=`
|
|
192
|
+
* `XDG_STATE_HOME="$HOME/.local/state"`
|
|
181
193
|
|
|
182
|
-
The
|
|
194
|
+
The `XDG_RUNTIME_DIR` environment variable deserves special mention because it is more user/environment specific and has no default value. Here is how `XDG_RUNTIME_DIR` is meant to be used should you choose to use it:
|
|
183
195
|
|
|
184
196
|
* _Must_ reference user-specific non-essential runtime files and other file objects (such as
|
|
185
197
|
sockets, named pipes, etc.)
|
|
@@ -205,13 +217,18 @@ memory and cannot necessarily be swapped out to disk.
|
|
|
205
217
|
|
|
206
218
|
=== Variable Behavior
|
|
207
219
|
|
|
208
|
-
The behavior of
|
|
220
|
+
The behavior of the XDG environment variables can be broken down by category:
|
|
209
221
|
|
|
210
|
-
*
|
|
211
|
-
*
|
|
222
|
+
* `+XDG_*_DIR+`
|
|
223
|
+
* `+XDG_*_DIRS+`
|
|
224
|
+
* `+XDG_*_HOME+`
|
|
212
225
|
|
|
213
226
|
Each is described in detail below.
|
|
214
227
|
|
|
228
|
+
==== Directory
|
|
229
|
+
|
|
230
|
+
The `+XDG_*_DIR+` category is unique in that it is specific to the `XDG_RUNTIME_DIR` and has no default value. This directory must adhere to all of the `XDG_RUNTIME_DIR` requirements as documented above.
|
|
231
|
+
|
|
215
232
|
==== Directories
|
|
216
233
|
|
|
217
234
|
These variables are used to define a colon (`:`) delimited list of directories. Order is important
|
|
@@ -237,10 +254,10 @@ The above then yields the following, colon delimited, array:
|
|
|
237
254
|
In the above example, the `"/demo/one/.config"` path takes _highest_ priority since it was
|
|
238
255
|
defined first.
|
|
239
256
|
|
|
240
|
-
====
|
|
257
|
+
==== Home
|
|
241
258
|
|
|
242
|
-
These variables take precedence over the corresponding
|
|
243
|
-
a modified version of the
|
|
259
|
+
These variables take precedence over the corresponding `+XDG_*_DIRS+` environment variables. Using
|
|
260
|
+
a modified version of the `+XDG_*_DIRS+` example, shown above, we could have the following setup:
|
|
244
261
|
|
|
245
262
|
[source,bash]
|
|
246
263
|
----
|
|
@@ -266,8 +283,8 @@ _highest_ priority is: `"/demo/priority"`.
|
|
|
266
283
|
|
|
267
284
|
Path precedence is determined in the following order (with the first taking highest priority):
|
|
268
285
|
|
|
269
|
-
.
|
|
270
|
-
.
|
|
286
|
+
. `+XDG_*_HOME+` - Will be used if defined. Otherwise, falls back to specification default.
|
|
287
|
+
. `+XDG_*_DIRS+` - Iterates through directories in order defined (with first taking highest
|
|
271
288
|
priority). Otherwise, falls back to specification default.
|
|
272
289
|
|
|
273
290
|
== Development
|
data/lib/xdg/environment.rb
CHANGED
|
@@ -7,6 +7,7 @@ module XDG
|
|
|
7
7
|
@cache = Cache.new(home:, directories:, environment:)
|
|
8
8
|
@config = Config.new(home:, directories:, environment:)
|
|
9
9
|
@data = Data.new(home:, directories:, environment:)
|
|
10
|
+
@runtime = Runtime.new(environment:)
|
|
10
11
|
@state = State.new(home:, directories:, environment:)
|
|
11
12
|
freeze
|
|
12
13
|
end
|
|
@@ -21,9 +22,11 @@ module XDG
|
|
|
21
22
|
|
|
22
23
|
def data_dirs = data.directories
|
|
23
24
|
|
|
25
|
+
def runtime_dir = runtime.home
|
|
26
|
+
|
|
24
27
|
def state_home = state.home
|
|
25
28
|
|
|
26
|
-
def to_s = "#{cache} #{config} #{data} #{state}"
|
|
29
|
+
def to_s = "#{cache} #{config} #{data} #{runtime} #{state}"
|
|
27
30
|
|
|
28
31
|
alias to_str to_s
|
|
29
32
|
|
|
@@ -31,6 +34,6 @@ module XDG
|
|
|
31
34
|
|
|
32
35
|
private
|
|
33
36
|
|
|
34
|
-
attr_reader :cache, :config, :data, :state
|
|
37
|
+
attr_reader :cache, :config, :data, :runtime, :state
|
|
35
38
|
end
|
|
36
39
|
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "forwardable"
|
|
4
|
+
|
|
5
|
+
module XDG
|
|
6
|
+
module Paths
|
|
7
|
+
# A XDG any path.
|
|
8
|
+
class Any
|
|
9
|
+
extend Forwardable
|
|
10
|
+
|
|
11
|
+
delegate %i[key value] => :pair
|
|
12
|
+
|
|
13
|
+
def initialize pair, environment = ENV
|
|
14
|
+
@pair = pair
|
|
15
|
+
@environment = environment
|
|
16
|
+
freeze
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def default = expand String(value)
|
|
20
|
+
|
|
21
|
+
def dynamic = String(environment[key]).then { |path| path.empty? ? default : expand(path) }
|
|
22
|
+
|
|
23
|
+
def to_s = [pair.key, dynamic].compact.join XDG::DELIMITER
|
|
24
|
+
|
|
25
|
+
alias to_str to_s
|
|
26
|
+
|
|
27
|
+
def inspect = "#<#{self.class}:#{object_id} #{self}>"
|
|
28
|
+
|
|
29
|
+
protected
|
|
30
|
+
|
|
31
|
+
attr_reader :pair, :environment
|
|
32
|
+
|
|
33
|
+
def expand(path) = Pathname(path).then { path.empty? ? it : it.expand_path }
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
data/lib/xdg/paths/directory.rb
CHANGED
|
@@ -3,15 +3,9 @@
|
|
|
3
3
|
module XDG
|
|
4
4
|
module Paths
|
|
5
5
|
# A collection of XDG directories.
|
|
6
|
-
class Directory
|
|
6
|
+
class Directory < Any
|
|
7
7
|
DELIMITER = ":"
|
|
8
8
|
|
|
9
|
-
def initialize pair, environment = ENV
|
|
10
|
-
@pair = pair
|
|
11
|
-
@environment = environment
|
|
12
|
-
freeze
|
|
13
|
-
end
|
|
14
|
-
|
|
15
9
|
def default = value.split(DELIMITER).map { |path| expand path }
|
|
16
10
|
|
|
17
11
|
def dynamic
|
|
@@ -32,15 +26,9 @@ module XDG
|
|
|
32
26
|
pairs.empty? ? "#<#{type}:#{object_id}>" : "#<#{type}:#{object_id} #{self}>"
|
|
33
27
|
end
|
|
34
28
|
|
|
35
|
-
private
|
|
36
|
-
|
|
37
|
-
attr_reader :pair, :environment
|
|
38
|
-
|
|
39
29
|
def key = String pair.key
|
|
40
30
|
|
|
41
31
|
def value = String pair.value
|
|
42
|
-
|
|
43
|
-
def expand(path) = Pathname(path).expand_path
|
|
44
32
|
end
|
|
45
33
|
end
|
|
46
34
|
end
|
data/lib/xdg/paths/home.rb
CHANGED
|
@@ -1,40 +1,25 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "forwardable"
|
|
4
|
-
|
|
5
3
|
module XDG
|
|
6
4
|
module Paths
|
|
7
5
|
# A XDG home path.
|
|
8
|
-
class Home
|
|
9
|
-
extend Forwardable
|
|
10
|
-
|
|
6
|
+
class Home < Any
|
|
11
7
|
KEY = "HOME"
|
|
12
8
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@pair = pair
|
|
17
|
-
@environment = environment
|
|
18
|
-
freeze
|
|
9
|
+
def initialize pair, environment = ENV, default_key: KEY
|
|
10
|
+
@default_key = default_key
|
|
11
|
+
super(pair, environment)
|
|
19
12
|
end
|
|
20
13
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def dynamic = String(environment[key]).then { |path| path.empty? ? default : expand(path) }
|
|
24
|
-
|
|
25
|
-
def to_s = [pair.key, dynamic].compact.join XDG::DELIMITER
|
|
14
|
+
protected
|
|
26
15
|
|
|
27
|
-
|
|
16
|
+
def expand(path) = home.join(path).expand_path
|
|
28
17
|
|
|
29
|
-
def
|
|
18
|
+
def home = Pathname environment.fetch(default_key)
|
|
30
19
|
|
|
31
20
|
private
|
|
32
21
|
|
|
33
|
-
attr_reader :
|
|
34
|
-
|
|
35
|
-
def expand(path) = home.join(path).expand_path
|
|
36
|
-
|
|
37
|
-
def home = Pathname environment.fetch(KEY)
|
|
22
|
+
attr_reader :default_key
|
|
38
23
|
end
|
|
39
24
|
end
|
|
40
25
|
end
|
data/lib/xdg/runtime.rb
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "forwardable"
|
|
4
|
+
require "xdg/pair"
|
|
5
|
+
|
|
6
|
+
module XDG
|
|
7
|
+
# Provides runtime support.
|
|
8
|
+
class Runtime
|
|
9
|
+
extend Forwardable
|
|
10
|
+
|
|
11
|
+
HOME_PAIR = Pair["XDG_RUNTIME_DIR", nil].freeze
|
|
12
|
+
|
|
13
|
+
delegate %i[home directories all to_s to_str] => :combined
|
|
14
|
+
|
|
15
|
+
def initialize home: Paths::Any, directories: Paths::Directory, environment: ENV
|
|
16
|
+
@combined = Paths::Combined.new home.new(HOME_PAIR, environment),
|
|
17
|
+
directories.new(Pair.new, environment)
|
|
18
|
+
freeze
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def inspect = "#<#{self.class}:#{object_id} #{self}>"
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
attr_reader :combined
|
|
26
|
+
end
|
|
27
|
+
end
|
data/lib/xdg.rb
CHANGED
|
@@ -5,9 +5,11 @@ require "xdg/config"
|
|
|
5
5
|
require "xdg/data"
|
|
6
6
|
require "xdg/environment"
|
|
7
7
|
require "xdg/pair"
|
|
8
|
+
require "xdg/paths/any"
|
|
8
9
|
require "xdg/paths/combined"
|
|
9
10
|
require "xdg/paths/directory"
|
|
10
11
|
require "xdg/paths/home"
|
|
12
|
+
require "xdg/runtime"
|
|
11
13
|
require "xdg/state"
|
|
12
14
|
|
|
13
15
|
# Main namespace.
|
data/xdg.gemspec
CHANGED
data.tar.gz.sig
CHANGED
|
Binary file
|
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: 10.
|
|
4
|
+
version: 10.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brooke Kuhlmann
|
|
@@ -51,9 +51,11 @@ files:
|
|
|
51
51
|
- lib/xdg/data.rb
|
|
52
52
|
- lib/xdg/environment.rb
|
|
53
53
|
- lib/xdg/pair.rb
|
|
54
|
+
- lib/xdg/paths/any.rb
|
|
54
55
|
- lib/xdg/paths/combined.rb
|
|
55
56
|
- lib/xdg/paths/directory.rb
|
|
56
57
|
- lib/xdg/paths/home.rb
|
|
58
|
+
- lib/xdg/runtime.rb
|
|
57
59
|
- lib/xdg/state.rb
|
|
58
60
|
- xdg.gemspec
|
|
59
61
|
homepage: https://alchemists.io/projects/xdg
|
|
@@ -81,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
81
83
|
- !ruby/object:Gem::Version
|
|
82
84
|
version: '0'
|
|
83
85
|
requirements: []
|
|
84
|
-
rubygems_version: 4.0.
|
|
86
|
+
rubygems_version: 4.0.15
|
|
85
87
|
specification_version: 4
|
|
86
88
|
summary: A XDG Base Directory Specification implementation.
|
|
87
89
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|