rubysmith 3.2.0 → 3.3.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: c8dc110fe2e5b1c72b839dd71c67d89ed5468d277a566672f6bfa9fa3e865d13
4
- data.tar.gz: b88ecf8ad58db97af2b32075e44fe66c40be163dfabeef0982f33e94e973ff1a
3
+ metadata.gz: 8782be480f3bd0158ed695d554cc914848c84184522b56592ea7a9502d0cb08b
4
+ data.tar.gz: 433862359a53831ab86bfa749058c0a354e3f60beae94fbce701cefdb1239a87
5
5
  SHA512:
6
- metadata.gz: 73391d28a37c044162526fb7582bea272016931f95ca354b6d9f26ccfb55a92fd64192342b3deebd1ab2accaf820bd6bf823d1babc335064673d1881b0d760fe
7
- data.tar.gz: 5a73e1d1b7e56aff92b77c6ecd1c13961674c316ab30e63bbe1818412262dd4dbc3d2181f5f2f3f1c48528f2b9c36113ad90f9f58cd9e90926c9ba0b86b1c900
6
+ metadata.gz: e6cc4230cdbe3ebdd878d18ccb22b7d52d67988808c068d6dcc927a2bf5d635d674a0fda503a28b08a146278780843421a20847189a5e7511080e60c136be697
7
+ data.tar.gz: 40b490e0db3497120660c4916a3f66453be792b687e595dc275671ddb93e7561aec0856af9e67a73dfac8b4d460e508d145ffab02211750009697bac328543c5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -22,49 +22,49 @@ module Rubysmith
22
22
  end
23
23
 
24
24
  def append content
25
- logger.info "Appending: #{relative_build_path}"
25
+ log_debug "Appending: #{relative_build_path}"
26
26
  build_path.rewrite { |body| body + content }
27
27
  self
28
28
  end
29
29
 
30
30
  def delete
31
- logger.info "Deleting: #{relative_build_path}"
31
+ log_debug "Deleting: #{relative_build_path}"
32
32
  build_path.delete
33
33
  self
34
34
  end
35
35
 
36
36
  def insert_before pattern, content
37
- logger.info "Inserting content before pattern in: #{relative_build_path}"
37
+ log_debug "Inserting content before pattern in: #{relative_build_path}"
38
38
  build_path.write inserter.new(build_path.readlines, :before).call(content, pattern).join
39
39
  self
40
40
  end
41
41
 
42
42
  def insert_after pattern, content
43
- logger.info "Inserting content after pattern in: #{relative_build_path}"
43
+ log_debug "Inserting content after pattern in: #{relative_build_path}"
44
44
  build_path.write inserter.new(build_path.readlines, :after).call(content, pattern).join
45
45
  self
46
46
  end
47
47
 
48
48
  def permit mode
49
- logger.info "Changing permissions for: #{relative_build_path}"
49
+ log_debug "Changing permissions for: #{relative_build_path}"
50
50
  build_path.chmod mode
51
51
  self
52
52
  end
53
53
 
54
54
  def prepend content
55
- logger.info "Prepending content to: #{relative_build_path}"
55
+ log_debug "Prepending content to: #{relative_build_path}"
56
56
  build_path.rewrite { |body| content + body }
57
57
  self
58
58
  end
59
59
 
60
60
  def rename name
61
- logger.info "Renaming: #{build_path.basename} to #{name}"
61
+ log_debug "Renaming: #{build_path.basename} to #{name}"
62
62
  build_path.rename build_path.parent.join(name)
63
63
  self
64
64
  end
65
65
 
66
66
  def render
67
- logger.info "Rendering: #{relative_build_path}"
67
+ log_debug "Rendering: #{relative_build_path}"
68
68
 
69
69
  pathway.start_path.read.then do |content|
70
70
  build_path.make_ancestors.write renderer.call(content)
@@ -74,21 +74,21 @@ module Rubysmith
74
74
  end
75
75
 
76
76
  def replace pattern, content
77
- logger.info "Replacing content for patterns in: #{relative_build_path}"
77
+ log_debug "Replacing content for patterns in: #{relative_build_path}"
78
78
  build_path.rewrite { |body| body.gsub pattern, content }
79
79
  self
80
80
  end
81
81
 
82
82
  def run *command
83
- logger.info "Running: #{command}"
83
+ log_debug "Running: #{command}"
84
84
  execute(*command)
85
85
  self
86
86
  rescue StandardError => error
87
- logger.error error and self
87
+ log_error error and self
88
88
  end
89
89
 
90
90
  def touch
91
- logger.info "Touching: #{relative_build_path}"
91
+ log_debug "Touching: #{relative_build_path}"
92
92
  build_path.deep_touch
93
93
  self
94
94
  end
@@ -99,7 +99,7 @@ module Rubysmith
99
99
 
