xdg 4.0.0 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba7e0f5588bda1898dfee94c2c91728ae85103de2a32e2cf2c78d7cb02b18686
4
- data.tar.gz: cf5947fb643be6e37b0e8fe004896d6d90309a93e556f19aefc34d9396382b68
3
+ metadata.gz: 49e7d7cbd2b446a547047c1eac3f7c930a304e671242e7d73a28fd396baf70ad
4
+ data.tar.gz: 58a885a0da46a1ea5cb51c05bdd3f8e7b99300f8fcafc66a9f8d788e8f5b96df
5
5
  SHA512:
6
- metadata.gz: 4382af9e6f4f6fdb188c0eee22471ddf2390a9a983364e23b59f4f9b9ce03edd5ee345deb445d35ae891f43883acbce9757e5acb36b26b78e1a25668ac8f1a20
7
- data.tar.gz: bc8152d7471a4bc12f7627f5ff5ac51c0438baf15b55c7ae06d5fce82da051a5a1e7ae4d3c21d0a0b5e1c04d1dc176bb758b7f0262a092bdadedf1a0341f0845
6
+ metadata.gz: c51e414b8fcfbcd918b1d641e75d1d68d1ad770bb4a514ba6231d3a8f315882f966c5f17acfedf4c79c5dbe2a9b926193fc440d015e5bd999d0f202183fe8bbf
7
+ data.tar.gz: b789fbf411cb06bf8c385de750e5ce57cd8206a3dc756334e8aa25f2b1c86b0e9bcab8803394b1a7e7b865e8ae0aaa28e803dd064053c525917a9ee3557cf6c7
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,4 +1,4 @@
1
- # Apache License
1
+ = Apache License
2
2
 
3
3
  Version 2.0, January 2004
4
4
 
@@ -6,7 +6,7 @@ http://www.apache.org/licenses
6
6
 
7
7
  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
8
 
9
- ## 1. Definitions
9
+ == 1. Definitions
10
10
 
11
11
  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by
12
12
  Sections 1 through 9 of this document.
@@ -54,14 +54,14 @@ Contribution."
54
54
  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a
55
55
  Contribution has been received by Licensor and subsequently incorporated within the Work.
56
56
 
57
- ## 2. Grant of Copyright License
57
+ == 2. Grant of Copyright License
58
58
 
59
59
  Subject to the terms and conditions of this License, each Contributor hereby grants to You a
60
60
  perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to
61
61
  reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and
62
62
  distribute the Work and such Derivative Works in Source or Object form.
63
63
 
64
- ## 3. Grant of Patent License
64
+ == 3. Grant of Patent License
65
65
 
66
66
  Subject to the terms and conditions of this License, each Contributor hereby grants to You a
67
67
  perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
@@ -74,39 +74,38 @@ a Contribution incorporated within the Work constitutes direct or contributory p
74
74
  then any patent licenses granted to You under this License for that Work shall terminate as of the
75
75
  date such litigation is filed.
76
76
 
77
- ## 4. Redistribution
77
+ == 4. Redistribution
78
78
 
79
79
  You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with
80
80
  or without modifications, and in Source or Object form, provided that You meet the following
81
81
  conditions:
82
82
 
83
- 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
83
+ . You must give any other recipients of the Work or Derivative Works a copy of this License; and
84
84
 
85
- 2. You must cause any modified files to carry prominent notices stating that You changed the
86
- files; and
85
+ . You must cause any modified files to carry prominent notices stating that You changed the files;
86
+ and
87
87
 
88
- 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
89
- patent, trademark, and attribution notices from the Source form of the Work, excluding those
90
- notices that do not pertain to any part of the Derivative Works; and
88
+ . You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
89
+ patent, trademark, and attribution notices from the Source form of the Work, excluding those
90
+ notices that do not pertain to any part of the Derivative Works; and
91
91
 
92
- 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative
93
- Works that You distribute must include a readable copy of the attribution notices contained
94
- within such NOTICE file, excluding those notices that do not pertain to any part of the
95
- Derivative Works, in at least one of the following places: within a NOTICE text file
96
- distributed as part of the Derivative Works; within the Source form or documentation, if
97
- provided along with the Derivative Works; or, within a display generated by the Derivative
98
- Works, if and wherever such third-party notices normally appear. The contents of the NOTICE
99
- file are for informational purposes only and do not modify the License. You may add Your own
100
- attribution notices within Derivative Works that You distribute, alongside or as an addendum to
101
- the NOTICE text from the Work, provided that such additional attribution notices cannot be
102
- construed as modifying the License.
92
+ . If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works
93
+ that You distribute must include a readable copy of the attribution notices contained within such
94
+ NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in
95
+ at least one of the following places: within a NOTICE text file distributed as part of the
96
+ Derivative Works; within the Source form or documentation, if provided along with the Derivative
97
+ Works; or, within a display generated by the Derivative Works, if and wherever such third-party
98
+ notices normally appear. The contents of the NOTICE file are for informational purposes only and
99
+ do not modify the License. You may add Your own attribution notices within Derivative Works that
100
+ You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such
101
+ additional attribution notices cannot be construed as modifying the License.
103
102
 
