runcom 6.0.1 → 6.1.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: 51f9eacd1ade03026ed02aeab5d127350283311280cba07cc985a26ae107b6f2
4
- data.tar.gz: 580f96f8545ff05151a903d0abf5c36892ac08112017389f283fd0b356063445
3
+ metadata.gz: 2744bb4a297fabb6617fdfc71e1e14e8ef62b0cffb76eecbd09290122424ce45
4
+ data.tar.gz: 6f6f0164ce8921ae35fd1cd3a9090e62cdb16d10e09ec9337d92f815b51f9595
5
5
  SHA512:
6
- metadata.gz: 56b7a3708f994b9734d961aeaa27062cb03657ecc42f63a2372429db1bbf9ed5f3cc1e2b3c67ab79dd8527bb79bcdc0e4797e00b4724a88678c2f67d8d831296
7
- data.tar.gz: a369b0ca63f6e994ef44e377ee8cf0cec4bd7d79d6b1e5dc62002e1196ee44dedd2515d0944c89d1664f4f08f1154406912fa6f984efa30881d468343dd22abf
6
+ metadata.gz: 624831faadf016b4115cb1a61b8fd6b504fa44044661f219b36fdf6a3fd4504b8532ff15b3d5892adfd84a4dcb66d55ea3b3a097bd37e977bae75d9a8ebe0e49
7
+ data.tar.gz: b7b7a8421f3e8d0e32beb79922afebc32f6d9b32e4b11db4f0c5c211838981602941afa916835ce7aa5fa31b8f91c702fd2586d5de4940d5a9ad7867a110ea06
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 2016 [Alchemists](https://www.alchemists.io).
153
+ Copyright link:https://www.alchemists.io[Alchemists].
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,234 @@
1
+ :toc: macro
2
+ :toclevels: 5
3
+ :figure-caption!:
4
+
5
+ = Runcom
6
+
7
+ [link=http://badge.fury.io/rb/runcom]
8
+ image::https://badge.fury.io/rb/runcom.svg[Gem Version]
9
+ [link=https://circleci.com/gh/bkuhlmann/runcom]
10
+ image::https://circleci.com/gh/bkuhlmann/runcom.svg?style=svg[Circle CI Status]
11
+
12
+ Runcom (short for link:https://en.wikipedia.org/wiki/Run_commands[Run Command]) provides common
13
+ functionality for Command Line Interfaces (CLIs) in which to manage global, local, or multiple
14
+ caches, configurations, or data in general. It does this by leveraging the
15
+ https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html[XDG Base Directory
16
+ Specification] built atop the link:https://www.alchemists.io/projects/xdg[XDG] implementation.
17
+
18
+ toc::[]
19
+
20
+ == Features
21
+
22
+ * Wraps the link:https://www.alchemists.io/projects/xdg[XDG] implementation which provides access to
23
+ the following environment variables:
24
+ ** `+$XDG_CACHE_HOME+`
25
+ ** `+$XDG_CONFIG_HOME+`
26
+ ** `+$XDG_CONFIG_DIRS+`
27
+ ** `+$XDG_DATA_HOME+`
28
+ ** `+$XDG_DATA_DIRS+`
29
+ * Enhances the XDG cache, config, and data implementation. For the config, the following is
30
+ supported:
31
+ ** Supports loading of CLI-specific http://yaml.org[YAML] configuration file.
32
+ ** Supports loading and merging of nested/complex configurations.
33
+ ** Supports hash representation of configuration.
34
+
35
+ == Requirements
36
+
37
+ . https://www.ruby-lang.org[Ruby 2.7.x].
38
+
39
+ == Setup
40
+
41
+ === Production
42
+
43
+ To install, run:
44
+
45
+ [source,bash]
46
+ ----
47
+ gem install runcom
48
+ ----
49
+
50
+ Add the following to your Gemfile:
51
+
52
+ [source,ruby]
53
+ ----
54
+ gem "runcom"
55
+ ----
56
+
57
+ === Development
58
+
59
+ To contribute, run:
60
+
61
+ [source,bash]
62
+ ----
63
+ git clone https://github.com/bkuhlmann/runcom.git
64
+ cd runcom
65
+ bin/setup
66
+ ----
67
+
68
+ You can also use the IRB console for direct access to all objects:
69
+
70
+ [source,bash]
71
+ ----
72
+ bin/console
73
+ ----
74
+
75
+ == Usage
76
+
77
+ The following describes the enhancements built atop the
78
+ link:https://www.alchemists.io/projects/xdg[XDG] implementation.
79
+
80
+ === Overview
81
+
82
+ While there isn’t an environment convenience object as found in the `+XDG+` namespace, you can
83
+ instantiate each object individually:
84
+
85
+ [source,ruby]
86
+ ----
87
+ cache = Runcom::Cache.new "example/data.json"
88
+ config = Runcom::Config.new "example/configuration.yml"
89
+ data = Runcom::Data.new "example/store.dat"
90
+ ----
91
+
92
+ Each of the above objects share the same API:
93
+
94
+ * `#relative` - Answers the relative path from which the object was constructed.
95
+ * `#namespace` - Answers the relative namespace as a pathname object from which the object was
96
+ constructed. The namespace must be identical across the cache, config, and data objects as this is
97
+ what uniquely identifies and organizes all files associated with your program.
98
+ * `#file_name` - Answers the file name from which the object was constructed.
99
+ * `#current` - Answers first _existing_ file system path computed by `$XDG_*_HOME` followed by each
100
+ computed `$XDG_*_DIRS` path in order defined. Otherwise, `nil` is answered back.
101
+ * `#all` - Answers all file system paths which is the combined `$XDG_*_HOME` and
102
+ `$XDG_*_DIRS` values in order defined. These paths _may_ or _may not_ exist on the file system.
103
+ * `#inspect` - Answers a string representation of default XDG home and directory paths for debugging
104
+ purposes.
105
+
106
+ Using the `cache` object (created above) as an example, here is what each method answers back:
107
+
108
+ [source,ruby]
109
+ ----
110
+ cache.relative # => #<Pathname:example/data.json>
111
+ cache.namespace # #<Pathname:example>
112
+ cache.file_name # #<Pathname:data.json>
113
+ cache.current # #<Pathname:/Users/bkuhlmann/.cache/example/data.json>
114
+ cache.all # [#<Pathname:/Users/bkuhlmann/.cache/example/data.json>]
115
+ cache.inspect # "XDG_CACHE_HOME=/Users/bkuhlmann/.cache"
116
+ ----
117
+
118
+ === Variable Priority
119
+
120
+ Path precedence is determined in the following order (with the first taking highest priority):
121
+
122
+ . *Local Configuration* - If a `$XDG_*_HOME` or `$XDG_*_DIRS` path relative to the
123
+ current working directory is detected, it will take precedence over the global configuration.
124
+ This is the same behavior as found in Git where the local `.git/config` takes precedence over the
125
+ global `$HOME/.gitconfig`.
126
+ . *Global Configuration* - When a local configuration isn’t found, the global configuration is used
127
+ as defined by the _XDG Base Directory Specification_.
128
+
129
+ === Configuration Specialization
130
+
131
+ The `Runcom::Config` deserves additional highlighting as it provides support for loading custom
132
+ CLI configurations directly from the command line or from custom locations. It is meant to be used
133
+ within your program(s).
134
+
135
+ An object is initialized as follows:
136
+
137
+ [source,ruby]
138
+ ----
139
+ configuration = Runcom::Config.new "example/configuration.yml"
140
+ ----
141
+
142
+ Default settings can be initialized as well:
143
+
144
+ [source,ruby]
145
+ ----
146
+ configuration = Runcom::Config.new "example/configuration.yml", defaults: {name: "Example"}
147
+ ----
148
+
149
+ Once a configuration has been initialized, a hash representation can be obtained:
150
+
151
+ [source,ruby]
152
+ ----
153
+ configuration.to_h
154
+ ----
155
+
156
+ A configuration can be merged with another hash (handy for runtime overrides):
157
+
158
+ [source,ruby]
159
+ ----
160
+ updated_configuration = configuration.merge {name: "Updated Name"}
161
+ ----
162
+
163
+ A configuration can also be merged with another configuration:
164
+
165
+ [source,ruby]
166
+ ----
167
+ updated_configuration = configuration.merge Runcom::Config.new("other", defaults: {a: 1})
168
+ ----
169
+
170
+ The current path of the configuration can be asked for as well:
171
+
172
+ [source,ruby]
173
+ ----
174
+ configuration.current # "~/.config/example/configuration.yml"
175
+ ----
176
+
177
+ For further details, study the public interface as provided by the
178
+ link:lib/runcom/config.rb[`Runcom::Config`] object.
179
+
180
+ === Examples
181
+
182
+ Examples of gems built atop this gem are:
183
+
184
+ * link:https://www.alchemists.io/projects/gemsmith[Gemsmith] - A command line interface for smithing
185
+ new Ruby gems.
186
+ * link:https://www.alchemists.io/projects/git-cop[Git Cop] - Enforces consistent Git commits.
187
+ * link:https://www.alchemists.io/projects/milestoner[Milestoner] - A command line interface for
188
+ releasing Git repository milestones.
189
+ * link:https://www.alchemists.io/projects/pennyworth[Pennyworth] - A command line interface that
190
+ enhances and extends link:https://www.alfredapp.com[Alfred] with Ruby support.
191
+ * link:https://www.alchemists.io/projects/pragmater[Pragmater] - A command line interface for
192
+ managing/formatting source file pragma comments.
193
+ * link:https://www.alchemists.io/projects/sublime_text_kit[Sublime Text Kit] - A command line
194
+ interface for managing Sublime Text metadata.
195
+ * link:https://www.alchemists.io/projects/tocer[Tocer] - A command line interface for generating
196
+ table of contents for Markdown files.
197
+
198
+ == Tests
199
+
200
+ To test, run:
201
+
202
+ [source,bash]
203
+ ----
204
+ bundle exec rake
205
+ ----
206
+
207
+ == Versioning
208
+
209
+ Read link:https://semver.org[Semantic Versioning] for details. Briefly, it means:
210
+
211
+ * Major (X.y.z) - Incremented for any backwards incompatible public API changes.
212
+ * Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
213
+ * Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
214
+
215
+ == Code of Conduct
216
+
217
+ Please note that this project is released with a link:CODE_OF_CONDUCT.adoc[CODE OF CONDUCT]. By
218
+ participating in this project you agree to abide by its terms.
219
+
220
+ == Contributions
221
+
222
+ Read link:CONTRIBUTING.adoc[CONTRIBUTING] for details.
223
+
224
+ == License
225
+
226
+ Read link:LICENSE.adoc[LICENSE] for details.
227
+
228
+ == History
229
+
230
+ Read link:CHANGES.adoc[CHANGES] for details.
231
+
232
+ == Credits
233
+
234
+ Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann.html[Brooke Kuhlmann].
@@ -3,20 +3,9 @@
3
3
  module Runcom
4
4
  # Gem identity information.
5
5
  module Identity
6
- def self.name
7
- "runcom"
8
- end
9
-
10
- def self.label
11
- "Runcom"
12
- end
13
-
14
- def self.version
15
- "6.0.1"
16
- end
17
-
18
- def self.version_label
19
- "#{label} #{version}"
20
- end
6
+ NAME = "runcom"
7
+ LABEL = "Runcom"
8
+ VERSION = "6.1.0"
9
+ VERSION_LABEL = "#{LABEL} #{VERSION}"
21
10
  end
22
11
  end
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: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -10,9 +10,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-02-01 00:00:00.000000000 Z
31
+ date: 2020-04-01 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -162,14 +162,14 @@ dependencies:
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '5.6'
165
+ version: '6.0'
166
166
  type: :development
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '5.6'
172
+ version: '6.0'
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: rspec
175
175
  requirement: !ruby/object:Gem::Requirement
@@ -260,11 +260,11 @@ email:
260
260
  executables: []
261
261
  extensions: []
262
262
  extra_rdoc_files:
263
- - README.md
264
- - LICENSE.md
263
+ - README.adoc
264
+ - LICENSE.adoc
265
265
  files:
266
- - LICENSE.md
267
- - README.md
266
+ - LICENSE.adoc
267
+ - README.adoc
268
268
  - lib/runcom.rb
269
269
  - lib/runcom/cache.rb
270
270
  - lib/runcom/config.rb
@@ -275,13 +275,14 @@ files:
275
275
  - lib/runcom/identity.rb
276
276
  - lib/runcom/paths/common.rb
277
277
  - lib/runcom/paths/home.rb
278
- homepage: https://github.com/bkuhlmann/runcom
278
+ homepage: https://www.alchemists.io/projects/runcom
279
279
  licenses:
280
280
  - Apache-2.0
281
281
  metadata:
282
- source_code_uri: https://github.com/bkuhlmann/runcom
283
- changelog_uri: https://github.com/bkuhlmann/runcom/blob/master/CHANGES.md
284
282
  bug_tracker_uri: https://github.com/bkuhlmann/runcom/issues
283
+ changelog_uri: https://www.alchemists.io/projects/runcom/changes.html
284
+ documentation_uri: https://www.alchemists.io/projects/runcom
285
+ source_code_uri: https://github.com/bkuhlmann/runcom
285
286
  post_install_message:
286
287
  rdoc_options: []
287
288
  require_paths:
metadata.gz.sig CHANGED
Binary file
data/README.md DELETED
@@ -1,204 +0,0 @@
1
- <p align="center">
2
- <img src="runcom.png" alt="Runcom Icon"/>
3
- </p>
4
-
5
- # Runcom
6
-
7
- [![Gem Version](https://badge.fury.io/rb/runcom.svg)](http://badge.fury.io/rb/runcom)
8
- [![Code Climate Maintainability](https://api.codeclimate.com/v1/badges/129b7ea524a0f5a6a805/maintainability)](https://codeclimate.com/github/bkuhlmann/runcom/maintainability)
9
- [![Code Climate Test Coverage](https://api.codeclimate.com/v1/badges/129b7ea524a0f5a6a805/test_coverage)](https://codeclimate.com/github/bkuhlmann/runcom/test_coverage)
10
- [![Circle CI Status](https://circleci.com/gh/bkuhlmann/runcom.svg?style=svg)](https://circleci.com/gh/bkuhlmann/runcom)
11
-
12
- Runcom (short for [Run Command](https://en.wikipedia.org/wiki/Run_commands)) provides common
13
- functionality for Command Line Interfaces (CLIs) in which to manage global, local, or multiple
14
- caches, configurations, or data in general. It does this by leveraging the [XDG Base Directory
15
- Specification](https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html) built atop
16
- the [XDG](https://github.com/bkuhlmann/xdg) implementation.
17
-
18
- <!-- Tocer[start]: Auto-generated, don't remove. -->
19
-
20
- ## Table of Contents
21
-
22
- - [Features](#features)
23
- - [Requirements](#requirements)
24
- - [Setup](#setup)
25
- - [Usage](#usage)
26
- - [Overview](#overview)
27
- - [Variable Priority](#variable-priority)
28
- - [Configuration Specialization](#configuration-specialization)
29
- - [Examples](#examples)
30
- - [Tests](#tests)
31
- - [Versioning](#versioning)
32
- - [Code of Conduct](#code-of-conduct)
33
- - [Contributions](#contributions)
34
- - [License](#license)
35
- - [History](#history)
36
- - [Credits](#credits)
37
-
38
- <!-- Tocer[finish]: Auto-generated, don't remove. -->
39
-
40
- ## Features
41
-
42
- - Wraps the [XDG](https://github.com/bkuhlmann/xdg) implementation which provides access to the
43
- following environment variables:
44
- - `$XDG_CACHE_HOME`
45
- - `$XDG_CONFIG_HOME`
46
- - `$XDG_CONFIG_DIRS`
47
- - `$XDG_DATA_HOME`
48
- - `$XDG_DATA_DIRS`
49
- - Enhances the XDG cache, config, and data implementation. For the config, the following is
50
- supported:
51
- - Supports loading of CLI-specific [YAML](http://yaml.org) configuration file.
52
- - Supports loading and merging of nested/complex configurations.
53
- - Supports hash representation of configuration.
54
-
55
- ## Requirements
56
-
57
- 1. [Ruby 2.7.x](https://www.ruby-lang.org).
58
-
59
- ## Setup
60
-
61
- Type the following to install:
62
-
63
- gem install runcom
64
-
65
- Add the following to your Gemfile:
66
-
67
- gem "runcom"
68
-
69
- ## Usage
70
-
71
- The following describes the enhancements built atop the [XDG](https://github.com/bkuhlmann/xdg)
72
- implementation.
73
-
74
- #### Overview
75
-
76
- While there isn't an environment convenience object as found in the `XDG` namespace, you can
77
- instantiate each object individually:
78
-
79
- cache = Runcom::Cache.new "example/data.json"
80
- config = Runcom::Config.new "example/configuration.yml"
81
- data = Runcom::Data.new "example/store.dat"
82
-
83
- Each of the above objects share the same API:
84
-
85
- - `#relative` - Answers the relative path from which the object was constructed.
86
- - `#namespace` - Answers the relative namespace as a pathname object from which the object was
87
- constructed. The namespace must be identical across the cache, config, and data objects as this is
88
- what uniquely identifies and organizes all files associated with your program.
89
- - `#file_name` - Answers the file name from which the object was constructed.
90
- - `#current` - Answers first *existing* file system path computed by `$XDG_*_HOME` followed by each
91
- computed `$XDG_*_DIRS` path in order defined. Otherwise, `nil` is answered back.
92
- - `#all` - Answers all file system paths which is the combined `$XDG_*_HOME` and `$XDG_*_DIRS`
93
- values in order defined. These paths *may* or *may not* exist on the file system.
94
- - `#inspect` - Answers a string representation of default XDG home and directory paths for debugging
95
- purposes.
96
-
97
- Using the `cache` object (created above) as an example, here is what each method answers back:
98
-
99
- cache.relative # => #<Pathname:example/data.json>
100
- cache.namespace # #<Pathname:example>
101
- cache.file_name # #<Pathname:data.json>
102
- cache.current # #<Pathname:/Users/bkuhlmann/.cache/example/data.json>
103
- cache.all # [#<Pathname:/Users/bkuhlmann/.cache/example/data.json>]
104
- cache.inspect # "XDG_CACHE_HOME=/Users/bkuhlmann/.cache"
105
-
106
- #### Variable Priority
107
-
108
- Path precedence is determined in the following order (with the first taking highest priority):
109
-
110
- 1. **Local Configuration** - If a `$XDG_*_HOME` or `$XDG_*_DIRS` path relative to the current
111
- working directory is detected, it will take precedence over the global configuration. This is the
112
- same behavior as found in Git where the local `.git/config` takes precedence over the global
113
- `~/.gitconfig`.
114
- 1. **Global Configuration** - When a local configuration isn't found, the global configuration is
115
- used as defined by the *XDG Base Directory Specification*.
116
-
117
- #### Configuration Specialization
118
-
119
- The `Runcom::Config` deserves additional highlighting as it provides support for loading custom CLI
120
- configurations directly from the command line or from custom locations. It is meant to be used
121
- within your program(s).
122
-
123
- An object is initialized as follows:
124
-
125
- configuration = Runcom::Config.new "example/configuration.yml"
126
-
127
- Default settings can be initialized as well:
128
-
129
- configuration = Runcom::Config.new "example/configuration.yml", defaults: {name: "Example"}
130
-
131
- Once a configuration has been initialized, a hash representation can be obtained:
132
-
133
- configuration.to_h
134
-
135
- A configuration can be merged with another hash (handy for runtime overrides):
136
-
137
- updated_configuration = configuration.merge {name: "Updated Name"}
138
-
139
- A configuration can also be merged with another configuration:
140
-
141
- updated_configuration = configuration.merge Runcom::Config.new("other", defaults: {a: 1})
142
-
143
- The current path of the configuration can be asked for as well:
144
-
145
- configuration.current # "~/.config/example/configuration.yml"
146
-
147
- For further details, study the public interface as provided by the
148
- [`Runcom::Config`](lib/runcom/config.rb) object.
149
-
150
- ### Examples
151
-
152
- Examples of gems built atop this gem are:
153
-
154
- - [Gemsmith](https://github.com/bkuhlmann/gemsmith) - A command line interface for smithing new Ruby
155
- gems.
156
- - [Git Cop](https://github.com/bkuhlmann/git-cop) - Enforces consistent Git commits.
157
- - [Milestoner](https://github.com/bkuhlmann/milestoner) - A command line interface for releasing Git
158
- repository milestones.
159
- - [Pennyworth](https://github.com/bkuhlmann/pennyworth) - A command line interface that enhances and
160
- extends [Alfred](https://www.alfredapp.com) with Ruby support.
161
- - [Pragmater](https://github.com/bkuhlmann/pragmater) - A command line interface for
162
- managing/formatting source file pragma comments.
163
- - [Sublime Text Kit](https://github.com/bkuhlmann/sublime_text_kit) - A command line interface for
164
- managing Sublime Text metadata.
165
- - [Tocer](https://github.com/bkuhlmann/tocer) - A command line interface for generating table of
166
- contents for Markdown files.
167
-
168
- ## Tests
169
-
170
- To test, run:
171
-
172
- bundle exec rake
173
-
174
- ## Versioning
175
-
176
- Read [Semantic Versioning](https://semver.org) for details. Briefly, it means:
177
-
178
- - Major (X.y.z) - Incremented for any backwards incompatible public API changes.
179
- - Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
180
- - Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
181
-
182
- ## Code of Conduct
183
-
184
- Please note that this project is released with a [CODE OF CONDUCT](CODE_OF_CONDUCT.md). By
185
- participating in this project you agree to abide by its terms.
186
-
187
- ## Contributions
188
-
189
- Read [CONTRIBUTING](CONTRIBUTING.md) for details.
190
-
191
- ## License
192
-
193
- Copyright 2016 [Alchemists](https://www.alchemists.io).
194
- Read [LICENSE](LICENSE.md) for details.
195
-
196
- ## History
197
-
198
- Read [CHANGES](CHANGES.md) for details.
199
- Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
200
-
201
- ## Credits
202
-
203
- Developed by [Brooke Kuhlmann](https://www.alchemists.io) at
204
- [Alchemists](https://www.alchemists.io).