100
100
  def execute *command
101
101
  kernel.capture2e(*command).then do |result, status|
102
- logger.error result unless status.success?
102
+ log_error result unless status.success?
103
103
  end
104
104
  end
105
105
 
@@ -119,5 +119,9 @@ module Rubysmith
119
119
  end
120
120
 
121
121
  def pathway = configuration.pathway
122
+
123
+ def log_debug(message) = logger.debug { message }
124
+
125
+ def log_error(message) = logger.error { message }
122
126
  end
123
127
  end
@@ -5,9 +5,13 @@ module Rubysmith
5
5
  module Git
6
6
  # Builds project skeleton initial Git commit message.
7
7
  class Commit
8
+ include Import[:specification]
9
+
8
10
  def self.call(...) = new(...).call
9
11
 
10
- def initialize configuration, builder: Builder
12
+ def initialize configuration, builder: Builder, **dependencies
13
+ super(**dependencies)
14
+
11
15
  @configuration = configuration
12
16
  @builder = builder
13
17
  end
@@ -31,8 +35,8 @@ module Rubysmith
31
35
 
32
36
  def body
33
37
  <<~CONTENT
34
- Generated with [Rubysmith](https://www.alchemists.io/projects/rubysmith)
35
- 1.1.1.
38
+ Generated with [#{specification.label}](#{specification.homepage_url})
39
+ #{specification.version}.
36
40
  CONTENT
37
41
  end
38
42
 
@@ -5,6 +5,8 @@ module Rubysmith
5
5
  module Actions
6
6
  # Handles the build action.
7
7
  class Build
8
+ include Rubysmith::Import[:logger]
9
+
8
10
  # Order is important.
9
11
  BUILDERS = [
10
12
  Builders::Core,
@@ -33,15 +35,22 @@ module Rubysmith
33
35
  Builders::Git::Commit
34
36
  ].freeze
35
37
 
36
- def initialize builders: BUILDERS
38
+ def initialize builders: BUILDERS, **dependencies
39
+ super(**dependencies)
37
40
  @builders = builders
38
41
  end
39
42
 
40
- def call(configuration) = builders.each { |builder| builder.call configuration }
43
+ def call configuration
44
+ log_info "Building project skeleton: #{configuration.project_name}..."
45
+ builders.each { |builder| builder.call configuration }
46
+ log_info "Project skeleton complete!"
47
+ end
41
48
 
42
49
  private
43
50
 
44
- attr_reader :configuration, :builders
51
+ attr_reader :builders
52
+
53
+ def log_info(message) = logger.info { message }
45
54
  end
46
55
  end
47
56
  end
@@ -17,7 +17,7 @@ module Rubysmith
17
17
  end
18
18
 
19
19
  def call
20
- STDOUT.squelch { client.run ["--auto-correct", configuration.project_root.to_s] }
20
+ STDOUT.squelch { client.run ["--autocorrect", configuration.project_root.to_s] }
21
21
  configuration
22
22
  end
23
23
 
@@ -14,7 +14,7 @@ group :code_quality do
14
14
  gem "bundler-leak", "~> 0.2"
15
15
  <% end %>
16
16
  <% if configuration.build_caliber %>
17
- gem "caliber", "~> 0.8"
17
+ gem "caliber", "~> 0.9"
18
18
  <% end %>
19
19
  <% if configuration.build_git && configuration.build_git_lint %>
20
20
  gem "git-lint", "~> 4.0"
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 = "3.2.0"
5
+ spec.version = "3.3.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://github.com/bkuhlmann/rubysmith"
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "pastel", "~> 0.8"
32
32
  spec.add_dependency "pragmater", "~> 11.1"
33
33
  spec.add_dependency "refinements", "~> 9.4"
34
- spec.add_dependency "rubocop", "~> 1.27"
34
+ spec.add_dependency "rubocop", "~> 1.30"
35
35
  spec.add_dependency "runcom", "~> 8.4"
36
36
  spec.add_dependency "spek", "~> 0.3"
37
37
  spec.add_dependency "tocer", "~> 14.1"
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: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
29
29
  RFE=
30
30
  -----END CERTIFICATE-----
31
- date: 2022-05-07 00:00:00.000000000 Z
31
+ date: 2022-05-28 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: auto_injector
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '1.27'
151
+ version: '1.30'
152
152
  type: :runtime
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '1.27'
158
+ version: '1.30'
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: runcom
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -330,7 +330,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
330
330
  - !ruby/object:Gem::Version
331
331
  version: '0'
332
332
  requirements: []
333
- rubygems_version: 3.3.13
333
+ rubygems_version: 3.3.14
334
334
  signing_key:
335
335
  specification_version: 4
336
336
  summary: A command line interface for smithing Ruby projects.
metadata.gz.sig CHANGED
Binary file