sod 0.20.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 379400ea01fd9bc48902df60bf60551da5f1cc64ea5b6807209008561d148b82
4
- data.tar.gz: 78b156150bb626e991c3dc48b56b71b435752a8e4722feddddb2dbacac379663
3
+ metadata.gz: 13f9f431b1108b3f3715df5fad37459e9687c7cbe8bff00c88c34e9b92635264
4
+ data.tar.gz: 8983b1811d932b75baef2959e621ef0e20fc0c319ac5da72f61cc0452ba4887c
5
5
  SHA512:
6
- metadata.gz: 350e64cf2b035185d16944908dc8be3ba8f77a341e95f454398f0ba864bfab5cbe8454737345759e39c3a1e74f51027ad6a3cc3d241a2642a801fdac85aad54c
7
- data.tar.gz: f02c8f40d595b176938d6132b8d3db70cf013521e263461235aafd784680db3ee1a6d5bceadca969e2649c8bb31fbf657304643afba58952365cfc1a55121abf
6
+ metadata.gz: 73caceac551412da369e5fc8bc07660a368d2e7905f9abb3eb2ee7f9ae52ef2b426664e9d935ee7418e742cb2a9342e43cf159de0c846e33c68fe287281415b6
7
+ data.tar.gz: 4a8b72f3153b78d7ac30de1307777bca4cc9038b1b7f8f6201af3a882a6b8e32476cb691b2d28648bfa8a87ce20ccfeed7183081e1912699b953bd1e00d5c1ba
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -947,7 +947,7 @@ gemfile true do
947
947
  end
948
948
 
949
949
  class Start < Sod::Action
950
- include Sod::Import[:logger]
950
+ include Sod::Dependencies[:logger]
951
951
 
952
952
  description "Start database."
953
953
 
@@ -957,7 +957,7 @@ class Start < Sod::Action
957
957
  end
958
958
 
959
959
  class Stop < Sod::Action
960
- include Sod::Import[:logger]
960
+ include Sod::Dependencies[:logger]
961
961
 
962
962
  description "Stop database."
963
963
 
@@ -967,7 +967,7 @@ class Stop < Sod::Action
967
967
  end
968
968
 
969
969
  class Echo < Sod::Action
970
- include Sod::Import[:io]
970
+ include Sod::Dependencies[:io]
971
971
 
972
972
  description "Echo input as output."
973
973
 
data/lib/sod/command.rb CHANGED
@@ -8,7 +8,7 @@ module Sod
8
8
  class Command
9
9
  extend Forwardable
10
10
 
11
- include Import[:logger]
11
+ include Dependencies[:logger]
12
12
 
13
13
  def self.inherited descendant
14
14
  super
@@ -3,5 +3,5 @@
3
3
  require "infusible"
4
4
 
5
5
  module Sod
6
- Import = Infusible[Container]
6
+ Dependencies = Infusible[Container]
7
7
  end
@@ -4,7 +4,7 @@ module Sod
4
4
  module Graph
5
5
  # Loads and decorates option parsers within graph.
6
6
  class Loader
7
- include Import[:client]
7
+ include Dependencies[:client]
8
8
 
9
9
  using Refines::OptionParser
10
10
 
@@ -4,7 +4,7 @@ module Sod
4
4
  module Graph
5
5
  # Runs the appropriate parser for given command line arguments.
6
6
  class Runner
7
- include Import[:client, :logger]
7
+ include Dependencies[:client, :logger]
8
8
 
9
9
  using Refines::OptionParser
10
10
 
@@ -8,7 +8,7 @@ module Sod
8
8
  module Config
9
9
  # Creates project configuration.
10
10
  class Create < Action
11
- include Import[:kernel, :logger]
11
+ include Dependencies[:kernel, :logger]
12
12
 
13
13
  using Refinements::Pathname
14
14
 
@@ -18,10 +18,10 @@ module Sod
18
18
 
19
19
  on %w[-c --create]
20
20
 
21
- def initialize(xdg_config = nil, defaults_path: nil, **)
21
+ def initialize(path = nil, xdg_config: nil, **)
22
22
  super(**)
23
23
  @xdg_config = context[xdg_config, :xdg_config]
24
- @defaults_path = Pathname context[defaults_path, :defaults_path]
24
+ @path = Pathname context[path, :defaults_path]
25
25
  end
26
26
 
27
27
  def call(*)
@@ -31,12 +31,12 @@ module Sod
31
31
 
32
32
  private
33
33
 
34
- attr_reader :xdg_config, :defaults_path
34
+ attr_reader :path, :xdg_config
35
35
 
36
36
  def check_defaults
37
- return true if defaults_path.exist?
37
+ return true if path.exist?
38
38
 
39
- logger.abort "Default configuration doesn't exist: #{defaults_path.to_s.inspect}."
39
+ logger.abort "Default configuration doesn't exist: #{path.to_s.inspect}."
40
40
  false
41
41
  end
42
42
 
@@ -53,15 +53,13 @@ module Sod
53
53
  end
54
54
 
55
55
  # :reek:TooManyStatements
