sod 0.11.0 → 0.13.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 +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 +3 -3
- data.tar.gz.sig +0 -0
- metadata +6 -6
- 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: 064c2b356590ff7c74a2f64a269fcadc1d7bfc46fc8c7867b8627a43d4719850
|
4
|
+
data.tar.gz: 481aa201574305f457cd4613aedfde6ee6e6b07ac736395eabefeccf8ee618dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 628ba8d427d6899ba4e775001b80ed36179719b18517bd0a0aa7cd3f212745d26db1532c1dc0e7f4d14b4ea65133a453409d4c0bc0cfa7d86df6bbd5b9c907bf
|
7
|
+
data.tar.gz: c8d810bdd5f57bedd874220bc5ca4b0b1d51c81d470383ecfa8222452069d37678645f11e87b5c4638cc1f69575912a6fa8c5be548a447604f2d8fe49efc60d8
|
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.13.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/sod"
|
@@ -24,8 +24,8 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.3"
|
26
26
|
spec.add_dependency "cogger", "~> 0.21"
|
27
|
-
spec.add_dependency "containable", "~> 0.
|
28
|
-
spec.add_dependency "infusible", "~> 3.
|
27
|
+
spec.add_dependency "containable", "~> 0.2"
|
28
|
+
spec.add_dependency "infusible", "~> 3.8"
|
29
29
|
spec.add_dependency "refinements", "~> 12.5"
|
30
30
|
spec.add_dependency "tone", "~> 1.0"
|
31
31
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
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.13.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-07-
|
38
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -57,28 +57,28 @@ dependencies:
|
|
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
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '3.
|
74
|
+
version: '3.8'
|
75
75
|
type: :runtime
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '3.
|
81
|
+
version: '3.8'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: refinements
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|