gemsmith 22.0.0 → 22.2.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/gemsmith.gemspec +4 -4
- data/lib/gemsmith/builders/cli.rb +17 -0
- data/lib/gemsmith/builders/rspec/helper.rb +4 -1
- data/lib/gemsmith/cli/actions/cli.rb +1 -1
- data/lib/gemsmith/cli/actions/install.rb +2 -2
- data/lib/gemsmith/cli/actions/publish.rb +2 -2
- data/lib/gemsmith/templates/%project_name%/%project_name%.gemspec.erb +2 -2
- data/lib/gemsmith/templates/%project_name%/lib/%project_path%/configuration/defaults.yml.erb +1 -0
- data/lib/gemsmith/templates/%project_name%/lib/%project_path%/configuration/model.rb.erb +1 -1
- data/lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb +14 -0
- data/lib/gemsmith/templates/%project_name%/spec/support/shared_contexts/application_dependencies.rb.erb +6 -0
- 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: 18ca21e688424ebfaca56d001542c4920dcb415bad72210f602333b1fbb45f50
|
4
|
+
data.tar.gz: 6e9f438efbc73bc3b873c6363ed407fd40663cc0eb9df4060e9c14f805173652
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b49b3b2e39138ed8744453c02ee5662cbfac5c7ffde5a3ff2eb54c03eb69f36eed5e155680d308e6899cb01621c2f5cab6072505ec985d60871eb938a9d52b57
|
7
|
+
data.tar.gz: 9a3757fc2ed3e4e287bc37e5ad665e19fe4dc39c39d3576f2219116c0a1d850fcf1fa6af746d917584a1d517fb5b5ccb33f04e3015cd9ab9af8e5a88f537a8bb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/gemsmith.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "gemsmith"
|
5
|
-
spec.version = "22.
|
5
|
+
spec.version = "22.2.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/gemsmith"
|
@@ -31,10 +31,10 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "etcher", "~> 2.1"
|
32
32
|
spec.add_dependency "infusible", "~> 3.8"
|
33
33
|
spec.add_dependency "milestoner", "~> 18.0"
|
34
|
-
spec.add_dependency "refinements", "~> 12.
|
35
|
-
spec.add_dependency "rubysmith", "~> 7.
|
34
|
+
spec.add_dependency "refinements", "~> 12.7"
|
35
|
+
spec.add_dependency "rubysmith", "~> 7.2"
|
36
36
|
spec.add_dependency "runcom", "~> 11.5"
|
37
|
-
spec.add_dependency "sod", "~> 0.
|
37
|
+
spec.add_dependency "sod", "~> 0.14"
|
38
38
|
spec.add_dependency "spek", "~> 3.0"
|
39
39
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
40
40
|
|
@@ -47,6 +47,23 @@ module Gemsmith
|
|
47
47
|
builder.call(settings.merge(template_path: path)).render
|
48
48
|
end
|
49
49
|
|
50
|
+
def render_requirements
|
51
|
+
return if settings.build_zeitwerk
|
52
|
+
|
53
|
+
builder.call(settings.merge(template_path: "%project_name%/lib/%project_path%.rb.erb"))
|
54
|
+
.render
|
55
|
+
.prepend <<~CONTENT
|
56
|
+
require "demo/configuration/contract"
|
57
|
+
require "demo/configuration/model"
|
58
|
+
require "demo/container"
|
59
|
+
require "demo/import"
|
60
|
+
|
61
|
+
require "demo/cli/shell"
|
62
|
+
|
63
|
+
# Main namespace.
|
64
|
+
CONTENT
|
65
|
+
end
|
66
|
+
|
50
67
|
def render_specs
|
51
68
|
return unless settings.build_rspec
|
52
69
|
|
@@ -10,9 +10,12 @@ module Gemsmith
|
|
10
10
|
using Refinements::Struct
|
11
11
|
|
12
12
|
def call
|
13
|
-
return false unless settings.build_rspec
|
13
|
+
return false unless settings.build_rspec
|
14
14
|
|
15
15
|
super
|
16
|
+
|
17
|
+
return false unless settings.build_cli
|
18
|
+
|
16
19
|
builder.call(settings.merge(template_path: "%project_name%/spec/spec_helper.rb.erb"))
|
17
20
|
.replace("%r(^/spec/)", "%r((.+/container\\.rb|^/spec/))")
|
18
21
|
|
@@ -27,8 +27,8 @@ module Gemsmith
|
|
27
27
|
@loader = loader
|
28
28
|
end
|
29
29
|
|
30
|
-
def call name =
|
31
|
-
case installer.call loader.call("#{name
|
30
|
+
def call name = default
|
31
|
+
case installer.call loader.call("#{name}.gemspec")
|
32
32
|
in Success(spec) then logger.info { "Installed: #{spec.package_name}." }
|
33
33
|
in Failure(message) then log_error { message }
|
34
34
|
else log_error { "Unable to handle install action." }
|
@@ -27,8 +27,8 @@ module Gemsmith
|
|
27
27
|
@loader = loader
|
28
28
|
end
|
29
29
|
|
30
|
-
def call name =
|
31
|
-
case publisher.call loader.call("#{name
|
30
|
+
def call name = default
|
31
|
+
case publisher.call loader.call("#{name}.gemspec")
|
32
32
|
in Success(spec) then logger.info { "Published: #{spec.package_name}." }
|
33
33
|
in Failure(message) then log_error message
|
34
34
|
else log_error "Publish failed, unable to parse result."
|
@@ -51,13 +51,13 @@ Gem::Specification.new do |spec|
|
|
51
51
|
spec.add_dependency "infusible", "~> 3.8"
|
52
52
|
<% end %>
|
53
53
|
<% if settings.build_refinements %>
|
54
|
-
spec.add_dependency "refinements", "~> 12.
|
54
|
+
spec.add_dependency "refinements", "~> 12.7"
|
55
55
|
<% end %>
|
56
56
|
<% if settings.build_cli %>
|
57
57
|
spec.add_dependency "runcom", "~> 11.5"
|
58
58
|
<% end %>
|
59
59
|
<% if settings.build_cli %>
|
60
|
-
spec.add_dependency "sod", "~> 0.
|
60
|
+
spec.add_dependency "sod", "~> 0.14"
|
61
61
|
<% end %>
|
62
62
|
<% if settings.build_cli %>
|
63
63
|
spec.add_dependency "spek", "~> 3.0"
|
data/lib/gemsmith/templates/%project_name%/lib/%project_path%/configuration/defaults.yml.erb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
todo: "Add your own attributes here."
|
@@ -1,8 +1,10 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
RSpec.describe <%= settings.project_namespaced_class %>::CLI::Shell do
|
4
|
+
<% if settings.build_refinements %>
|
4
5
|
using Refinements::Pathname
|
5
6
|
using Refinements::StringIO
|
7
|
+
<% end %>
|
6
8
|
|
7
9
|
subject(:shell) { described_class.new }
|
8
10
|
|
@@ -15,17 +17,29 @@ RSpec.describe <%= settings.project_namespaced_class %>::CLI::Shell do
|
|
15
17
|
describe "#call" do
|
16
18
|
it "prints configuration usage" do
|
17
19
|
shell.call %w[config]
|
20
|
+
<% if settings.build_refinements %>
|
18
21
|
expect(io.reread).to match(/Manage configuration.+/m)
|
22
|
+
<% else %>
|
23
|
+
expect(io.tap(&:rewind).read).to match(/Manage configuration.+/m)
|
24
|
+
<% end %>
|
19
25
|
end
|
20
26
|
|
21
27
|
it "prints version" do
|
22
28
|
shell.call %w[--version]
|
29
|
+
<% if settings.build_refinements %>
|
23
30
|
expect(io.reread).to match(/<%= settings.project_label.gsub(" ", "\\s") %>\s\d+\.\d+\.\d+/)
|
31
|
+
<% else %>
|
32
|
+
expect(io.tap(&:rewind).read).to match(/<%= settings.project_label.gsub(" ", "\\s") %>\s\d+\.\d+\.\d+/)
|
33
|
+
<% end %>
|
24
34
|
end
|
25
35
|
|
26
36
|
it "prints help" do
|
27
37
|
shell.call %w[--help]
|
38
|
+
<% if settings.build_refinements %>
|
28
39
|
expect(io.reread).to match(/<%= settings.project_label.gsub(" ", "\\s") %>.+USAGE.+/m)
|
40
|
+
<% else %>
|
41
|
+
expect(io.tap(&:rewind).read).to match(/<%= settings.project_label.gsub(" ", "\\s") %>.+USAGE.+/m)
|
42
|
+
<% end %>
|
29
43
|
end
|
30
44
|
end
|
31
45
|
end
|
@@ -1,14 +1,20 @@
|
|
1
1
|
RSpec.shared_context "with application dependencies" do
|
2
|
+
<% if settings.build_refinements %>
|
2
3
|
using Refinements::Struct
|
4
|
+
<% end %>
|
3
5
|
|
4
6
|
let(:settings) { <%= settings.project_namespaced_class %>::Container[:settings] }
|
5
7
|
let(:logger) { Cogger.new id: "<%= settings.project_name %>", io: StringIO.new, level: :debug }
|
6
8
|
let(:io) { StringIO.new }
|
7
9
|
|
10
|
+
<% if settings.build_refinements %>
|
8
11
|
before do
|
9
12
|
settings.merge! Etcher.call(<%= settings.project_namespaced_class %>::Container[:registry].remove_loader(1))
|
10
13
|
<%= settings.project_namespaced_class %>::Container.stub! logger:, io:
|
11
14
|
end
|
15
|
+
<% else %>
|
16
|
+
before { Demo::Container.stub! logger:, io: }
|
17
|
+
<% end %>
|
12
18
|
|
13
19
|
after { <%= settings.project_namespaced_class %>::Container.restore }
|
14
20
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemsmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 22.
|
4
|
+
version: 22.2.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-
|
38
|
+
date: 2024-08-11 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -155,28 +155,28 @@ dependencies:
|
|
155
155
|
requirements:
|
156
156
|
- - "~>"
|
157
157
|
- !ruby/object:Gem::Version
|
158
|
-
version: '12.
|
158
|
+
version: '12.7'
|
159
159
|
type: :runtime
|
160
160
|
prerelease: false
|
161
161
|
version_requirements: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '12.
|
165
|
+
version: '12.7'
|
166
166
|
- !ruby/object:Gem::Dependency
|
167
167
|
name: rubysmith
|
168
168
|
requirement: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '7.
|
172
|
+
version: '7.2'
|
173
173
|
type: :runtime
|
174
174
|
prerelease: false
|
175
175
|
version_requirements: !ruby/object:Gem::Requirement
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '7.
|
179
|
+
version: '7.2'
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: runcom
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,14 +197,14 @@ dependencies:
|
|
197
197
|
requirements:
|
198
198
|
- - "~>"
|
199
199
|
- !ruby/object:Gem::Version
|
200
|
-
version: '0.
|
200
|
+
version: '0.14'
|
201
201
|
type: :runtime
|
202
202
|
prerelease: false
|
203
203
|
version_requirements: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
205
|
- - "~>"
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version: '0.
|
207
|
+
version: '0.14'
|
208
208
|
- !ruby/object:Gem::Dependency
|
209
209
|
name: spek
|
210
210
|
requirement: !ruby/object:Gem::Requirement
|
@@ -311,7 +311,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
311
311
|
- !ruby/object:Gem::Version
|
312
312
|
version: '0'
|
313
313
|
requirements: []
|
314
|
-
rubygems_version: 3.5.
|
314
|
+
rubygems_version: 3.5.17
|
315
315
|
signing_key:
|
316
316
|
specification_version: 4
|
317
317
|
summary: A command line interface for smithing Ruby gems.
|
metadata.gz.sig
CHANGED
Binary file
|