56
- def create path
57
- path_info = path.to_s.inspect
58
-
59
- if path.exist?
60
- logger.warn { "Skipped. Configuration exists: #{path_info}." }
61
- else
62
- defaults_path.copy path.make_ancestors
63
- logger.info { "Created: #{path_info}." }
64
- end
56
+ def create xdg_path
57
+ path_info = xdg_path.to_s.inspect
58
+
59
+ return logger.warn { "Skipped. Configuration exists: #{path_info}." } if xdg_path.exist?
60
+
61
+ path.copy xdg_path.make_ancestors
62
+ logger.info { "Created: #{path_info}." }
65
63
  end
66
64
 
67
65
  def quit
@@ -9,7 +9,7 @@ module Sod
9
9
  module Config
10
10
  # Deletes project configuration.
11
11
  class Delete < Action
12
- include Import[:kernel, :logger]
12
+ include Dependencies[:kernel, :logger]
13
13
 
14
14
  using Refinements::Pathname
15
15
  using Refinements::String
@@ -8,7 +8,7 @@ module Sod
8
8
  module Config
9
9
  # Edits project configuration.
10
10
  class Edit < Action
11
- include Import[:kernel, :logger]
11
+ include Dependencies[:kernel, :logger]
12
12
 
13
13
  using Refinements::Pathname
14
14
 
@@ -8,7 +8,7 @@ module Sod
8
8
  module Config
9
9
  # Displays project configuration.
10
10
  class View < Action
11
- include Import[:logger, :io]
11
+ include Dependencies[:logger, :io]
12
12
 
13
13
  using Refinements::Pathname
14
14
 
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Sod
4
+ module Prefabs
5
+ module Actions
6
+ # Displays help (usage) information.
7
+ class DryRun < Action
8
+ description "Simulate execution without making changes."
9
+
10
+ on %w[-n --dry_run]
11
+
12
+ def initialize(settings: Struct.new(:dry_run).new(dry_run: false), **)
13
+ super(**)
14
+ @settings = settings
15
+ end
16
+
17
+ def call = settings.dry_run = true
18
+
19
+ private
20
+
21
+ attr_reader :settings
22
+ end
23
+ end
24
+ end
25
+ end
@@ -5,7 +5,7 @@ module Sod
5
5
  module Actions
6
6
  # Displays help (usage) information.
7
7
  class Help < Action
8
- include Import[:io]
8
+ include Dependencies[:io]
9
9
 
10
10
  description "Show this message."
11
11
 
@@ -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[:io]
8
+ include Dependencies[:io]
9
9
 
10
10
  description "Show version."
11
11
 
@@ -7,7 +7,7 @@ module Sod
7
7
  module Presenters
8
8
  # Aids in rendering an action for display.
9
9
  class Action
10
- include Import[:color]
10
+ include Dependencies[:color]
11
11
 
12
12
  extend Forwardable
13
13
 
@@ -9,7 +9,7 @@ module Sod
9
9
  # Aids in rendering a node for display.
10
10
  # :reek:TooManyInstanceVariables
11
11
  class Node
12
- include Import[:color]
12
+ include Dependencies[:color]
13
13
 
14
14
  extend Forwardable
15
15
 
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.20.0"
5
+ spec.version = "1.0.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/sod"
@@ -22,13 +22,13 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = ">= 3.3", "<= 3.4"
26
- spec.add_dependency "cogger", "~> 0.31"
27
- spec.add_dependency "containable", "~> 0.2"
28
- spec.add_dependency "infusible", "~> 3.12"
25
+ spec.required_ruby_version = "~> 3.4"
26
+ spec.add_dependency "cogger", "~> 1.0"
27
+ spec.add_dependency "containable", "~> 1.0"
28
+ spec.add_dependency "infusible", "~> 4.0"
29
29
  spec.add_dependency "optparse", "~> 0.6"
30
- spec.add_dependency "refinements", "~> 12.10"
31
- spec.add_dependency "tone", "~> 1.10"
30
+ spec.add_dependency "refinements", "~> 13.0"
31
+ spec.add_dependency "tone", "~> 2.0"
32
32
  spec.add_dependency "zeitwerk", "~> 2.7"
33
33
 
34
34
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,11 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain:
11
10
  - |
@@ -35,7 +34,7 @@ cert_chain:
35
34
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
35
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
36
  -----END CERTIFICATE-----
38
- date: 2024-11-09 00:00:00.000000000 Z
37
+ date: 2024-12-27 00:00:00.000000000 Z
39
38
  dependencies:
40
39
  - !ruby/object:Gem::Dependency
41
40
  name: cogger
@@ -43,42 +42,42 @@ dependencies:
43
42
  requirements:
44
43
  - - "~>"
45
44
  - !ruby/object:Gem::Version
46
- version: '0.31'
45
+ version: '1.0'
47
46
  type: :runtime
48
47
  prerelease: false
49
48
  version_requirements: !ruby/object:Gem::Requirement
50
49
  requirements:
51
50
  - - "~>"
52
51
  - !ruby/object:Gem::Version