104
103
  You may add Your own copyright statement to Your modifications and may provide additional or
105
104
  different license terms and conditions for use, reproduction, or distribution of Your modifications,
106
105
  or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of
107
106
  the Work otherwise complies with the conditions stated in this License.
108
107
 
109
- ## 5. Submission of Contributions
108
+ == 5. Submission of Contributions
110
109
 
111
110
  Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the
112
111
  Work by You to the Licensor shall be under the terms and conditions of this License, without any
@@ -114,13 +113,13 @@ additional terms or conditions. Notwithstanding the above, nothing herein shall
114
113
  the terms of any separate license agreement you may have executed with Licensor regarding such
115
114
  Contributions.
116
115
 
117
- ## 6. Trademarks
116
+ == 6. Trademarks
118
117
 
119
118
  This License does not grant permission to use the trade names, trademarks, service marks, or product
120
119
  names of the Licensor, except as required for reasonable and customary use in describing the origin
121
120
  of the Work and reproducing the content of the NOTICE file.
122
121
 
123
- ## 7. Disclaimer of Warranty
122
+ == 7. Disclaimer of Warranty
124
123
 
125
124
  Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each
126
125
  Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -129,7 +128,7 @@ TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. Y
129
128
  responsible for determining the appropriateness of using or redistributing the Work and assume any
130
129
  risks associated with Your exercise of permissions under this License.
131
130
 
132
- ## 8. Limitation of Liability
131
+ == 8. Limitation of Liability
133
132
 
134
133
  In no event and under no legal theory, whether in tort (including negligence), contract, or
135
134
  otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or
@@ -139,7 +138,7 @@ License or out of the use or inability to use the Work (including but not limite
139
138
  loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial
140
139
  damages or losses), even if such Contributor has been advised of the possibility of such damages.
141
140
 
142
- ## 9. Accepting Warranty or Additional Liability
141
+ == 9. Accepting Warranty or Additional Liability
143
142
 
144
143
  While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee
145
144
  for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights
@@ -151,11 +150,11 @@ additional liability.
151
150
 
152
151
  END OF TERMS AND CONDITIONS
153
152
 
