runcom 10.0.1 → 10.2.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/lib/runcom.rb +6 -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: 56dc272c5a13fac98f92a5c10f7c4505158d3e4643da21739c0d1cad255a28e3
|
4
|
+
data.tar.gz: 56734224c2bd17cabd662ca0a2665573a2f35723b6d89c29c2efb7b8282bee48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a391ae1c97492e87329ca7ed24d2e5d8944edf26eb5bd8dfff69ce112385d1591d9b499188f0f6ee1dd086da272117bf1785fc8955210df85b7f3ba7ac24e5a7
|
7
|
+
data.tar.gz: 1790a3b216c0db91d3c2cd2ebd25675ffb45b01b639c10df38493c7c44c68964f2c079824c96b9084108a5ccb0e5d64e42a718f7481b5af22a1ec35b74657697
|
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/lib/runcom.rb
CHANGED
@@ -3,8 +3,13 @@
|
|
3
3
|
require "xdg"
|
4
4
|
require "zeitwerk"
|
5
5
|
|
6
|
-
Zeitwerk::Loader.
|
6
|
+
Zeitwerk::Loader.new.then do |loader|
|
7
|
+
loader.tag = File.basename __FILE__, ".rb"
|
8
|
+
loader.push_dir __dir__
|
9
|
+
loader.setup
|
10
|
+
end
|
7
11
|
|
8
12
|
# Main namespace.
|
9
13
|
module Runcom
|
14
|
+
def self.loader(registry = Zeitwerk::Registry) = registry.loader_for __FILE__
|
10
15
|
end
|
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.2.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-10-01 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.20
|
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
|