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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 509e89d73fd8509ffc81cb2aa4b6725595a5107c556f37ca4bf5cbf093f2f46e
4
- data.tar.gz: 92480590fd323605bc379a4655ec59040801e7d8634050a045a719c58e2845ea
3
+ metadata.gz: f624aae829daa2768b30f6539c2482f53677d2ea1f03ef878d45a114363108b6
4
+ data.tar.gz: cf95d4706fcef72a6a36a00e9f6ac4b658d8e4c5682fd167017755173814f7e6
5
5
  SHA512:
6
- metadata.gz: 6a60cae602f76629871fc04f7791849a1110d69d3cb4e5fdba43b031a9e1aa6e7d5d7bb56bce7e73bc66e0fda392b6abc2edc8d5cfc5e3cd2a1ec463bba99427
7
- data.tar.gz: 52aa0a96df73218283b76b84c391acbb6dfc53b3174545b841819fbc878ae178e2df06f63b314b0ca04bbacab60cf6b80a3dffdff9178c97ef2ded6b93f68db9
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
@@ -3,4 +3,4 @@
3
3
 
4
4
  require "gemsmith"
5
5
 
6
- Gemsmith::CLI::Shell.new.call ARGV
6
+ Gemsmith::CLI::Shell.new.call
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.2.1"
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.3"
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
- .insert_after(/push_dir/, %( loader.inflector.inflect "cli" => "CLI"\n))
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
@@ -28,7 +28,7 @@ module Gemsmith
28
28
  Builders::Bundler,
29
29
  Builders::CLI,
30
30
  Rubysmith::Builders::Rake,
31
- Rubysmith::Builders::Console,
31
+ Builders::Console,
32
32
  Rubysmith::Builders::CircleCI,
33
33
  Builders::CircleCI,
34
34
  Rubysmith::Builders::Setup,
@@ -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(:executor) { Open3 }
44
- register(:kernel) { Kernel }
45
- register(:logger) { Cogger.new formatter: :emoji }
46
+ register(:logger, memoize: true) { Cogger.new formatter: :emoji }
47
+ register :executor, Open3
48
+ register :kernel, Kernel
46
49
  end
47
50
  end
@@ -1,5 +1,5 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require "<%= configuration.project_name %>"
3
+ require "<%= configuration.project_path %>"
4
4
 
5
- <%= configuration.project_namespaced_class %>::CLI::Shell.new.call ARGV
5
+ <%= configuration.project_namespaced_class %>::CLI::Shell.new.call
@@ -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(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
23
- register(:xdg_config) { Runcom::Config.new "<%= configuration.project_path %>/configuration.yml" }
24
- register(:specification) { Spek::Loader.call "#{__dir__}/<%= Array.new(2 + configuration.project_levels, "../").join %><%= configuration.project_name %>.gemspec" }
25
- register(:kernel) { Kernel }
26
- register(:logger) { Cogger.new formatter: :emoji }
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.for_gem.then do |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.2.1
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-06-23 00:00:00.000000000 Z
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.3'
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.3'
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.14
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
@@ -1,9 +0,0 @@
1
- <% render_namespace do %>
2
- # Gem identity information.
3
- module Identity
4
- NAME = "<%= config.dig(:gem, :name) %>"
5
- LABEL = "<%= config.dig(:gem, :label) %>"
6
- VERSION = "0.1.0"
7
- VERSION_LABEL = "#{LABEL} #{VERSION}".freeze
8
- end
9
- <% end %>