154
- Copyright 2019 [Alchemists](https://www.alchemists.io).
153
+ Copyright 2019 link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
155
154
 
156
155
  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
157
- compliance with the License. You may obtain a [copy](http://www.apache.org/licenses/LICENSE-2.0) of
158
- the License.
156
+ compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
157
+ of the License.
159
158
 
160
159
  Unless required by applicable law or agreed to in writing, software distributed under the License is
161
160
  distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
@@ -0,0 +1,298 @@
1
+ :toc: macro
2
+ :toclevels: 5
3
+ :figure-caption!:
4
+
5
+ = XDG
6
+
7
+ [link=http://badge.fury.io/rb/xdg]
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]
11
+ [link=https://circleci.com/gh/bkuhlmann/xdg]
12
+ image::https://circleci.com/gh/bkuhlmann/xdg.svg?style=svg[Circle CI Status]
13
+
14
+ Provides a Ruby implementation of the
15
+ https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html[XDG Base Directory
16
+ Specification].
17
+
18
+ 💡 If you write a lot of Command Line Interfaces and would like additional syntactic sugar that
19
+ includes what is found in this gem, make sure to check out the
20
+ link:https://www.alchemists.io/projects/runcom[Runcom] gem too.
21
+
22
+ toc::[]
23
+
24
+ == Features
25
+
26
+ * Provides a `XDG::Environment` object that adheres to the _XDG Base Directory Specification_ with
27
+ access to the following environment settings:
28
+ ** `$XDG_CACHE_HOME`
29
+ ** `$XDG_CONFIG_HOME`
30
+ ** `$XDG_CONFIG_DIRS`
31
+ ** `$XDG_DATA_HOME`
32
+ ** `$XDG_DATA_DIRS`
33
+
34
+ == Requirements
35
+
36
+ . https://www.ruby-lang.org[Ruby]
37
+
38
+ == Setup
39
+
40
+ To install, run:
41
+
42
+ [source,bash]
43
+ ----
44
+ gem install xdg
45
+ ----
46
+
47
+ Add the following to your Gemfile:
48
+
49
+ [source,ruby]
50
+ ----
51
+ gem "xdg"
52
+ ----
53
+
54
+ == Usage
55
+
56
+ The following describes how to use this XDG implementation.
57
+
58
+ === Overview
59
+
60
+ To get up and running quickly, use `+XDG::Environment+` as follows:
61
+
62
+ [source,ruby]
63
+ ----
64
+ xdg = XDG::Environment.new
65
+ xdg.cache_home # <= Answers computed `$XDG_CACHE_HOME` value.
66
+ xdg.config_home # <= Answers computed `$XDG_CONFIG_HOME` value.
67
+ xdg.config_dirs # <= Answers computed `$XDG_CONFIG_DIRS` value.
68
+ xdg.data_home # <= Answers computed `$XDG_DATA_HOME` value.
69
+ xdg.data_dirs # <= Answers computed `$XDG_DATA_DIRS` value.
70
+ ----
71
+
72
+ The _computed_ value, in this case, is either the user-defined value of the key or the default
73
+ value, per specification, when the key is not defined or empty. For more on this, scroll down to the
74
+ _Variable Defaults_ section to learn more.
75
+
76
+ The `XDG::Environment` wraps the following objects which can be used individually if you don’t
77
+ want to load the entire environment:
78
+
79
+ [source,ruby]
80
+ ----
81
+ cache = XDG::Cache.new
82
+ config = XDG::Config.new
83
+ data = XDG::Data.new
84
+ ----
85
+
86
+ The `cache`, `config`, and `data` objects share the same API which means you can ask each the
87
+ following messages:
88
+
89
+ * `#home` - Answers the home directory as computed via the `$XDG_*_HOME` key.
90
+ * `#directories` - Answers an array directories as computed via the `$XDG_*_DIRS` key.
91
+ * `#all` - Answers an array of _all_ directories as computed from the combined `$XDG_*_HOME` and
92
+ `$XDG_*_DIRS` values (with `$XDG_*_HOME` prefixed at the start of the array).
93
+
94
+ === Examples
95
+
96
+ The following are examples of what you would see when playing around with the XDG objects within an
97
+ IRB console (taken from my own environment):
98
+
99
+ [source,ruby]
100
+ ----
101
+ require "xdg"
102
+
103
+ # Initialization
104
+ environment = XDG::Environment.new
105
+ cache = XDG::Cache.new
106
+ config = XDG::Config.new
107
+ data = XDG::Data.new
108
+
109
+ # Inspection
110
+ environment.inspect # => XDG_CACHE_HOME=/Users/bkuhlmann/.cache XDG_CONFIG_HOME=/Users/bkuhlmann/.config XDG_CONFIG_DIRS=/etc/xdg XDG_DATA_HOME=/Users/bkuhlmann/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share
111
+ cache.inspect # => "XDG_CACHE_HOME=/Users/bkuhlmann/.cache"
112
+ config.inspect # => "XDG_CONFIG_HOME=/Users/bkuhlmann/.config XDG_CONFIG_DIRS=/etc/xdg"
113
+ data.inspect # => "XDG_DATA_HOME=/Users/bkuhlmann/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share"
114
+
115
+ # Paths
116
+ environment.cache_home # => #<Pathname:/Users/bkuhlmann/.cache>
117
+ environment.config_home # => #<Pathname:/Users/bkuhlmann/.config>
118
+ environment.config_dirs # => [#<Pathname:/etc/xdg>]
119
+ environment.data_home # => #<Pathname:/Users/bkuhlmann/.local/share>
120
+ environment.data_dirs # => [#<Pathname:/usr/local/share>, #<Pathname:/usr/share>]
121
+
122
+ cache.home # => #<Pathname:/Users/bkuhlmann/.cache>
123
+ cache.directories # => []
124
+ cache.all # => [#<Pathname:/Users/bkuhlmann/.cache>]
125
+
126
+ config.home # => #<Pathname:/Users/bkuhlmann/.config>
127
+ config.directories # => [#<Pathname:/etc/xdg>]
128
+ config.all # => [#<Pathname:/Users/bkuhlmann/.config>, #<Pathname:/etc/xdg>]
129
+
130
+ data.home # => #<Pathname:/Users/bkuhlmann/.local/share>
131
+ data.directories # => [#<Pathname:/usr/local/share>, #<Pathname:/usr/share>]
132
+ data.all # => [#<Pathname:/Users/bkuhlmann/.local/share>, #<Pathname:/usr/local/share>, #<Pathname:/usr/share>]
133
+ ----
134
+
135
+ As you can see from above, each XDG object answers back a `Pathname` which means you have the full
136
+ `Pathname` API at your fingertips to build upon the output of these objects as needed.
137
+
138
+ === Variable Defaults
139
+
140
+ The _XDG Base Directory Specification_ defines environment variables and associated default values
141
+ when not defined or empty. The following defaults, per specification, are implemented by the `XDG`
142
+ objects:
143
+
144
+ * `$XDG_CACHE_HOME="$HOME/.cache"`
145
+ * `$XDG_CONFIG_HOME="$HOME/.config"`
146
+ * `$XDG_CONFIG_DIRS="/etc/xdg"`
147
+ * `$XDG_DATA_HOME="$HOME/.local/share"`
148
+ * `$XDG_DATA_DIRS="/usr/local/share/:/usr/share/"`
149
+ * `$XDG_RUNTIME_DIR`
150
+
151
+ The `$XDG_RUNTIME_DIR` deserves special mention as it’s not, _currently_, implemented as part of
152
+ this gem because it is more user/environment specific. Here is how the `$XDG_RUNTIME_DIR` is meant
153
+ to be used should you choose to use it:
154
+
155
+ * _Must_ reference user-specific non-essential runtime files and other file objects (such as
156
+ sockets, named pipes, etc.)
157
+ * _Must_ be owned by the user with _only_ the user having read and write access to it.
158
+ * _Must_ have a Unix access mode of `0700`.
159
+ * _Must_ be bound to the user when logging in.
160
+ * _Must_ be removed when the user logs out.
161
+ * _Must_ be pointed to the same directory when the user logs in more than once.
162
+ * _Must_ exist from first login to last logout on the system and not removed in between.
163
+ * _Must_ not allow files in the directory to survive reboot or a full logout/login cycle.
164
+ * _Must_ keep the directory on the local file system and not shared with any other file systems.
165
+ * _Must_ keep the directory fully-featured by the standards of the operating system. Specifically,
166
+ on Unix-like operating systems AF_UNIX sockets, symbolic links, hard links, proper permissions, file
167
+ locking, sparse files, memory mapping, file change notifications, a reliable hard link count must be
168
+ supported, and no restrictions on the file name character set should be imposed. Files in this
169
+ directory _may_ be subjected to periodic clean-up. To ensure files are not removed, they should have
170
+ their access time timestamp modified at least once every 6 hours of monotonic time or the '`sticky`'
171
+ bit should be set on the file.
172
+ * When not set, applications should fall back to a replacement directory with similar capabilities
173
+ and print a warning message. Applications should use this directory for communication and
174
+ synchronization purposes and should not place larger files in it, since it might reside in runtime
175
+ memory and cannot necessarily be swapped out to disk.
176
+
177
+ === Variable Behavior
178
+
179
+ The behavior of most XDG environment variables can be lumped into two categories:
180
+
181
+ * `$XDG_*_HOME`
182
+ * `$XDG_*_DIRS`
183
+
184
+ Each is described in detail below.
185
+
186
+ ==== `$XDG_*_DIRS`
187
+
188
+ These variables are used to define a colon (`:`) delimited list of directories. Order is important
189
+ as the first directory defined will take precedent over the following directory and so forth. For
190
+ example, here is a situation where the `XDG_CONFIG_DIRS` key has a custom value:
191
+
192
+ [source,bash]
193
+ ----
194
+ XDG_CONFIG_DIRS="/example/one/.config:/example/two/.settings:/example/three/.configuration"
195
+ ----
196
+
197
+ Yields the following, colon delimited, array:
198
+
199
+ [source,ruby]
200
+ ----
201
+ [
202
+ "/example/one/.config",
203
+ "/example/two/.settings",
204
+ "/example/three/.configuration"
205
+ ]
206
+ ----
207
+
208
+ In the above example, the `"/example/one/.config"` path takes _highest_ priority since it was
209
+ defined first.
210
+
211
+ ==== `$XDG_*_HOME`
212
+
213
+ These variables take precidence over the corresponding `$XDG_*_DIRS` environment variables. Using
214
+ a modified version of the `$XDG_*_DIRS` example, shown above, we could have the following setup:
215
+
216
+ [source,bash]
217
+ ----
218
+ XDG_CONFIG_HOME="/example/priority"
219
+ XDG_CONFIG_DIRS="/example/one/.config:/example/two/.settings"
220
+ ----
221
+
222
+ Yields the following, colon delimited, array:
223
+
224
+ [source,ruby]
225
+ ----
226
+ [
227
+ "/example/priority",
228
+ "/example/one/.config",
229
+ "/example/two/.settings"
230
+ ]
231
+ ----
232
+
233
+ Due to `XDG_CONFIG_HOME` taking precidence over the `XDG_CONFIG_DIRS`, the path with the
234
+ _highest_ priority in this example is: `"/example/priority"`.
235
+
236
+ === Variable Priority
237
+
238
+ Path precedence is determined in the following order (with the first taking highest priority):
239
+
240
+ . `$XDG_*_HOME` - Will be used if defined. Otherwise, falls back to specification default.
241
+ . `$XDG_*_DIRS` - Iterates through directories in order defined (with first taking highest
242
+ priority). Otherwise, falls back to specification default.
243
+
244
+ == Development
245
+
246
+ To contribute, run:
247
+
248
+ [source,bash]
249
+ ----
250
+ git clone https://github.com/bkuhlmann/xdg.git
251
+ cd xdg
252
+ bin/setup
253
+ ----
254
+
255
+ You can also use the IRB console for direct access to all objects:
256
+
257
+ [source,bash]
258
+ ----
259
+ bin/console
260
+ ----
261
+
262
+ == Tests
263
+
264
+ To test, run:
265
+
266
+ [source,bash]
267
+ ----
268
+ bundle exec rake
269
+ ----
270
+
271
+ == Versioning
272
+
273
+ Read link:https://semver.org[Semantic Versioning] for details. Briefly, it means:
274
+
275
+ * Major (X.y.z) - Incremented for any backwards incompatible public API changes.
276
+ * Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
277
+ * Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
278
+
279
+ == Code of Conduct
280
+
281
+ Please note that this project is released with a link:CODE_OF_CONDUCT.adoc[CODE OF CONDUCT]. By
282
+ participating in this project you agree to abide by its terms.
283
+
284
+ == Contributions
285
+
286
+ Read link:CONTRIBUTING.adoc[CONTRIBUTING] for details.
287
+
288
+ == License
289
+
290
+ Read link:LICENSE.adoc[LICENSE] for details.
291
+
292
+ == History
293
+
294
+ Read link:CHANGES.adoc[CHANGES] for details.
295
+
296
+ == Credits
297
+
298
+ Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
@@ -3,20 +3,9 @@
3
3
  module XDG
4
4
  # Gem identity information.
5
5
  module Identity
6
- def self.name
7
- "xdg"
8
- end
9
-
10
- def self.label
11
- "XDG"
12
- end
13
-
14
- def self.version
15
- "4.0.0"
16
- end
17
-
18
- def self.version_label
19
- "#{label} #{version}"
20
- end
6
+ NAME = "xdg"
7
+ LABEL = "XDG"
8
+ VERSION = "4.4.0"
9
+ VERSION_LABEL = "#{LABEL} #{VERSION}"
21
10
  end
22
11
  end
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xdg
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAjANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0xOTAyMTcxNjAxMTFaFw0yMDAyMTcx
15
- NjAxMTFaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
13
+ MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
+ a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMDAzMTUxNDQ1MzJaFw0yMTAzMTUx
15
+ NDQ1MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
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/gY4ggwDQYJKoZIhvcNAQELBQADggEBANgfX7kPZkJvsbdWMvbe
24
- DUUYxRTqTUzCDpLd2p3sQvgLMKjTNSKt6CFq/kh+98b6RCgO6DqiVfxvOEq02dvf
25
- ebMN/ylQqan2FgiAs1rpP0/D4C0MlBjoDktsT+2IyLol1KmkDB20ExJ4Sf1GRNdA
26
- hpWOtcgqHtmrc7xzgB6BuyoYufrKKUlCO3ewTM4C375D2qO7hIdKuMOO3CdPMtSk
27
- OrWpbzCL+nbbXqeoqiHgZaUvcyyQrGj5sQRxMTzuMXzzQxtHnuTuKrcz16HMTX/O
28
- dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
29
- y84=
23
+ 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAIHhAlD3po4sTYqacXaQ
24
+ XI9jIhrfMy//2PgbHWcETtlJPBeNUbbSNBABcllUHKqYsVDlSvSmss034KSWNR8F
25
+ bF1GcloicyvcCC4y6IoW4it0COAcdeaaxkxiBSgKdQFpff9REnDlIKK4uQ9lLxIo
26
+ Y2G5xubiziKZkyfWFuSr67PIjW3Bu673D1JVBArhA1qbgQmYQcy1CkGOjo+iO8Nf
27
+ 7u/QSfBHb+r/bXhKscDgPpnKwbUmvgO2+94zJG9KsrmIydlzYfsD09aXKx0t6Xy4
28
+ 2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
+ QWc=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-01-01 00:00:00.000000000 Z
31
+ date: 2020-11-14 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler-audit
@@ -36,14 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.6'
39
+ version: '0.7'
40
40
  type: :development
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.6'
46
+ version: '0.7'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler-leak
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.2'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '0.2'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: guard-rspec
49
63
  requirement: !ruby/object:Gem::Requirement
@@ -64,28 +78,28 @@ dependencies:
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: '0.12'
81
+ version: '0.13'
68
82
  type: :development
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '0.12'
88
+ version: '0.13'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: pry-byebug
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '3.7'
95
+ version: '3.9'
82
96
  type: :development
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '3.7'
102
+ version: '3.9'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: rake
91
105
  requirement: !ruby/object:Gem::Requirement
@@ -106,56 +120,56 @@ dependencies:
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '5.4'
123
+ version: '6.0'
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - "~>"
115
129
  - !ruby/object:Gem::Version
116
- version: '5.4'
130
+ version: '6.0'
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: rspec
119
133
  requirement: !ruby/object:Gem::Requirement
120
134
  requirements:
121
135
  - - "~>"
122
136
  - !ruby/object:Gem::Version
123
- version: '3.9'
137
+ version: '3.10'
124
138
  type: :development
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - "~>"
129
143
  - !ruby/object:Gem::Version
130
- version: '3.9'
144
+ version: '3.10'
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: rubocop
133
147
  requirement: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - "~>"
136
150
  - !ruby/object:Gem::Version
137
- version: '0.78'
151
+ version: '1.3'
138
152
  type: :development
139
153
  prerelease: false
140
154
  version_requirements: !ruby/object:Gem::Requirement
141
155
  requirements:
142
156
  - - "~>"
143
157
  - !ruby/object:Gem::Version
144
- version: '0.78'
158
+ version: '1.3'
145
159
  - !ruby/object:Gem::Dependency
146
160
  name: rubocop-performance
147
161
  requirement: !ruby/object:Gem::Requirement
148
162
  requirements:
149
163
  - - "~>"
150
164
  - !ruby/object:Gem::Version
151
- version: '1.5'
165
+ version: '1.8'
152
166
  type: :development
153
167
  prerelease: false
154
168
  version_requirements: !ruby/object:Gem::Requirement
155
169
  requirements:
156
170
  - - "~>"
157
171
  - !ruby/object:Gem::Version
158
- version: '1.5'
172
+ version: '1.8'
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: rubocop-rake
161
175
  requirement: !ruby/object:Gem::Requirement
@@ -176,39 +190,39 @@ dependencies:
176
190
  requirements:
177
191
  - - "~>"
178
192
  - !ruby/object:Gem::Version
179
- version: '1.37'
193
+ version: '2.0'
180
194
  type: :development
181
195
  prerelease: false
182
196
  version_requirements: !ruby/object:Gem::Requirement
183
197
  requirements:
184
198
  - - "~>"
185
199
  - !ruby/object:Gem::Version
186
- version: '1.37'
200
+ version: '2.0'
187
201
  - !ruby/object:Gem::Dependency
188
202
  name: simplecov
189
203
  requirement: !ruby/object:Gem::Requirement
190
204
  requirements:
191
205
  - - "~>"
192
206
  - !ruby/object:Gem::Version
193
- version: '0.17'
207
+ version: '0.19'
194
208
  type: :development
195
209
  prerelease: false
196
210
  version_requirements: !ruby/object:Gem::Requirement
197
211
  requirements:
198
212
  - - "~>"
199
213
  - !ruby/object:Gem::Version
200
- version: '0.17'
201
- description:
214
+ version: '0.19'
215
+ description:
202
216
  email:
203
217
  - brooke@alchemists.io
204
218
  executables: []
205
219
  extensions: []
206
220
  extra_rdoc_files:
207
- - README.md
208
- - LICENSE.md
221
+ - README.adoc
222
+ - LICENSE.adoc
209
223
  files:
210
- - LICENSE.md
211
- - README.md
224
+ - LICENSE.adoc
225
+ - README.adoc
212
226
  - lib/xdg.rb
213
227
  - lib/xdg/cache.rb
214
228
  - lib/xdg/config.rb
@@ -219,14 +233,15 @@ files:
219
233
  - lib/xdg/paths/combined.rb
220
234
  - lib/xdg/paths/directory.rb
221
235
  - lib/xdg/paths/home.rb
222
- homepage: https://github.com/bkuhlmann/xdg
236
+ homepage: https://www.alchemists.io/projects/xdg
223
237
  licenses:
224
238
  - Apache-2.0
225
239
  metadata:
226
- source_code_uri: https://github.com/bkuhlmann/xdg
227
- changelog_uri: https://github.com/bkuhlmann/xdg/blob/master/CHANGES.md
228
240
  bug_tracker_uri: https://github.com/bkuhlmann/xdg/issues
229
- post_install_message:
241
+ changelog_uri: https://www.alchemists.io/projects/xdg/changes.html
242
+ documentation_uri: https://www.alchemists.io/projects/xdg
243
+ source_code_uri: https://github.com/bkuhlmann/xdg
244
+ post_install_message:
230
245
  rdoc_options: []
231
246
  require_paths:
232
247
  - lib
@@ -241,8 +256,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
241
256
  - !ruby/object:Gem::Version
242
257
  version: '0'
243
258
  requirements: []
244
- rubygems_version: 3.1.2
245
- signing_key:
259
+ rubygems_version: 3.1.4
260
+ signing_key:
246
261
  specification_version: 4
247
262
  summary: Provides an implementation of the XDG Base Directory Specification.
248
263
  test_files: []
metadata.gz.sig CHANGED
Binary file
data/README.md DELETED
@@ -1,271 +0,0 @@
1
- <p align="center">
2
- <img src="xdg.png" alt="XDG Icon"/>
3
- </p>
4
-
5
- # XDG
6
-
7
- [![Gem Version](https://badge.fury.io/rb/xdg.svg)](http://badge.fury.io/rb/xdg)
8
- [![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/73c8f06ae65cbe663e1c/maintainability)](https://codeclimate.com/github/bkuhlmann/xdg/maintainability)
9
- [![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/73c8f06ae65cbe663e1c/test_coverage)](https://codeclimate.com/github/bkuhlmann/xdg/test_coverage)
10
- [![Circle CI Status](https://circleci.com/gh/bkuhlmann/xdg.svg?style=svg)](https://circleci.com/gh/bkuhlmann/xdg)
11
-
12
- Provides a Ruby implementation of the [XDG Base Directory
13
- Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html).
14
-
15
- :bulb: If you write a lot of Command Line Interfaces and would like additional syntactic
16
- sugar that includes what is found in this gem, make sure to check out the
17
- [Runcom](https://github.com/bkuhlmann/runcom) gem too.
18
-
19
- <!-- Tocer[start]: Auto-generated, don't remove. -->
20
-
21
- ## Table of Contents
22
-
23
- - [Features](#features)
24
- - [Requirements](#requirements)
25
- - [Setup](#setup)
26
- - [Usage](#usage)
27
- - [Overview](#overview)
28
- - [Examples](#examples)
29
- - [Variable Defaults](#variable-defaults)
30
- - [Variable Behavior](#variable-behavior)
31
- - [`$XDG_*_DIRS`](#xdg__dirs)
32
- - [`$XDG_*_HOME`](#xdg__home)
33
- - [Variable Priority](#variable-priority)
34
- - [Tests](#tests)
35
- - [Versioning](#versioning)
36
- - [Code of Conduct](#code-of-conduct)
37
- - [Contributions](#contributions)
38
- - [License](#license)
39
- - [History](#history)
40
- - [Credits](#credits)
41
-
42
- <!-- Tocer[finish]: Auto-generated, don't remove. -->
43
-
44
- ## Features
45
-
46
- - Provides a `XDG::Environment` object that adheres to the *XDG Base Directory Specification* with
47
- access to the following environment settings:
48
- - `$XDG_CACHE_HOME`
49
- - `$XDG_CONFIG_HOME`
50
- - `$XDG_CONFIG_DIRS`
51
- - `$XDG_DATA_HOME`
52
- - `$XDG_DATA_DIRS`
53
-
54
- ## Requirements
55
-
56
- 1. [Ruby 2.6.4](https://www.ruby-lang.org)
57
-
58
- ## Setup
59
-
60
- To install, run:
61
-
62
- gem install xdg
63
-
64
- Add the following to your Gemfile:
65
-
66
- gem "xdg"
67
-
68
- ## Usage
69
-
70
- The following describes how to use this XDG implementation.
71
-
72
- #### Overview
73
-
74
- To get up and running quickly, use `XDG::Environment` as follows:
75
-
76
- xdg = XDG::Environment.new
77
- xdg.cache_home # <= Answers computed `$XDG_CACHE_HOME` value.
78
- xdg.config_home # <= Answers computed `$XDG_CONFIG_HOME` value.
79
- xdg.config_dirs # <= Answers computed `$XDG_CONFIG_DIRS` value.
80
- xdg.data_home # <= Answers computed `$XDG_DATA_HOME` value.
81
- xdg.data_dirs # <= Answers computed `$XDG_DATA_DIRS` value.
82
-
83
- The *computed* value, in this case, is either the user-defined value of the key or the default
84
- value, per specification, when the key is not defined or empty. For more on this, scroll down to the
85
- *Variable Defaults* section to learn more.
86
-
87
- The `XDG::Environment` wraps the following objects which can be used individually if you
88
- don't want to load the entire environment:
89
-
90
- cache = XDG::Cache.new
91
- config = XDG::Config.new
92
- data = XDG::Data.new
93
-
94
- The `cache`, `config`, and `data` objects share the same API which means you can ask each the
95
- following messages:
96
-
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).
101
-
102
- #### Examples
103
-
104
- The following are examples of what you would see when playing around with the XDG objects within an
105
- IRB console (taken from my own environment):
106
-
107
- require "xdg"
108
-
109
- # Initialization
110
- environment = XDG::Environment.new
111
- cache = XDG::Cache.new
112
- config = XDG::Config.new
113
- data = XDG::Data.new
114
-
115
- # Inspection
116
- environment.inspect # => XDG_CACHE_HOME=/Users/bkuhlmann/.cache XDG_CONFIG_HOME=/Users/bkuhlmann/.config XDG_CONFIG_DIRS=/etc/xdg XDG_DATA_HOME=/Users/bkuhlmann/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share
117
- cache.inspect # => "XDG_CACHE_HOME=/Users/bkuhlmann/.cache"
118
- config.inspect # => "XDG_CONFIG_HOME=/Users/bkuhlmann/.config XDG_CONFIG_DIRS=/etc/xdg"
119
- data.inspect # => "XDG_DATA_HOME=/Users/bkuhlmann/.local/share XDG_DATA_DIRS=/usr/local/share:/usr/share"
120
-
121
- # Paths
122
- environment.cache_home # => #<Pathname:/Users/bkuhlmann/.cache>
123
- environment.config_home # => #<Pathname:/Users/bkuhlmann/.config>
124
- environment.config_dirs # => [#<Pathname:/etc/xdg>]
125
- environment.data_home # => #<Pathname:/Users/bkuhlmann/.local/share>
126
- environment.data_dirs # => [#<Pathname:/usr/local/share>, #<Pathname:/usr/share>]
127
-
128
- cache.home # => #<Pathname:/Users/bkuhlmann/.cache>
129
- cache.directories # => []
130
- cache.all # => [#<Pathname:/Users/bkuhlmann/.cache>]
131
-
132
- config.home # => #<Pathname:/Users/bkuhlmann/.config>
133
- config.directories # => [#<Pathname:/etc/xdg>]
134
- config.all # => [#<Pathname:/Users/bkuhlmann/.config>, #<Pathname:/etc/xdg>]
135
-
136
- data.home # => #<Pathname:/Users/bkuhlmann/.local/share>
137
- data.directories # => [#<Pathname:/usr/local/share>, #<Pathname:/usr/share>]
138
- data.all # => [#<Pathname:/Users/bkuhlmann/.local/share>, #<Pathname:/usr/local/share>, #<Pathname:/usr/share>]
139
-
140
- As you can see from above, each XDG object answers back a `Pathname` which means you have the
141
- full `Pathname` API at your fingertips to build upon the output of these objects as needed.
142
-
143
- #### Variable Defaults
144
-
145
- The *XDG Base Directory Specification* defines environment variables and associated default values
146
- when not defined or empty. The following defaults, per specification, are implemented by the
147
- `XDG` objects:
148
-
149
- - `$XDG_CACHE_HOME="$HOME/.cache"`
150
- - `$XDG_CONFIG_HOME="$HOME/.config"`
151
- - `$XDG_CONFIG_DIRS="/etc/xdg"`
152
- - `$XDG_DATA_HOME="$HOME/.local/share"`
153
- - `$XDG_DATA_DIRS="/usr/local/share/:/usr/share/"`
154
- - `$XDG_RUNTIME_DIR`
155
-
156
- The `$XDG_RUNTIME_DIR` deserves special mention as it's not, *currently*, implemented as part of
157
- this gem because it is more user/environment specific. Here is how the `$XDG_RUNTIME_DIR` is meant
158
- to be used should you choose to use it:
159
-
160
- - *Must* reference user-specific non-essential runtime files and other file objects (such as
161
- sockets, named pipes, etc.)
162
- - *Must* be owned by the user with *only* the user having read and write access to it.
163
- - *Must* have a Unix access mode of `0700`.
164
- - *Must* be bound to the user when logging in.
165
- - *Must* be removed when the user logs out.
166
- - *Must* be pointed to the same directory when the user logs in more than once.
167
- - *Must* exist from first login to last logout on the system and not removed in between.
168
- - *Must* not allow files in the directory to survive reboot or a full logout/login cycle.
169
- - *Must* keep the directory on the local file system and not shared with any other file systems.
170
- - *Must* keep the directory fully-featured by the standards of the operating system. Specifically,
171
- on Unix-like operating systems AF_UNIX sockets, symbolic links, hard links, proper permissions,
172
- file locking, sparse files, memory mapping, file change notifications, a reliable hard link count
173
- must be supported, and no restrictions on the file name character set should be imposed. Files in
174
- this directory *may* be subjected to periodic clean-up. To ensure files are not removed,
175
- they should have their access time timestamp modified at least once every 6 hours of monotonic
176
- time or the 'sticky' bit should be set on the file.
177
- - When not set, applications should fall back to a replacement directory with similar capabilities
178
- and print a warning message. Applications should use this directory for communication and
179
- synchronization purposes and should not place larger files in it, since it might reside in runtime
180
- memory and cannot necessarily be swapped out to disk.
181
-
182
- #### Variable Behavior
183
-
184
- The behavior of most XDG environment variables can be lumped into two categories:
185
-
186
- - `$XDG_*_HOME`
187
- - `$XDG_*_DIRS`
188
-
189
- Each is described in detail below.
190
-
191
- ##### `$XDG_*_DIRS`
192
-
193
- These variables are used to define a colon (`:`) delimited list of directories. Order is important
194
- as the first directory defined will take precedent over the following directory and so forth. For
195
- example, here is a situation where the `XDG_CONFIG_DIRS` key has a custom value:
196
-
197
- XDG_CONFIG_DIRS="/example/one/.config:/example/two/.settings:/example/three/.configuration"
198
-
199
- # Yields the following, colon delimited, array:
200
- [
201
- "/example/one/.config",
202
- "/example/two/.settings",
203
- "/example/three/.configuration"
204
- ]
205
-
206
- In the above example, the `"/example/one/.config"` path takes *highest* priority since it was
207
- defined first.
208
-
209
- ##### `$XDG_*_HOME`
210
-
211
- These variables take precidence over the corresponding `$XDG_*_DIRS` environment variables. Using a
212
- modified version of the `$XDG_*_DIRS` example, shown above, we could have the following setup:
213
-
214
- XDG_CONFIG_HOME="/example/priority"
215
- XDG_CONFIG_DIRS="/example/one/.config:/example/two/.settings"
216
-
217
- # Yields the following, colon delimited, array:
218
- [
219
- "/example/priority",
220
- "/example/one/.config",
221
- "/example/two/.settings"
222
- ]
223
-
224
- Due to `XDG_CONFIG_HOME` taking precidence over the `XDG_CONFIG_DIRS`, the path with the *highest*
225
- priority in this example is: `"/example/priority"`.
226
-
227
- #### Variable Priority
228
-
229
- Path precedence is determined in the following order (with the first taking highest priority):
230
-
231
- 1. `$XDG_*_HOME` - Will be used if defined. Otherwise, falls back to specification default.
232
- 1. `$XDG_*_DIRS` - Iterates through directories in order defined (with first taking highest
233
- priority). Otherwise, falls back to specification default.
234
-
235
- ## Tests
236
-
237
- To test, run:
238
-
239
- bundle exec rake
240
-
241
- ## Versioning
242
-
243
- Read [Semantic Versioning](https://semver.org) for details. Briefly, it means:
244
-
245
- - Major (X.y.z) - Incremented for any backwards incompatible public API changes.
246
- - Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
247
- - Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
248
-
249
- ## Code of Conduct
250
-
251
- Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
252
- participating in this project you agree to abide by its terms.
253
-
254
- ## Contributions
255
-
256
- Read [CONTRIBUTING](CONTRIBUTING.md) for details.
257
-
258
- ## License
259
-
260
- Copyright 2019 [Alchemists](https://www.alchemists.io).
261
- Read [LICENSE](LICENSE.md) for details.
262
-
263
- ## History
264
-
265
- Read [CHANGES](CHANGES.md) for details.
266
- Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
267
-
268
- ## Credits
269
-
270
- Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
271
- [Alchemists](https://www.alchemists.io).