sod 0.11.0 → 0.12.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: 187bbd240d6e599a3190473ca380385ed00f7215bf0240948784f929fb715d0e
4
- data.tar.gz: 17b1f1fa972a0a6cfe2a946b55378fa56808cde65b9bca5342e84ea4fa6c0b09
3
+ metadata.gz: ea753c5f11d19ea6db5857106782cb452ec2b9eabc14d66da032e7eb319955a1
4
+ data.tar.gz: 85ba4d8312fb87d8e6403e86eeed0f3e9279a846fb0a970349903fc3dce33f1d
5
5
  SHA512:
6
- metadata.gz: 36571821a83f84ebb15ea0b504c0a0725b87eebf1e65f50efc2153850ead70fa5f2b9909ef6ebb73c04836fef5a875e6dea7cb29f72eae46a704f53ef37bd5d6
7
- data.tar.gz: e97d347bbaf2b0c7026bfc1f55d3381cc9ff662dadd334d19cf298ad233ca1849941c915f85c5c25be1404b0695742d4f917619b2e1e9fa80810eea82e796076
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 composible 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.
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[:kernel]
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) = kernel.puts 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
@@ -12,7 +12,8 @@ module Sod
12
12
 
13
13
  register(:client) { OptionParser.new nil, 40, " " }
14
14
  register(:color) { Tone.new }
15
- register :kernel, Kernel
16
15
  register(:logger) { Cogger.new id: :sod }
16
+ register :kernel, Kernel
17
+ register :io, STDOUT
17
18
  end
18
19
  end
@@ -8,7 +8,7 @@ module Sod
8
8
  module Config
9
9
  # Displays project configuration.
10
10
  class View < Action
11
- include Import[:kernel, :logger]
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
- kernel.puts path.read
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[:kernel]
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
- kernel.puts presenter.new(graph).to_s
22
+ io.puts presenter.new(graph).to_s
23
23
  else
24
- kernel.puts presenter.new(graph.get_child(*lineage)).to_s
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[:kernel]
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(*) = kernel.puts label
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.11.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"
@@ -24,7 +24,7 @@ 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.0"
27
+ spec.add_dependency "containable", "~> 0.2"
28
28
  spec.add_dependency "infusible", "~> 3.5"
29
29
  spec.add_dependency "refinements", "~> 12.5"
30
30
  spec.add_dependency "tone", "~> 1.0"
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.11.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-07-01 00:00:00.000000000 Z
38
+ date: 2024-07-06 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.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.0'
67
+ version: '0.2'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: infusible
70
70
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file