sod 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +3 -3
- data/lib/sod/container.rb +2 -1
- data/lib/sod/prefabs/actions/config/view.rb +2 -2
- data/lib/sod/prefabs/actions/help.rb +3 -3
- data/lib/sod/prefabs/actions/version.rb +2 -2
- data/sod.gemspec +4 -4
- data.tar.gz.sig +0 -0
- metadata +9 -9
- 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: ea753c5f11d19ea6db5857106782cb452ec2b9eabc14d66da032e7eb319955a1
|
4
|
+
data.tar.gz: 85ba4d8312fb87d8e6403e86eeed0f3e9279a846fb0a970349903fc3dce33f1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7989124e23b6d58f7043b8f41d18f75dc696083145b6d3a9e0f4ecc701fdf7168512727e7ba12bc0b41552b53454076e4d3473f1e02c01c74b077fb45a4079f
|
7
|
+
data.tar.gz: aa127a9ddf96d7fb93dc72510489ef9301538428f396aaa48e54274a2084a3ea62640a3e9d78f305f200358931f74a80c55ce500269874b2b254d1d799f06c2e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -642,7 +642,7 @@ cli.call ["demo", "--one", "--no-two"]
|
|
642
642
|
# {:one => true, :two => false}
|
643
643
|
----
|
644
644
|
|
645
|
-
You might be thinking: "Hey, that's more lines of code!" True but -- more importantly -- you get the benefit of
|
645
|
+
You might be thinking: "Hey, that's more lines of code!" True but -- more importantly -- you get the benefit of composable and reusable architectures -- because each command/action is encapsulated -- which you don't get with {option_parser_link}. You'll also notice that the `input` hash is mutated. The fact that you have to mutate input is a bummer and you should strive to avoid mutation whenever you can. In this case, mutation is necessary because the underlining architecture of the {option_parser_link} doesn't provide any other way to share state amongst your commands and actions. So this is one example of how you can do that.
|
646
646
|
|
647
647
|
As mentioned earlier with actions, commands share a similar DSL with a few differences in terms of macros:
|
648
648
|
|
@@ -976,13 +976,13 @@ class Stop < Sod::Action
|
|
976
976
|
end
|
977
977
|
|
978
978
|
class Echo < Sod::Action
|
979
|
-
include Sod::Import[:
|
979
|
+
include Sod::Import[:io]
|
980
980
|
|
981
981
|
description "Echo input as output."
|
982
982
|
|
983
983
|
on %w[-e --echo], argument: "TEXT"
|
984
984
|
|
985
|
-
def call(text) =
|
985
|
+
def call(text) = io.puts text
|
986
986
|
end
|
987
987
|
|
988
988
|
cli = Sod.new :demo, banner: "Demo 0.0.0: A demonstration." do
|
data/lib/sod/container.rb
CHANGED
@@ -8,7 +8,7 @@ module Sod
|
|
8
8
|
module Config
|
9
9
|
# Displays project configuration.
|
10
10
|
class View < Action
|
11
|
-
include Import[:
|
11
|
+
include Import[:logger, :io]
|
12
12
|
|
13
13
|
using Refinements::Pathname
|
14
14
|
|
@@ -26,7 +26,7 @@ module Sod
|
|
26
26
|
return unless check
|
27
27
|
|
28
28
|
logger.info { "Viewing (#{path.to_s.inspect}):" }
|
29
|
-
|
29
|
+
io.puts path.read
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
@@ -5,7 +5,7 @@ module Sod
|
|
5
5
|
module Actions
|
6
6
|
# Displays help (usage) information.
|
7
7
|
class Help < Action
|
8
|
-
include Import[:
|
8
|
+
include Import[:io]
|
9
9
|
|
10
10
|
description "Show this message."
|
11
11
|
|
@@ -19,9 +19,9 @@ module Sod
|
|
19
19
|
|
20
20
|
def call *lineage
|
21
21
|
if lineage.empty?
|
22
|
-
|
22
|
+
io.puts presenter.new(graph).to_s
|
23
23
|
else
|
24
|
-
|
24
|
+
io.puts presenter.new(graph.get_child(*lineage)).to_s
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -5,7 +5,7 @@ module Sod
|
|
5
5
|
module Actions
|
6
6
|
# Provides a generic version action for use in upstream applications.
|
7
7
|
class Version < Action
|
8
|
-
include Import[:
|
8
|
+
include Import[:io]
|
9
9
|
|
10
10
|
description "Show version."
|
11
11
|
|
@@ -16,7 +16,7 @@ module Sod
|
|
16
16
|
@label = context[label, :version_label]
|
17
17
|
end
|
18
18
|
|
19
|
-
def call(*) =
|
19
|
+
def call(*) = io.puts label
|
20
20
|
|
21
21
|
private
|
22
22
|
|
data/sod.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "sod"
|
5
|
-
spec.version = "0.
|
5
|
+
spec.version = "0.12.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/sod"
|
@@ -23,10 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.3"
|
26
|
-
spec.add_dependency "cogger", "~> 0.
|
27
|
-
spec.add_dependency "containable", "~> 0.
|
26
|
+
spec.add_dependency "cogger", "~> 0.21"
|
27
|
+
spec.add_dependency "containable", "~> 0.2"
|
28
28
|
spec.add_dependency "infusible", "~> 3.5"
|
29
|
-
spec.add_dependency "refinements", "~> 12.
|
29
|
+
spec.add_dependency "refinements", "~> 12.5"
|
30
30
|
spec.add_dependency "tone", "~> 1.0"
|
31
31
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
32
32
|
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.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: 2024-06
|
38
|
+
date: 2024-07-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -43,28 +43,28 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '0.
|
46
|
+
version: '0.21'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '0.
|
53
|
+
version: '0.21'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: containable
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '0.
|
60
|
+
version: '0.2'
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '0.
|
67
|
+
version: '0.2'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
69
|
name: infusible
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
@@ -85,14 +85,14 @@ dependencies:
|
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '12.
|
88
|
+
version: '12.5'
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '12.
|
95
|
+
version: '12.5'
|
96
96
|
- !ruby/object:Gem::Dependency
|
97
97
|
name: tone
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
183
183
|
- !ruby/object:Gem::Version
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
|
-
rubygems_version: 3.5.
|
186
|
+
rubygems_version: 3.5.14
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: A domain specific language for creating composable command line interfaces.
|
metadata.gz.sig
CHANGED
Binary file
|