rubysmith 5.3.0 → 5.5.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: cc23eb9d3a6f0e1d1d06c596462a9c8622b921d51b637890fdd37fc4141b30d7
4
- data.tar.gz: 67da0c327b758738432249bb9f061c76ed5c7db30697d81bbd66cde1502b354f
3
+ metadata.gz: 0ca1a2ed0fc35e9412dd6a42f5c672fb17d9f1368ed3f7bb2e8e95368c22049a
4
+ data.tar.gz: bcf8e3c7961409f94ddfcb999a172d367549a06cb31582c9f5add5fa0a95d61f
5
5
  SHA512:
6
- metadata.gz: 252f2eaf5a0e6c6c5c73173ad3a1e8cec42e15f87ed6791f40433cd5daf066039e4971bed9bde24af7d71fd815b82c4becb9fb61a44c85e87b0ecb0be63e5631
7
- data.tar.gz: 3ed51c609c79770c5e080400a89464ea1a517e5c2278c190ecd32b9ae7fcebbc025a545856327a889fd809d8c921cca2fb8b52132da72c00b0652701a96eb506
6
+ metadata.gz: 52f70332376f6cc8ac82012a81a5edd0303ea14e1fb9d1013786752c50510b3bd8ac19faf4c442a5e77dc5b08c3a84517dc5be0d38dda29098d4160e4c0cb4de
7
+ data.tar.gz: 70970bc7a922c0af0b85a46a8909c9db6be75db024de7a2a4b1909b89bca695830aa5afd9bfec3127fbd3c4c9dced64869ccbb74e5a9a56c7fb8dc2d19855140
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -76,21 +76,7 @@ gem install rubysmith
76
76
 
77
77
  From the command line, type: `rubysmith --help`
78
78
 
79
- ....
80
- USAGE
81
- rubysmith [OPTIONS]
82
- rubysmith COMMAND [OPTIONS]
83
-
84
- OPTIONS
85
- -p, --publish VERSION Publish project.
86
- -v, --version Show version.
87
- -h, --help [COMMAND] Show this message.
88
-
89
- COMMANDS
90
- config Manage configuration.
91
- Path is dynamic per current directory.
92
- build Build new project.
93
- ....
79
+ image:https://alchemists.io/images/projects/rubysmith/screenshots/usage.png[Usage,width=588,height=345,role=focal_point]
94
80
 
95
81
  ==== Build
96
82
 
data/exe/rubysmith CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  require "rubysmith"
5
5
 
6
- Rubysmith::CLI::Shell.new.call ARGV
6
+ Rubysmith::CLI::Shell.new.call
@@ -33,7 +33,7 @@ module Rubysmith
33
33
  attr_reader :configuration, :builder
34
34
 
35
35
  def body
36
- "Generated with [#{specification.label}](#{specification.homepage_url}) " \
36
+ "Generated with link:#{specification.homepage_url}[#{specification.label}] " \
37
37
  "#{specification.version}."
38
38
  end
39
39
 
@@ -79,11 +79,6 @@ module Rubysmith
79
79
  using Refinements::Strings
80
80
  using Refinements::Structs
81
81
 
82
- def initialize(**)
83
- super
84
- freeze
85
- end
86
-
87
82
  def maximize = update_build_options true
88
83
 
89
84
  def minimize = update_build_options false
@@ -8,9 +8,9 @@ module Rubysmith
8
8
  module Transformers
9
9
  include Dry::Monads[:result]
10
10
 
11
- CurrentTime = lambda do |content, at: Time.now|
12
- content.fetch(:now) { at }
13
- .then { |now| content.merge! now: }
11
+ CurrentTime = lambda do |content, key = :now, at: Time.now|
12
+ content.fetch(key) { at }
13
+ .then { |value| content.merge! key => value }
14
14
  .then { |updated_content| Dry::Monads::Success updated_content }
15
15
  end
16
16
  end
@@ -10,13 +10,20 @@ module Rubysmith
10
10
  include Import[:git]
11
11
  include Dry::Monads[:result]
12
12
 
13
- def call(content) = content[:author_email] ? Success(content) : email_or(content)
13
+ def initialize(key = :author_email, **)
14
+ @key = key
15
+ super(**)
16
+ end
17
+
18
+ def call(content) = content[key] ? Success(content) : email_or(content)
14
19
 
15
20
  private
16
21
 
22
+ attr_reader :key
23
+
17
24
  def email_or content
18
25
  git.get("user.email", nil)
19
- .fmap { |email| email ? content.merge!(author_email: email) : content }
26
+ .fmap { |value| value ? content.merge!(key => value) : content }
20
27
  .or { Success content }
21
28
  end
22
29
  end
@@ -10,13 +10,20 @@ module Rubysmith
10
10
  include Import[:git]
11
11
  include Dry::Monads[:result]
12
12
 
13
- def call(content) = content[:git_hub_user] ? Success(content) : user_or(content)
13
+ def initialize(key = :git_hub_user, **)
14
+ @key = key
15
+ super(**)
16
+ end
17
+
18
+ def call(content) = content[key] ? Success(content) : user_or(content)
14
19
 
