runcom 4.0.0 → 4.1.0
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.md +81 -26
- data/lib/runcom/identity.rb +1 -1
- metadata +32 -4
- 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: a023f821e7b98b398dc4e1f1ad8c088c3c8501fd1920393c0072d129e8c74ead
|
4
|
+
data.tar.gz: 83b8929393feb7145a076c423bd04e5174ab2eea9d71153a4dfc7fa9b7a83435
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d45dde853a5425a15d6009e629bb66c1f94a58b93287a67c92cc40dd2e9f80cc82db0a4d68d5b7945d11dbfa661e166880ff16c1f8a89918cc6e63ef41a72b5e
|
7
|
+
data.tar.gz: 9dd7335294717fba31dc75f86f1566b383877385fd4613bea0196b1c9033758b42ad3d7d3fe8c7b657cd1396328d5b8f2660128aea62af35cfbeeb2e45149899
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -21,6 +21,7 @@ further details.
|
|
21
21
|
- [Usage](#usage)
|
22
22
|
- [XDG](#xdg)
|
23
23
|
- [Overview](#overview)
|
24
|
+
- [Variable Defaults](#variable-defaults)
|
24
25
|
- [Variable Behavior](#variable-behavior)
|
25
26
|
- [`$XDG_*_DIRS`](#xdg__dirs)
|
26
27
|
- [`$XDG_*_HOME`](#xdg__home)
|
@@ -91,8 +92,12 @@ Provides an API that strictly adheres to the *XDG Base Directory Specification*.
|
|
91
92
|
xdg.data_home # <= Answers computed `$XDG_DATA_HOME` value.
|
92
93
|
xdg.data_dirs # <= Answers computed `$XDG_DATA_DIRS` value.
|
93
94
|
|
94
|
-
|
95
|
-
|
95
|
+
The *computed* value, in this case, is either the user-defined value of the key or the default
|
96
|
+
value, per specification, when the key is not defined or empty. For more on this, scroll down to the
|
97
|
+
*Variable Defaults* section to learn more.
|
98
|
+
|
99
|
+
The `Runcom::XDG::Environment` wraps the following objects which can be used individually if you
|
100
|
+
don't want to load the entire environment:
|
96
101
|
|
97
102
|
cache = Runcom::XDG::Cache.new
|
98
103
|
config = Runcom::XDG::Config.new
|
@@ -106,42 +111,93 @@ following messages:
|
|
106
111
|
- `#all` - Answers an array of *all* directories as computed from the combined `$XDG_*_HOME` and
|
107
112
|
`$XDG_*_DIRS` values (with `$XDG_*_HOME` prefixed at the start of the array).
|
108
113
|
|
114
|
+
#### Variable Defaults
|
115
|
+
|
116
|
+
The *XDG Base Directory Specification* defines environment variables and associated default values
|
117
|
+
when not defined or empty. The following defaults, per specification, are implemented by the
|
118
|
+
`Runcom::XDG` objects:
|
119
|
+
|
120
|
+
- `$XDG_CACHE_HOME="$HOME/.cache"`
|
121
|
+
- `$XDG_CONFIG_HOME="$HOME/.config"`
|
122
|
+
- `$XDG_CONFIG_DIRS="/etc/xdg"`
|
123
|
+
- `$XDG_DATA_HOME="$HOME/.local/share"`
|
124
|
+
- `$XDG_DATA_DIRS="/usr/local/share/:/usr/share/"`
|
125
|
+
- `$XDG_RUNTIME_DIR`
|
126
|
+
|
127
|
+
The `$XDG_RUNTIME_DIR` deserves special mention as it's not, *currently*, implemented as part of
|
128
|
+
this gem because it is more user/environment specific. Here is how the `$XDG_RUNTIME_DIR` is meant
|
129
|
+
to be used should you choose to use it:
|
130
|
+
|
131
|
+
- *Must* reference user-specific non-essential runtime files and other file objects (such as
|
132
|
+
sockets, named pipes, etc.)
|
133
|
+
- *Must* be owned by the user with *only* the user having read and write access to it.
|
134
|
+
- *Must* have a Unix access mode of `0700`.
|
135
|
+
- *Must* be bound to the user when logging in.
|
136
|
+
- *Must* be removed when the user logs out.
|
137
|
+
- *Must* be pointed to the same directory when the user logs in more than once.
|
138
|
+
- *Must* exist from first login to last logout on the system and not removed in between.
|
139
|
+
- *Must* not allow files in the directory to survive reboot or a full logout/login cycle.
|
140
|
+
- *Must* keep the directory on the local file system and not shared with any other file systems.
|
141
|
+
- *Must* keep the directory fully-featured by the standards of the operating system. Specifically,
|
142
|
+
on Unix-like operating systems AF_UNIX sockets, symbolic links, hard links, proper permissions,
|
143
|
+
file locking, sparse files, memory mapping, file change notifications, a reliable hard link count
|
144
|
+
must be supported, and no restrictions on the file name character set should be imposed. Files in
|
145
|
+
this directory *may* be subjected to periodic clean-up. To ensure files are not removed,
|
146
|
+
they should have their access time timestamp modified at least once every 6 hours of monotonic
|
147
|
+
time or the 'sticky' bit should be set on the file.
|
148
|
+
- When not set, applications should fall back to a replacement directory with similar capabilities
|
149
|
+
and print a warning message. Applications should use this directory for communication and
|
150
|
+
synchronization purposes and should not place larger files in it, since it might reside in runtime
|
151
|
+
memory and cannot necessarily be swapped out to disk.
|
152
|
+
|
109
153
|
#### Variable Behavior
|
110
154
|
|
111
|
-
The behavior of
|
112
|
-
|
155
|
+
The behavior of most XDG environment variables can be lumped into two categories:
|
156
|
+
|
157
|
+
- `$XDG_*_HOME`
|
158
|
+
- `$XDG_*_DIRS`
|
159
|
+
|
160
|
+
Each is described in detail below.
|
113
161
|
|
114
162
|
##### `$XDG_*_DIRS`
|
115
163
|
|
116
|
-
|
117
|
-
|
118
|
-
|
164
|
+
These variables are used to define a colon (`:`) delimited list of directories. Order is important
|
165
|
+
as the first directory defined will take precedent over the following directory and so forth. For
|
166
|
+
example, here is a situation where the `XDG_CONFIG_DIRS` key has a custom value:
|
119
167
|
|
120
168
|
XDG_CONFIG_DIRS="/example/one/.config:/example/two/.settings:/example/three/.configuration"
|
121
169
|
|
122
|
-
# Yields the following array:
|
170
|
+
# Yields the following, colon delimited, array:
|
123
171
|
[
|
124
172
|
"/example/one/.config",
|
125
173
|
"/example/two/.settings",
|
126
174
|
"/example/three/.configuration"
|
127
175
|
]
|
128
176
|
|
129
|
-
In the above example, the `"/example/one/.config"` path
|
177
|
+
In the above example, the `"/example/one/.config"` path takes *highest* priority since it was
|
130
178
|
defined first.
|
131
179
|
|
132
|
-
When the `$XDG_CONFIG_DIRS` is not defined, it will default to the following array: `["/etc/xdg"]`.
|
133
|
-
Other `$XDG_*_DIRS` variables share similar behavior.
|
134
|
-
|
135
180
|
##### `$XDG_*_HOME`
|
136
181
|
|
137
|
-
|
138
|
-
`$XDG_*_DIRS`
|
139
|
-
|
182
|
+
These variables take precidence over the corresponding `$XDG_*_DIRS` environment variables. Using a
|
183
|
+
modified version of the `$XDG_*_DIRS` example, shown above, we could have the following setup:
|
184
|
+
|
185
|
+
XDG_CONFIG_HOME="/example/priority"
|
186
|
+
XDG_CONFIG_DIRS="/example/one/.config:/example/two/.settings"
|
187
|
+
|
188
|
+
# Yields the following, colon delimited, array:
|
189
|
+
[
|
190
|
+
"/example/priority",
|
191
|
+
"/example/one/.config",
|
192
|
+
"/example/two/.settings"
|
193
|
+
]
|
194
|
+
|
195
|
+
Due to `XDG_CONFIG_HOME` taking precidence over the `XDG_CONFIG_DIRS`, the path with the *highest*
|
196
|
+
priority in this example is: `"/example/priority"`.
|
140
197
|
|
141
198
|
#### Variable Priority
|
142
199
|
|
143
|
-
|
144
|
-
priority):
|
200
|
+
Path precedence is determined in the following order (with the first taking highest priority):
|
145
201
|
|
146
202
|
1. `$XDG_*_HOME` - Will be used if defined. Otherwise, falls back to specification default.
|
147
203
|
1. `$XDG_*_DIRS` - Iterates through directories in order defined (with first taking highest
|
@@ -150,8 +206,8 @@ priority):
|
|
150
206
|
### Runcom
|
151
207
|
|
152
208
|
Provides wrapper objects around the `XDG` objects which extends and enhances beyond what is found in
|
153
|
-
the *XDG Base Directory Specification*. This includes preference of local over global
|
154
|
-
|
209
|
+
the *XDG Base Directory Specification*. This includes preference of local over global configurations
|
210
|
+
by default as well as other conveniences.
|
155
211
|
|
156
212
|
#### Overview
|
157
213
|
|
@@ -164,18 +220,17 @@ instantiate each object individually:
|
|
164
220
|
|
165
221
|
Each of the above objects share the same basic API:
|
166
222
|
|
167
|
-
- `#path` - Answers first existing file system path
|
168
|
-
|
223
|
+
- `#path` - Answers first *existing* file system path computed by `$XDG_*_HOME` followed
|
224
|
+
by each computed `$XDG_*_DIRS` path in order defined.
|
169
225
|
- `#paths` - Answers all file system paths which is the combined `$XDG_*_HOME` and `$XDG_*_DIRS`
|
170
|
-
values in
|
226
|
+
values in order defined. These paths *may* or *may not* exist on the file system.
|
171
227
|
|
172
228
|
#### Variable Priority
|
173
229
|
|
174
|
-
|
175
|
-
priority):
|
230
|
+
Path precedence is determined in the following order (with the first taking highest priority):
|
176
231
|
|
177
232
|
1. **Local Configuration** - If a `$XDG_*_HOME` or `$XDG_*_DIRS` path relative to the current
|
178
|
-
working directory is detected, it will take
|
233
|
+
working directory is detected, it will take precedence over the global configuration. This is the
|
179
234
|
same behavior as found in Git where the local `.git/config` takes precedence over the global
|
180
235
|
`~/.gitconfig`.
|
181
236
|
1. **Global Configuration** - When a local configuration isn't found, the global configuration is
|
@@ -221,7 +276,7 @@ For further details, study the public interface as provided by the
|
|
221
276
|
|
222
277
|
### Examples
|
223
278
|
|
224
|
-
If you need
|
279
|
+
If you need examples of gems that leverage this gem, see the following:
|
225
280
|
|
226
281
|
- [Gemsmith](https://github.com/bkuhlmann/gemsmith) - A command line interface for smithing new Ruby
|
227
282
|
gems.
|
data/lib/runcom/identity.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runcom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
4Zrsxi713z6sndd9JBAm4G7mJiV93MsuCM5N4ZDY7XaxIhvctNSNhX/Yn8LLdtGI
|
30
30
|
b4jw5t40FKyNUvLPPXYAvQALBtk=
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2019-
|
32
|
+
date: 2019-02-02 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: refinements
|
@@ -73,6 +73,34 @@ dependencies:
|
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.1'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: gemsmith
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '13.0'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '13.0'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: git-cop
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '3.0'
|
76
104
|
- !ruby/object:Gem::Dependency
|
77
105
|
name: guard-rspec
|
78
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -163,14 +191,14 @@ dependencies:
|
|
163
191
|
requirements:
|
164
192
|
- - "~>"
|
165
193
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0.
|
194
|
+
version: '0.63'
|
167
195
|
type: :development
|
168
196
|
prerelease: false
|
169
197
|
version_requirements: !ruby/object:Gem::Requirement
|
170
198
|
requirements:
|
171
199
|
- - "~>"
|
172
200
|
- !ruby/object:Gem::Version
|
173
|
-
version: '0.
|
201
|
+
version: '0.63'
|
174
202
|
- !ruby/object:Gem::Dependency
|
175
203
|
name: rubocop-rspec
|
176
204
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|