gemsmith 18.1.0 → 18.3.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 +69 -12
- data/gemsmith.gemspec +8 -8
- data/lib/gemsmith/builders/specification.rb +2 -0
- data/lib/gemsmith/cli/actions/build.rb +12 -3
- data/lib/gemsmith/templates/%project_name%/%project_name%.gemspec.erb +22 -10
- data.tar.gz.sig +0 -0
- metadata +17 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 338623748228d9c9d9560b315ca568e01b2aa0e261f83215d3b55dc0eae22074
|
4
|
+
data.tar.gz: 07cc383d025d2dc06574fb6e5b5b9b6784bea87f8108387bcb6a0fff1e0c7599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb882950b11cb0b27a74e4ecffe3b48038b538a94fe02c4e5b68c5e501004b5e8439860efd6aba51dd634197d6062a7808daef84217b23bce83a961c14d2741b
|
7
|
+
data.tar.gz: 181b13d0cd991d906c4e92f4668ee0b2ca27aa47de3b84fefa1ecdf5d0a0dfeb1f5d64998d33ccd9221c2abc653def248508261f9907b0e09bb41f7ec9a38b2f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -25,15 +25,6 @@ toc::[]
|
|
25
25
|
. link:https://www.ruby-lang.org[Ruby].
|
26
26
|
. link:https://rubygems.org[RubyGems].
|
27
27
|
|
28
|
-
== Setup
|
29
|
-
|
30
|
-
To install, run:
|
31
|
-
|
32
|
-
[source,bash]
|
33
|
-
----
|
34
|
-
gem install gemsmith
|
35
|
-
----
|
36
|
-
|
37
28
|
== Upgrade
|
38
29
|
|
39
30
|
If upgrading from 17.0.0 to 18.0.0, you'll want to be aware of the following changes:
|
@@ -43,6 +34,15 @@ If upgrading from 17.0.0 to 18.0.0, you'll want to be aware of the following cha
|
|
43
34
|
ability to sign tags has been removed (this happens dynamically based on your Git configuration
|
44
35
|
which gives you more flexibility).
|
45
36
|
|
37
|
+
== Setup
|
38
|
+
|
39
|
+
To install, run:
|
40
|
+
|
41
|
+
[source,bash]
|
42
|
+
----
|
43
|
+
gem install gemsmith
|
44
|
+
----
|
45
|
+
|
46
46
|
== Usage
|
47
47
|
|
48
48
|
=== Command Line Interface (CLI)
|
@@ -222,6 +222,20 @@ the following:
|
|
222
222
|
Feel free to take the combined Rubysmith + Gemsmith configuration, modify, and save as your own
|
223
223
|
custom `configuration.yml`.
|
224
224
|
|
225
|
+
It is recommended that you provide URLs for your project which would be all keys found in this
|
226
|
+
section:
|
227
|
+
|
228
|
+
[source,yaml]
|
229
|
+
----
|
230
|
+
:project:
|
231
|
+
:url:
|
232
|
+
# Add sub-key values here.
|
233
|
+
----
|
234
|
+
|
235
|
+
When these values exist, you'll benefit from having this information added to your generated
|
236
|
+
`gemspec` and project documentation. Otherwise -- if these values are empty -- they are removed from
|
237
|
+
new gem generation.
|
238
|
+
|
225
239
|
=== Workflows
|
226
240
|
|
227
241
|
When building/testing your gem locally, a typical workflow is:
|
@@ -324,7 +338,7 @@ specification and RubyGems credentials.
|
|
324
338
|
|
325
339
|
=== Gem Specification Metadata
|
326
340
|
|
327
|
-
Add the following metadata to your
|
341
|
+
Add the following gemspec metadata to privately publish new versions of your gem:
|
328
342
|
|
329
343
|
[source,ruby]
|
330
344
|
----
|
@@ -365,10 +379,10 @@ to our private server. This is important because this is how we link our gem spe
|
|
365
379
|
to our private credentials. To illustrate further, here are both files truncated and shown together:
|
366
380
|
|
367
381
|
....
|
368
|
-
# Gem
|
382
|
+
# Gem Specification: The metadata which defines the private host to publish to.
|
369
383
|
spec.metadata = {"allowed_push_host" => "https://private.example.com"}
|
370
384
|
|
371
|
-
# Gem
|
385
|
+
# Gem Credentials: The URL value -- shown above -- which becomes the key for enabling authentication.
|
372
386
|
https://private.example.com: Basic dXNlcjpwYXNzd29yZA==
|
373
387
|
....
|
374
388
|
|
@@ -397,6 +411,49 @@ Lastly, should you need to delete a credential (due to a bad login/password for
|
|
397
411
|
open the `$HOME/.gem/credentials` in your default editor and remove the line(s) you don't need. Upon
|
398
412
|
next publish of your gem, you'll be prompted for the missing credentials.
|
399
413
|
|
414
|
+
=== Bundler Configuration
|
415
|
+
|
416
|
+
So far, I've shown how to privately _publish_ a gem but now we need to teach Bundler how to install
|
417
|
+
the gem as dependency within your upstream project. For demonstration purposes, I'm going to assume
|
418
|
+
you are using GitHub Packages as your private gem server. You should be able to quickly translate
|
419
|
+
this documentation if using an alternate private gem server, though.
|
420
|
+
|
421
|
+
The first step is to create your own GitHub Personal Access Token (PAT) which is fast to do by
|
422
|
+
following GitHub's own
|
423
|
+
link:https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token[documentation].
|
424
|
+
At a minimum, you'll need to enable _repo_ and _packages_ scopes with read/write access.
|
425
|
+
|
426
|
+
With your PAT in hand, you'll need to ensure link:https://bundler.io[Bundler] can authenticate to
|
427
|
+
the private GitHub Packages gem server by running the following:
|
428
|
+
|
429
|
+
[source,bash]
|
430
|
+
----
|
431
|
+
bundle config set --global rubygems.pkg.github.com <your GitHub handle>:<PAT>
|
432
|
+
# Example: bundle config set --global rubygems.pkg.github.com jdoe:ghp_c5b8d394abefebbf45c7b27b379c74978923
|
433
|
+
----
|
434
|
+
|
435
|
+
💡 Using Bundler's `--global` flag ensures you only have to define these credentials once for _all_
|
436
|
+
projects which reduces maintenance burden on you. The path to this global configuration can be found
|
437
|
+
here: `$HOME/.config/bundler/configuration.yml`.
|
438
|
+
|
439
|
+
Lastly, you can add this gem to your `Gemfile` as follows:
|
440
|
+
|
441
|
+
[source,ruby]
|
442
|
+
----
|
443
|
+
source "https://rubygems.pkg.github.com/alchemists" do
|
444
|
+
gem "demo", "~> 0.0"
|
445
|
+
end
|
446
|
+
----
|
447
|
+
|
448
|
+
At this point -- if you run `bundle install` -- you should see the following in your console:
|
449
|
+
|
450
|
+
....
|
451
|
+
Fetching gem metadata from https://rubygems.pkg.github.com/alchemists/...
|
452
|
+
Resolving dependencies...Fetching gem metadata from https://rubygems.org/.....
|
453
|
+
....
|
454
|
+
|
455
|
+
If so, you're all set!
|
456
|
+
|
400
457
|
=== GitHub Actions/Packages Automation
|
401
458
|
|
402
459
|
Earlier, I hinted at using GitHub Packages but what if you could automate the entire publishing
|
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 = "18.
|
5
|
+
spec.version = "18.3.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://www.alchemists.io/projects/gemsmith"
|
@@ -23,16 +23,16 @@ 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.
|
27
|
-
spec.add_dependency "cogger", "~> 0.
|
26
|
+
spec.add_dependency "auto_injector", "~> 0.5"
|
27
|
+
spec.add_dependency "cogger", "~> 0.1"
|
28
28
|
spec.add_dependency "dry-container", "~> 0.9"
|
29
29
|
spec.add_dependency "dry-monads", "~> 1.4"
|
30
30
|
spec.add_dependency "milestoner", "~> 14.0"
|
31
|
-
spec.add_dependency "refinements", "~> 9.
|
32
|
-
spec.add_dependency "rubysmith", "~> 3.
|
33
|
-
spec.add_dependency "runcom", "~> 8.
|
34
|
-
spec.add_dependency "spek", "~> 0.
|
35
|
-
spec.add_dependency "versionaire", "~> 10.
|
31
|
+
spec.add_dependency "refinements", "~> 9.4"
|
32
|
+
spec.add_dependency "rubysmith", "~> 3.3"
|
33
|
+
spec.add_dependency "runcom", "~> 8.4"
|
34
|
+
spec.add_dependency "spek", "~> 0.3"
|
35
|
+
spec.add_dependency "versionaire", "~> 10.3"
|
36
36
|
spec.add_dependency "zeitwerk", "~> 2.5"
|
37
37
|
|
38
38
|
spec.bindir = "exe"
|
@@ -5,6 +5,8 @@ module Gemsmith
|
|
5
5
|
module Actions
|
6
6
|
# Handles the build action.
|
7
7
|
class Build
|
8
|
+
include Gemsmith::Import[:logger]
|
9
|
+
|
8
10
|
# Order is important.
|
9
11
|
BUILDERS = [
|
10
12
|
Rubysmith::Builders::Core,
|
@@ -40,15 +42,22 @@ module Gemsmith
|
|
40
42
|
Builders::Git::Commit
|
41
43
|
].freeze
|
42
44
|
|
43
|
-
def initialize builders: BUILDERS
|
45
|
+
def initialize builders: BUILDERS, **dependencies
|
46
|
+
super(**dependencies)
|
44
47
|
@builders = builders
|
45
48
|
end
|
46
49
|
|
47
|
-
def call
|
50
|
+
def call configuration
|
51
|
+
log_info "Building project skeleton: #{configuration.project_name}..."
|
52
|
+
builders.each { |builder| builder.call configuration }
|
53
|
+
log_info "Project skeleton complete!"
|
54
|
+
end
|
48
55
|
|
49
56
|
private
|
50
57
|
|
51
|
-
attr_reader :
|
58
|
+
attr_reader :builders
|
59
|
+
|
60
|
+
def log_info(message) = logger.info { message }
|
52
61
|
end
|
53
62
|
end
|
54
63
|
end
|
@@ -8,13 +8,25 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.license = "<%= configuration.license_label_version %>"
|
9
9
|
|
10
10
|
spec.metadata = {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
<% unless configuration.computed_project_url_issues.empty? %>
|
12
|
+
"bug_tracker_uri" => "<%= configuration.computed_project_url_issues %>",
|
13
|
+
<% end %>
|
14
|
+
<% unless configuration.computed_project_url_versions.empty? %>
|
15
|
+
"changelog_uri" => "<%= configuration.computed_project_url_versions %>",
|
16
|
+
<% end %>
|
17
|
+
<% unless configuration.computed_project_url_home.empty? %>
|
18
|
+
"documentation_uri" => "<%= configuration.computed_project_url_home %>",
|
19
|
+
<% end %>
|
20
|
+
<% unless configuration.computed_project_url_funding.empty? %>
|
21
|
+
"funding_uri" => "<%= configuration.computed_project_url_funding %>",
|
22
|
+
<% end %>
|
15
23
|
"label" => "<%= configuration.project_label %>",
|
16
|
-
|
17
|
-
|
24
|
+
<% if configuration.computed_project_url_source.empty? %>
|
25
|
+
"rubygems_mfa_required" => "true"
|
26
|
+
<% else %>
|
27
|
+
"rubygems_mfa_required" => "true",
|
28
|
+
"source_code_uri" => "<%= configuration.computed_project_url_source %>"
|
29
|
+
<% end %>
|
18
30
|
}
|
19
31
|
|
20
32
|
<% if configuration.build_security %>
|
@@ -24,19 +36,19 @@ Gem::Specification.new do |spec|
|
|
24
36
|
|
25
37
|
spec.required_ruby_version = "~> <%= RUBY_VERSION[/\d+\.\d+/] %>"
|
26
38
|
<% if configuration.build_cli %>
|
27
|
-
spec.add_dependency "auto_injector", "~> 0.
|
39
|
+
spec.add_dependency "auto_injector", "~> 0.5"
|
28
40
|
<% end %>
|
29
41
|
<% if configuration.build_cli %>
|
30
42
|
spec.add_dependency "dry-container", "~> 0.9"
|
31
43
|
<% end %>
|
32
44
|
<% if configuration.build_refinements %>
|
33
|
-
spec.add_dependency "refinements", "~> 9.
|
45
|
+
spec.add_dependency "refinements", "~> 9.4"
|
34
46
|
<% end %>
|
35
47
|
<% if configuration.build_cli %>
|
36
|
-
spec.add_dependency "runcom", "~> 8.
|
48
|
+
spec.add_dependency "runcom", "~> 8.4"
|
37
49
|
<% end %>
|
38
50
|
<% if configuration.build_cli %>
|
39
|
-
spec.add_dependency "spek", "~> 0.
|
51
|
+
spec.add_dependency "spek", "~> 0.3"
|
40
52
|
<% end %>
|
41
53
|
<% if configuration.build_zeitwerk %>
|
42
54
|
spec.add_dependency "zeitwerk", "~> 2.5"
|
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: 18.
|
4
|
+
version: 18.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-
|
31
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: auto_injector
|
@@ -36,28 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0.
|
39
|
+
version: '0.5'
|
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.
|
46
|
+
version: '0.5'
|
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.
|
53
|
+
version: '0.1'
|
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.
|
60
|
+
version: '0.1'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: dry-container
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,70 +106,70 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - "~>"
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '9.
|
109
|
+
version: '9.4'
|
110
110
|
type: :runtime
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - "~>"
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '9.
|
116
|
+
version: '9.4'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: rubysmith
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: '3.
|
123
|
+
version: '3.3'
|
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: '3.
|
130
|
+
version: '3.3'
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: runcom
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '8.
|
137
|
+
version: '8.4'
|
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: '8.
|
144
|
+
version: '8.4'
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: spek
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|
148
148
|
requirements:
|
149
149
|
- - "~>"
|
150
150
|
- !ruby/object:Gem::Version
|
151
|
-
version: '0.
|
151
|
+
version: '0.3'
|
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: '0.
|
158
|
+
version: '0.3'
|
159
159
|
- !ruby/object:Gem::Dependency
|
160
160
|
name: versionaire
|
161
161
|
requirement: !ruby/object:Gem::Requirement
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '10.
|
165
|
+
version: '10.3'
|
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: '10.
|
172
|
+
version: '10.3'
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: zeitwerk
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
@@ -280,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
280
280
|
- !ruby/object:Gem::Version
|
281
281
|
version: '0'
|
282
282
|
requirements: []
|
283
|
-
rubygems_version: 3.3.
|
283
|
+
rubygems_version: 3.3.14
|
284
284
|
signing_key:
|
285
285
|
specification_version: 4
|
286
286
|
summary: A command line interface for smithing Ruby gems.
|
metadata.gz.sig
CHANGED
Binary file
|