rubysmith 3.1.0 → 3.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: 76c37515f88d8baea764f0781f857dc37edf3fe5ae607957d04cc43bdabf5fa2
4
- data.tar.gz: a102d5287ac1ea8eeba349a7b9d394fb9b59e6ac844730881d4b5c40468204ac
3
+ metadata.gz: af5e128b0eecc4a5abb440c48eaafb891c07d9a9c903781fe52ffe4e95741a11
4
+ data.tar.gz: 8ab559515e0abe5b5018923c2894007fbe1bd72ec045e1d6949ad9b7c7d9dcfd
5
5
  SHA512:
6
- metadata.gz: 615396e6c2681e163103be22bc6e4ef5e2393786016ae5746b7323ff67e268e6d9b84c913a08f753c14c94930c1f6d277a33a78ad0357aa2ae5031ed36bf85e4
7
- data.tar.gz: 072c81c1253073b146900a243318c3e184d6b0722af9ac2082766e4ecc8c485caef660f39fda596e5faff33c64efcfe60dd243f7c2a6d297ea0ad28c87c7b784
6
+ metadata.gz: 3b6fd81f8f531caed7a4ba0cb4387fcc38a8092801f7377e66ec5cc0ddcbf590eba2ece69d4c3910e02e77c7801b45b4683192a75733ea6755b2bcc7f5987dce
7
+ data.tar.gz: 9673d78cc4d1d09144a6dc60df5166088635c493e23418095ad23916770a3ad9def5fee2c6df9a3b8d6b8f79391ea342084a752df290c0095bcfb171c3ab1ede
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
 
@@ -3,7 +3,7 @@ ruby File.read(".ruby-version").strip
3
3
  source "https://rubygems.org"
4
4
 
5
5
  <% if configuration.build_refinements %>
6
- gem "refinements", "~> 9.2"
6
+ gem "refinements", "~> 9.6"
7
7
  <% end %>
8
8
  <% if configuration.build_zeitwerk %>
9
9
  gem "zeitwerk", "~> 2.5"
@@ -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.7"
17
+ gem "caliber", "~> 0.11"
18
18
  <% end %>
19
19
  <% if configuration.build_git && configuration.build_git_lint %>
20
20
  gem "git-lint", "~> 4.0"
@@ -35,7 +35,7 @@ group :development do
35
35
  gem "rake", "~> 13.0"
36
36
  <% end %>
37
37
  <% if configuration.markdown? %>
38
- gem "tocer", "~> 13.2"
38
+ gem "tocer", "~> 14.2"
39
39
  <% end %>
40
40
  <% if configuration.build_yard %>
41
41
  gem "yard", "~> 0.9"
@@ -56,6 +56,6 @@ group :tools do
56
56
  gem "amazing_print", "~> 1.4"
57
57
  <% end %>
58
58
  <% if configuration.build_debug %>
59
- gem "debug", "~> 1.5"
59
+ gem "debug", "~> 1.6"
60
60
  <% end %>
61
61
  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 = "3.1.0"
5
+ spec.version = "3.4.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://github.com/bkuhlmann/rubysmith"
@@ -23,18 +23,18 @@ Gem::Specification.new do |spec|
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
25
  spec.required_ruby_version = "~> 3.1"
26
- spec.add_dependency "auto_injector", "~> 0.4"
27
- spec.add_dependency "cogger", "~> 0.0"
28
- spec.add_dependency "dry-container", "~> 0.9"
29
- spec.add_dependency "git_plus", "~> 1.3"
30
- spec.add_dependency "milestoner", "~> 14.0"
26
+ spec.add_dependency "auto_injector", "~> 0.6"
27
+ spec.add_dependency "cogger", "~> 0.2"
28
+ spec.add_dependency "dry-container", "~> 0.10"
29
+ spec.add_dependency "git_plus", "~> 1.4"
30
+ spec.add_dependency "milestoner", "~> 14.2"
31
31
  spec.add_dependency "pastel", "~> 0.8"
32
- spec.add_dependency "pragmater", "~> 11.0"
33
- spec.add_dependency "refinements", "~> 9.2"
34
- spec.add_dependency "rubocop", "~> 1.27"
35
- spec.add_dependency "runcom", "~> 8.2"
36
- spec.add_dependency "spek", "~> 0.2"
37
- spec.add_dependency "tocer", "~> 14.0"
32
+ spec.add_dependency "pragmater", "~> 11.2"
33
+ spec.add_dependency "refinements", "~> 9.6"
34
+ spec.add_dependency "rubocop", "~> 1.30"
35
+ spec.add_dependency "runcom", "~> 8.5"
36
+ spec.add_dependency "spek", "~> 0.4"
37
+ spec.add_dependency "tocer", "~> 14.2"
38
38
  spec.add_dependency "zeitwerk", "~> 2.5"
39
39
 
40
40
  spec.bindir = "exe"
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.1.0
4
+ version: 3.4.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-04-30 00:00:00.000000000 Z
31
+ date: 2022-07-17 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: auto_injector
@@ -36,70 +36,70 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.4'
39
+ version: '0.6'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.4'
46
+ version: '0.6'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: cogger
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.0'
53
+ version: '0.2'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.0'
60
+ version: '0.2'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: dry-container
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.9'
67
+ version: '0.10'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '0.9'
74
+ version: '0.10'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: git_plus
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.3'
81
+ version: '1.4'
82
82
  type: :runtime
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '1.3'
88
+ version: '1.4'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: milestoner
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '14.0'
95
+ version: '14.2'
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '14.0'
102
+ version: '14.2'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: pastel
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -120,84 +120,84 @@ dependencies:
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '11.0'
123
+ version: '11.2'
124
124
  type: :runtime
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '11.0'
130
+ version: '11.2'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: refinements
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '9.2'
137
+ version: '9.6'
138
138
  type: :runtime
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '9.2'
144
+ version: '9.6'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: rubocop
147
147
  requirement: !ruby/object:Gem::Requirement
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
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '8.2'
165
+ version: '8.5'
166
166
  type: :runtime
167
167
  prerelease: false
168
168
  version_requirements: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '8.2'
172
+ version: '8.5'
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: spek
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '0.2'
179
+ version: '0.4'
180
180
  type: :runtime
181
181
  prerelease: false
182
182
  version_requirements: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: '0.2'
186
+ version: '0.4'
187
187
  - !ruby/object:Gem::Dependency
188
188
  name: tocer
189
189
  requirement: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: '14.0'
193
+ version: '14.2'
194
194
  type: :runtime
195
195
  prerelease: false
196
196
  version_requirements: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: '14.0'
200
+ version: '14.2'
201
201
  - !ruby/object:Gem::Dependency
202
202
  name: zeitwerk
203
203
  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.12
333
+ rubygems_version: 3.3.18
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