15
20
  private
16
21
 
22
+ attr_reader :key
23
+
17
24
  def user_or content
18
25
  git.get("github.user", nil)
19
- .fmap { |user| user ? content.merge!(git_hub_user: user) : content }
26
+ .fmap { |value| value ? content.merge!(key => value) : content }
20
27
  .or { Success content }
21
28
  end
22
29
  end
@@ -8,9 +8,9 @@ module Rubysmith
8
8
  module Transformers
9
9
  include Dry::Monads[:result]
10
10
 
11
- TargetRoot = lambda do |content, path: Pathname.pwd|
11
+ TargetRoot = lambda do |content, key = :target_root, path: Pathname.pwd|
12
12
  content.fetch(:target_root) { path }
13
- .then { |root| content.merge! target_root: root }
13
+ .then { |value| content.merge! key => value }
14
14
  .then { |updated_content| Dry::Monads::Success updated_content }
15
15
  end
16
16
  end
@@ -12,20 +12,21 @@ module Rubysmith
12
12
 
13
13
  using Refinements::Arrays
14
14
 
15
- def initialize default = Pathname(__dir__).join("../../templates")
15
+ def initialize key = :template_roots, default: Pathname(__dir__).join("../../templates")
16
+ @key = key
16
17
  @default = default
17
18
  end
18
19
 
19
20
  def call content
20
21
  Array(default).map { |path| Pathname path }
21
- .including(content[:template_roots])
22
+ .including(content[key])
22
23
  .compact
23
- .then { |paths| Success content.merge!(template_roots: paths) }
24
+ .then { |value| Success content.merge!(key => value) }
24
25
  end
25
26
 
26
27
  private
27
28
 
28
- attr_reader :default
29
+ attr_reader :key, :default
29
30
  end
30
31
  end
31
32
  end
@@ -12,12 +12,12 @@ module Rubysmith
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
  Etcher::Registry.new(contract: Configuration::Contract, model: Configuration::Model)
22
22
  .add_loader(Etcher::Loaders::YAML.new(self[:defaults_path]))
23
23
  .add_transformer(Configuration::Transformers::CurrentTime)
@@ -28,12 +28,15 @@ module Rubysmith
28
28
  .add_transformer(Configuration::Transformers::TargetRoot)
29
29
  end
30
30
 
31
+ register :specification, memoize: true do
32
+ Spek::Loader.call "#{__dir__}/../../rubysmith.gemspec"
33
+ end
34
+
31
35
  register(:input, memoize: true) { self[:configuration].dup }
32
- register(:defaults_path) { Pathname(__dir__).join("configuration/defaults.yml") }
33
- register(:xdg_config) { Runcom::Config.new "rubysmith/configuration.yml" }
34
- register(:specification) { Spek::Loader.call "#{__dir__}/../../rubysmith.gemspec" }
35
- register(:git) { Gitt::Repository.new }
36
- register(:kernel) { Kernel }
37
- register(:logger) { Cogger.new formatter: :emoji }
36
+ register(:defaults_path, memoize: true) { Pathname(__dir__).join("configuration/defaults.yml") }
37
+ register(:xdg_config, memoize: true) { Runcom::Config.new "rubysmith/configuration.yml" }
38
+ register(:git, memoize: true) { Gitt::Repository.new }
39
+ register(:logger, memoize: true) { Cogger.new formatter: :emoji }
40
+ register :kernel, Kernel
38
41
  end
39
42
  end
data/rubysmith.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "rubysmith"
5
- spec.version = "5.3.0"
5
+ spec.version = "5.5.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://github.com/bkuhlmann/rubysmith"
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_dependency "milestoner", "~> 16.0"
34
34
  spec.add_dependency "pragmater", "~> 13.0"
35
35
  spec.add_dependency "refinements", "~> 11.0"
36
- spec.add_dependency "rubocop", "~> 1.52"
36
+ spec.add_dependency "rubocop", "~> 1.55"
37
37
  spec.add_dependency "runcom", "~> 10.0"
38
38
  spec.add_dependency "sod", "~> 0.0"
39
39
  spec.add_dependency "spek", "~> 2.0"
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.3.0
4
+ version: 5.5.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-22 00:00:00.000000000 Z
38
+ date: 2023-07-29 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -183,14 +183,14 @@ dependencies:
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: '1.52'
186
+ version: '1.55'
187
187
  type: :runtime
188
188
  prerelease: false
189
189
  version_requirements: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: '1.52'
193
+ version: '1.55'
194
194
  - !ruby/object:Gem::Dependency
195
195
  name: runcom
196
196
  requirement: !ruby/object:Gem::Requirement
@@ -426,7 +426,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
426
426
  - !ruby/object:Gem::Version
427
427
  version: '0'
428
428
  requirements: []
429
- rubygems_version: 3.4.14
429
+ rubygems_version: 3.4.17
430
430
  signing_key:
431
431
  specification_version: 4
432
432
  summary: A command line interface for smithing Ruby projects.
metadata.gz.sig CHANGED
Binary file