gemsmith 20.2.1 → 20.4.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 +1 -21
- data/exe/gemsmith +1 -1
- data/gemsmith.gemspec +2 -2
- data/lib/gemsmith/builders/cli.rb +1 -7
- data/lib/gemsmith/builders/console.rb +22 -0
- data/lib/gemsmith/cli/commands/build.rb +1 -1
- data/lib/gemsmith/container.rb +11 -8
- data/lib/gemsmith/templates/%project_name%/exe/%project_name%.erb +2 -2
- data/lib/gemsmith/templates/%project_name%/lib/%project_path%/container.rb.erb +10 -7
- data/lib/gemsmith.rb +4 -1
- data.tar.gz.sig +0 -0
- metadata +6 -6
- metadata.gz.sig +0 -0
- data/lib/gemsmith/templates/%project_name%/lib/%project_path%/identity.rb.erb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f624aae829daa2768b30f6539c2482f53677d2ea1f03ef878d45a114363108b6
|
4
|
+
data.tar.gz: cf95d4706fcef72a6a36a00e9f6ac4b658d8e4c5682fd167017755173814f7e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cea5ed3beb891f599d32c707d68f5d574ab1332d7af0b3df618a7f5afb43f74cc2b30ce3d238db192c5d3d853a87ff5f383c4aa164d166bdf3dc3a3bf7bebd5b
|
7
|
+
data.tar.gz: 01c5b1d6a16c479a1afa55a228f8d6faf6aec2356906ac71534381f40038f04d6780f2b61f1498031a2b7479850dd9af210fbd73a7e25da994b0be89e84d218d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -52,27 +52,7 @@ gem install gemsmith
|
|
52
52
|
|
53
53
|
From the command line, type: `gemsmith --help`
|
54
54
|
|
55
|
-
|
56
|
-
USAGE
|
57
|
-
gemsmith [OPTIONS]
|
58
|
-
gemsmith COMMAND [OPTIONS]
|
59
|
-
|
60
|
-
OPTIONS
|
61
|
-
-i, --install [GEM] Install gem for local development.
|
62
|
-
Optionally computes gem package based on current directory.
|
63
|
-
-p, --publish [GEM] Publish gem to remote gem server.
|
64
|
-
Optionally computes gem package based on current directory.
|
65
|
-
Default: gemsmith.
|
66
|
-
-e, --edit GEM Edit installed gem in default editor.
|
67
|
-
-V, --view GEM View installed gem in default browser.
|
68
|
-
-v, --version Show version.
|
69
|
-
-h, --help [COMMAND] Show this message.
|
70
|
-
|
71
|
-
COMMANDS
|
72
|
-
config Manage configuration.
|
73
|
-
Path is dynamic per current directory.
|
74
|
-
build Build new project.
|
75
|
-
....
|
55
|
+
image:https://alchemists.io/images/projects/gemsmith/screenshots/usage.png[Usage,width=729,height=462,role=focal_point]
|
76
56
|
|
77
57
|
==== Build
|
78
58
|
|
data/exe/gemsmith
CHANGED
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 = "20.
|
5
|
+
spec.version = "20.4.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/gemsmith"
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
spec.add_dependency "infusible", "~> 2.0"
|
33
33
|
spec.add_dependency "milestoner", "~> 16.0"
|
34
34
|
spec.add_dependency "refinements", "~> 11.0"
|
35
|
-
spec.add_dependency "rubysmith", "~> 5.
|
35
|
+
spec.add_dependency "rubysmith", "~> 5.6"
|
36
36
|
spec.add_dependency "runcom", "~> 10.0"
|
37
37
|
spec.add_dependency "sod", "~> 0.0"
|
38
38
|
spec.add_dependency "spek", "~> 2.0"
|
@@ -38,13 +38,7 @@ module Gemsmith
|
|
38
38
|
content = configuration.merge template_path: "%project_name%/lib/%project_path%.rb.erb"
|
39
39
|
|
40
40
|
builder.call(content)
|
41
|
-
.
|
42
|
-
.replace("Zeitwerk::Loader.for_gem.setup", <<~CONTENT.strip)
|
43
|
-
Zeitwerk::Loader.for_gem.then do |loader|
|
44
|
-
loader.inflector.inflect "cli" => "CLI"
|
45
|
-
loader.setup
|
46
|
-
end
|
47
|
-
CONTENT
|
41
|
+
.insert_before(/tag/, %( loader.inflector.inflect "cli" => "CLI"\n))
|
48
42
|
end
|
49
43
|
|
50
44
|
def render_configuration
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "refinements/structs"
|
4
|
+
|
5
|
+
module Gemsmith
|
6
|
+
module Builders
|
7
|
+
# Builds project skeleton console for object inspection and exploration.
|
8
|
+
class Console < Rubysmith::Builders::Console
|
9
|
+
using Refinements::Structs
|
10
|
+
|
11
|
+
def call
|
12
|
+
return configuration unless configuration.build_console
|
13
|
+
|
14
|
+
super
|
15
|
+
builder.call(configuration.merge(template_path: "%project_name%/bin/console.erb"))
|
16
|
+
.replace(/require Bundler.root.+/, %(require "#{configuration.project_path}"))
|
17
|
+
|
18
|
+
configuration
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/gemsmith/container.rb
CHANGED
@@ -12,12 +12,12 @@ module Gemsmith
|
|
12
12
|
module Container
|
13
13
|
extend Dry::Container::Mixin
|
14
14
|
|
15
|
-
register :configuration do
|
15
|
+
register :configuration, memoize: true do
|
16
16
|
self[:defaults].add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active))
|
17
17
|
.then { |registry| Etcher.call registry }
|
18
18
|
end
|
19
19
|
|
20
|
-
register :defaults do
|
20
|
+
register :defaults, memoize: true do
|
21
21
|
registry = Etcher::Registry.new contract: Rubysmith::Configuration::Contract,
|
22
22
|
model: Rubysmith::Configuration::Model
|
23
23
|
|
@@ -29,19 +29,22 @@ module Gemsmith
|
|
29
29
|
.add_transformer(Rubysmith::Configuration::Transformers::TemplateRoot.new)
|
30
30
|
.add_transformer(
|
31
31
|
Rubysmith::Configuration::Transformers::TemplateRoot.new(
|
32
|
-
Pathname(__dir__).join("templates")
|
32
|
+
default: Pathname(__dir__).join("templates")
|
33
33
|
)
|
34
34
|
)
|
35
35
|
.add_transformer(Rubysmith::Configuration::Transformers::TargetRoot)
|
36
36
|
end
|
37
37
|
|
38
|
+
register :specification, memoize: true do
|
39
|
+
Spek::Loader.call "#{__dir__}/../../gemsmith.gemspec"
|
40
|
+
end
|
41
|
+
|
38
42
|
register(:input, memoize: true) { self[:configuration].dup }
|
39
43
|
register(:defaults_path) { Rubysmith::Container[:defaults_path] }
|
40
|
-
register(:xdg_config) { Runcom::Config.new "gemsmith/configuration.yml" }
|
41
|
-
register(:specification) { Spek::Loader.call "#{__dir__}/../../gemsmith.gemspec" }
|
44
|
+
register(:xdg_config, memoize: true) { Runcom::Config.new "gemsmith/configuration.yml" }
|
42
45
|
register(:environment) { ENV }
|
43
|
-
register(:
|
44
|
-
register
|
45
|
-
register
|
46
|
+
register(:logger, memoize: true) { Cogger.new formatter: :emoji }
|
47
|
+
register :executor, Open3
|
48
|
+
register :kernel, Kernel
|
46
49
|
end
|
47
50
|
end
|
@@ -9,20 +9,23 @@ require "spek"
|
|
9
9
|
module Container
|
10
10
|
extend Dry::Container::Mixin
|
11
11
|
|
12
|
-
register :configuration do
|
12
|
+
register :configuration, memoize: true do
|
13
13
|
self[:defaults].add_loader(Etcher::Loaders::YAML.new(self[:xdg_config].active))
|
14
14
|
.then { |registry| Etcher.call registry }
|
15
15
|
end
|
16
16
|
|
17
|
-
register :defaults do
|
17
|
+
register :defaults, memoize: true do
|
18
18
|
Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
|
19
19
|
.add_loader(Etcher::Loaders::YAML.new(self[:defaults_path]))
|
20
20
|
end
|
21
21
|
|
22
|
-
register
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
register(:
|
22
|
+
register :specification, memoize: true do
|
23
|
+
Spek::Loader.call "#{__dir__}/<%= Array.new(2 + configuration.project_levels, "../").join %><%= configuration.project_name %>.gemspec"
|
24
|
+
end
|
25
|
+
|
26
|
+
register(:defaults_path, memoize: true) { Pathname(__dir__).join("configuration/defaults.yml") }
|
27
|
+
register(:xdg_config, memoize: true) { Runcom::Config.new "<%= configuration.project_path %>/configuration.yml" }
|
28
|
+
register(:logger, memoize: true) { Cogger.new formatter: :emoji }
|
29
|
+
register :kernel, Kernel
|
27
30
|
end
|
28
31
|
<% end %>
|
data/lib/gemsmith.rb
CHANGED
@@ -3,11 +3,14 @@
|
|
3
3
|
require "rubysmith"
|
4
4
|
require "zeitwerk"
|
5
5
|
|
6
|
-
Zeitwerk::Loader.
|
6
|
+
Zeitwerk::Loader.new.then do |loader|
|
7
7
|
loader.inflector.inflect "cli" => "CLI", "circle_ci" => "CircleCI", "rspec" => "RSpec"
|
8
|
+
loader.tag = File.basename __FILE__, ".rb"
|
9
|
+
loader.push_dir __dir__
|
8
10
|
loader.setup
|
9
11
|
end
|
10
12
|
|
11
13
|
# Main namespace.
|
12
14
|
module Gemsmith
|
15
|
+
def self.loader(registry = Zeitwerk::Registry) = registry.loader_for __FILE__
|
13
16
|
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: 20.
|
4
|
+
version: 20.4.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: 2023-
|
38
|
+
date: 2023-10-01 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: cogger
|
@@ -169,14 +169,14 @@ dependencies:
|
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '5.
|
172
|
+
version: '5.6'
|
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: '5.
|
179
|
+
version: '5.6'
|
180
180
|
- !ruby/object:Gem::Dependency
|
181
181
|
name: runcom
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
@@ -265,6 +265,7 @@ files:
|
|
265
265
|
- lib/gemsmith/builders/bundler.rb
|
266
266
|
- lib/gemsmith/builders/circle_ci.rb
|
267
267
|
- lib/gemsmith/builders/cli.rb
|
268
|
+
- lib/gemsmith/builders/console.rb
|
268
269
|
- lib/gemsmith/builders/documentation/readme.rb
|
269
270
|
- lib/gemsmith/builders/git/commit.rb
|
270
271
|
- lib/gemsmith/builders/git/ignore.rb
|
@@ -286,7 +287,6 @@ files:
|
|
286
287
|
- lib/gemsmith/templates/%project_name%/lib/%project_path%/configuration/defaults.yml.erb
|
287
288
|
- lib/gemsmith/templates/%project_name%/lib/%project_path%/configuration/model.rb.erb
|
288
289
|
- lib/gemsmith/templates/%project_name%/lib/%project_path%/container.rb.erb
|
289
|
-
- lib/gemsmith/templates/%project_name%/lib/%project_path%/identity.rb.erb
|
290
290
|
- lib/gemsmith/templates/%project_name%/lib/%project_path%/import.rb.erb
|
291
291
|
- lib/gemsmith/templates/%project_name%/spec/lib/%project_path%/cli/shell_spec.rb.erb
|
292
292
|
- lib/gemsmith/templates/%project_name%/spec/support/shared_contexts/application_dependencies.rb.erb
|
@@ -325,7 +325,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
325
325
|
- !ruby/object:Gem::Version
|
326
326
|
version: '0'
|
327
327
|
requirements: []
|
328
|
-
rubygems_version: 3.4.
|
328
|
+
rubygems_version: 3.4.20
|
329
329
|
signing_key:
|
330
330
|
specification_version: 4
|
331
331
|
summary: A command line interface for smithing Ruby gems.
|
metadata.gz.sig
CHANGED
Binary file
|