runcom 10.0.1 → 10.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/README.adoc +16 -19
- data/lib/runcom/cache.rb +1 -1
- data/lib/runcom/config.rb +1 -1
- data/lib/runcom/data.rb +1 -1
- data/lib/runcom/paths/common.rb +2 -0
- data/lib/runcom/state.rb +1 -1
- data/runcom.gemspec +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- 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: 63df1b5963a9b53c660b18679037d055384c3d484093725d46a671b52ea16f9b
|
4
|
+
data.tar.gz: e3d84a1e66bb4fb4277651ee0e42a17845b8c1ea632f293c09e5bee490d5c81b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d6eec9d50e87743748e62dbc3165b38b6b766e149ecd36b7e1619b401b82820688c7a4d5d81d48c004470f1e268e008b877675ead850286596f66b9334ebdf0
|
7
|
+
data.tar.gz: 7fdd92df8806c6bdfa6a91a553e8b85153ae9eb0d0108266856e755adc59522569a7f8e2b4b7d5a23cb44fa99934c21f946fdea44e93bfe41b6d9a7a66af5145
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -15,12 +15,12 @@ toc::[]
|
|
15
15
|
|
16
16
|
* Wraps the {xdg_link} implementation which provides access to
|
17
17
|
the following environment variables:
|
18
|
-
**
|
19
|
-
**
|
20
|
-
**
|
21
|
-
**
|
22
|
-
**
|
23
|
-
**
|
18
|
+
** `+$XDG_CACHE_HOME+`
|
19
|
+
** `+$XDG_CONFIG_HOME+`
|
20
|
+
** `+$XDG_CONFIG_DIRS+`
|
21
|
+
** `+$XDG_DATA_HOME+`
|
22
|
+
** `+$XDG_DATA_DIRS+`
|
23
|
+
** `+$XDG_STATE_HOME+`
|
24
24
|
* Enhances the {xdg_link} cache, config, data, and state implementations.
|
25
25
|
|
26
26
|
== Requirements
|
@@ -80,18 +80,14 @@ state = Runcom::State.new "demo/history.log"
|
|
80
80
|
Each of the above objects share the same Object API:
|
81
81
|
|
82
82
|
* `#relative`: Answers the relative path from which the object was constructed.
|
83
|
-
* `#namespace`: Answers the
|
84
|
-
constructed. The namespace must be identical across the cache, config, and data objects as this is
|
85
|
-
what uniquely identifies and organizes all files associated with your program.
|
83
|
+
* `#namespace`: Answers the namespace as a pathname object from which the instance was constructed. The namespace must be unique and identical across the cache, config, data, and state objects since this is what identifies and organizes all files associated with your program.
|
86
84
|
* `#file_name`: Answers the file name from which the object was constructed.
|
87
|
-
* `#active`: Answers first
|
88
|
-
|
89
|
-
* `#global`: Answers the first _existing_ or _non-existing_ global
|
90
|
-
* `#local`: Answers the first _existing_ or _non-existing_ local
|
91
|
-
* `#all`: Answers all
|
92
|
-
|
93
|
-
* `#inspect`: Answers a string representation of default XDG home and directory paths for debugging
|
94
|
-
purposes.
|
85
|
+
* `#active`: Answers first _existing file path_ as computed by `+$XDG_*_HOME+` followed by each computed `+$XDG_*_DIRS+` path in order defined. Otherwise, `nil` is answered back when no path exists.
|
86
|
+
* `#passive`: Answers first path as computed by `+$XDG_*_HOME+` followed by each computed `+$XDG_*_DIRS+` path in order defined which _may_ or _may not_ exist. This behaves like `#active` but doesn't care if the path exists. Handy for situations where you'd like the active path but can fallback to creating the global path if otherwise.
|
87
|
+
* `#global`: Answers the first _existing_ or _non-existing_ global path only.
|
88
|
+
* `#local`: Answers the first _existing_ or _non-existing_ local path only.
|
89
|
+
* `#all`: Answers all paths which is the combined `+$XDG_*_HOME+` and `+$XDG_*_DIRS+` values in order defined. These paths _may_ or _may not_ exist.
|
90
|
+
* `#inspect`: Answers a string representation of default XDG home and directory paths for debugging purposes.
|
95
91
|
|
96
92
|
Using a `cache` object, for example, here is what each method answers back:
|
97
93
|
|
@@ -103,6 +99,7 @@ cache.relative # => #<Pathname:demo/content.json>
|
|
103
99
|
cache.namespace # #<Pathname:demo>
|
104
100
|
cache.file_name # #<Pathname:content.json>
|
105
101
|
cache.active # nil
|
102
|
+
cache.passive # #<Pathname:/Users/demo/.cache/demo/content.json>
|
106
103
|
cache.global # #<Pathname:/Users/demo/.cache/demo/content.json>
|
107
104
|
cache.local # #<Pathname:/Users/demo/Engineering/OSS/runcom/.cache/demo/content.json>
|
108
105
|
cache.all # [#<Pathname:/Users/demo/Engineering/OSS/runcom/.cache/demo/content.json>, #<Pathname:/Users/demo/.cache/demo/content.json>]
|
@@ -113,7 +110,7 @@ cache.inspect # "XDG_CACHE_HOME=/Users/demo/Engineering/OSS/runcom/.cache:/Us
|
|
113
110
|
|
114
111
|
Path precedence is determined in the following order (with the first taking highest priority):
|
115
112
|
|
116
|
-
. *Local Configuration* - If a
|
113
|
+
. *Local Configuration* - If a `+$XDG_*_HOME+` or `+$XDG_*_DIRS+` path relative to the
|
117
114
|
current working directory is detected, it will take precedence over the global configuration.
|
118
115
|
This is the same behavior as found in Git where the local `.git/config` takes precedence over the
|
119
116
|
global `$HOME/.gitconfig`.
|
@@ -122,7 +119,7 @@ Path precedence is determined in the following order (with the first taking high
|
|
122
119
|
|
123
120
|
=== Building Blocks
|
124
121
|
|
125
|
-
While {xdg_link} and Runcom are powerful in their own right, a great building block you can add on top of this gem is the {etcher_link} gem which loads, transforms, validates, and produces structured data from raw Runcom information. For more sophisticated applications, this synergetic coupling of `XDG
|
122
|
+
While {xdg_link} and Runcom are powerful in their own right, a great building block you can add on top of this gem is the {etcher_link} gem which loads, transforms, validates, and produces structured data from raw Runcom information. For more sophisticated applications, this synergetic coupling of `XDG + Runcom + Etcher` makes for nicely designed architectures.
|
126
123
|
|
127
124
|
=== Examples
|
128
125
|
|
data/lib/runcom/cache.rb
CHANGED
@@ -9,7 +9,7 @@ module Runcom
|
|
9
9
|
|
10
10
|
CONTEXT = Context.new xdg: XDG::Cache
|
11
11
|
|
12
|
-
delegate %i[relative namespace file_name active global local all inspect] => :common
|
12
|
+
delegate %i[relative namespace file_name active passive global local all inspect] => :common
|
13
13
|
|
14
14
|
def initialize path, context: CONTEXT
|
15
15
|
@common = Paths::Common.new path, context:
|
data/lib/runcom/config.rb
CHANGED
@@ -9,7 +9,7 @@ module Runcom
|
|
9
9
|
|
10
10
|
CONTEXT = Context.new xdg: XDG::Config
|
11
11
|
|
12
|
-
delegate %i[relative namespace file_name active global local all inspect] => :common
|
12
|
+
delegate %i[relative namespace file_name active passive global local all inspect] => :common
|
13
13
|
|
14
14
|
def initialize path, context: CONTEXT
|
15
15
|
@common = Paths::Common.new path, context:
|
data/lib/runcom/data.rb
CHANGED
@@ -9,7 +9,7 @@ module Runcom
|
|
9
9
|
|
10
10
|
CONTEXT = Context.new xdg: XDG::Data
|
11
11
|
|
12
|
-
delegate %i[relative namespace file_name active global local all inspect] => :common
|
12
|
+
delegate %i[relative namespace file_name active passive global local all inspect] => :common
|
13
13
|
|
14
14
|
def initialize path, context: CONTEXT
|
15
15
|
@common = Paths::Common.new path, context:
|
data/lib/runcom/paths/common.rb
CHANGED
data/lib/runcom/state.rb
CHANGED
@@ -9,7 +9,7 @@ module Runcom
|
|
9
9
|
|
10
10
|
CONTEXT = Context.new xdg: XDG::State
|
11
11
|
|
12
|
-
delegate %i[relative namespace file_name active global local all inspect] => :common
|
12
|
+
delegate %i[relative namespace file_name active passive global local all inspect] => :common
|
13
13
|
|
14
14
|
def initialize path, context: CONTEXT
|
15
15
|
@common = Paths::Common.new path, context:
|
data/runcom.gemspec
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
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: 10.0
|
4
|
+
version: 10.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2023-
|
38
|
+
date: 2023-07-13 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: refinements
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
|
-
rubygems_version: 3.4.
|
129
|
+
rubygems_version: 3.4.16
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: A XDG enhanced run command manager for command line interfaces.
|
metadata.gz.sig
CHANGED
Binary file
|