53
- version: '0.31'
52
+ version: '1.0'
54
53
  - !ruby/object:Gem::Dependency
55
54
  name: containable
56
55
  requirement: !ruby/object:Gem::Requirement
57
56
  requirements:
58
57
  - - "~>"
59
58
  - !ruby/object:Gem::Version
60
- version: '0.2'
59
+ version: '1.0'
61
60
  type: :runtime
62
61
  prerelease: false
63
62
  version_requirements: !ruby/object:Gem::Requirement
64
63
  requirements:
65
64
  - - "~>"
66
65
  - !ruby/object:Gem::Version
67
- version: '0.2'
66
+ version: '1.0'
68
67
  - !ruby/object:Gem::Dependency
69
68
  name: infusible
70
69
  requirement: !ruby/object:Gem::Requirement
71
70
  requirements:
72
71
  - - "~>"
73
72
  - !ruby/object:Gem::Version
74
- version: '3.12'
73
+ version: '4.0'
75
74
  type: :runtime
76
75
  prerelease: false
77
76
  version_requirements: !ruby/object:Gem::Requirement
78
77
  requirements:
79
78
  - - "~>"
80
79
  - !ruby/object:Gem::Version
81
- version: '3.12'
80
+ version: '4.0'
82
81
  - !ruby/object:Gem::Dependency
83
82
  name: optparse
84
83
  requirement: !ruby/object:Gem::Requirement
@@ -99,28 +98,28 @@ dependencies:
99
98
  requirements:
100
99
  - - "~>"
101
100
  - !ruby/object:Gem::Version
102
- version: '12.10'
101
+ version: '13.0'
103
102
  type: :runtime
104
103
  prerelease: false
105
104
  version_requirements: !ruby/object:Gem::Requirement
106
105
  requirements:
107
106
  - - "~>"
108
107
  - !ruby/object:Gem::Version
109
- version: '12.10'
108
+ version: '13.0'
110
109
  - !ruby/object:Gem::Dependency
111
110
  name: tone
112
111
  requirement: !ruby/object:Gem::Requirement
113
112
  requirements:
114
113
  - - "~>"
115
114
  - !ruby/object:Gem::Version
116
- version: '1.10'
115
+ version: '2.0'
117
116
  type: :runtime
118
117
  prerelease: false
119
118
  version_requirements: !ruby/object:Gem::Requirement
120
119
  requirements:
121
120
  - - "~>"
122
121
  - !ruby/object:Gem::Version
123
- version: '1.10'
122
+ version: '2.0'
124
123
  - !ruby/object:Gem::Dependency
125
124
  name: zeitwerk
126
125
  requirement: !ruby/object:Gem::Requirement
@@ -135,7 +134,6 @@ dependencies:
135
134
  - - "~>"
136
135
  - !ruby/object:Gem::Version
137
136
  version: '2.7'
138
- description:
139
137
  email:
140
138
  - brooke@alchemists.io
141
139
  executables: []
@@ -151,17 +149,18 @@ files:
151
149
  - lib/sod/command.rb
152
150
  - lib/sod/container.rb
153
151
  - lib/sod/context.rb
152
+ - lib/sod/dependencies.rb
154
153
  - lib/sod/error.rb
155
154
  - lib/sod/graph/loader.rb
156
155
  - lib/sod/graph/node.rb
157
156
  - lib/sod/graph/runner.rb
158
- - lib/sod/import.rb
159
157
  - lib/sod/models/action.rb
160
158
  - lib/sod/models/command.rb
161
159
  - lib/sod/prefabs/actions/config/create.rb
162
160
  - lib/sod/prefabs/actions/config/delete.rb
163
161
  - lib/sod/prefabs/actions/config/edit.rb
164
162
  - lib/sod/prefabs/actions/config/view.rb
163
+ - lib/sod/prefabs/actions/dry_run.rb
165
164
  - lib/sod/prefabs/actions/help.rb
166
165
  - lib/sod/prefabs/actions/version.rb
167
166
  - lib/sod/prefabs/commands/config.rb
@@ -182,16 +181,12 @@ metadata:
182
181
  label: Sod
183
182
  rubygems_mfa_required: 'true'
184
183
  source_code_uri: https://github.com/bkuhlmann/sod
185
- post_install_message:
186
184
  rdoc_options: []
187
185
  require_paths:
188
186
  - lib
189
187
  required_ruby_version: !ruby/object:Gem::Requirement
190
188
  requirements:
191
- - - ">="
192
- - !ruby/object:Gem::Version
193
- version: '3.3'
194
- - - "<="
189
+ - - "~>"
195
190
  - !ruby/object:Gem::Version
196
191
  version: '3.4'
197
192
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -200,8 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
195
  - !ruby/object:Gem::Version
201
196
  version: '0'
202
197
  requirements: []
203
- rubygems_version: 3.5.23
204
- signing_key:
198
+ rubygems_version: 3.6.2
205
199
  specification_version: 4
206
200
  summary: A domain specific language for creating composable command line interfaces.
207
201
  test_files: []
metadata.gz.sig CHANGED
Binary file