gemsmith 14.2.0 → 14.7.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 +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/README.adoc +7 -6
- data/bin/gemsmith +3 -0
- data/lib/gemsmith/cli.rb +0 -2
- data/lib/gemsmith/gem/specification.rb +2 -2
- data/lib/gemsmith/generators/bundler_audit.rb +3 -3
- data/lib/gemsmith/generators/git_lint.rb +2 -2
- data/lib/gemsmith/generators/pragma.rb +12 -5
- data/lib/gemsmith/generators/reek.rb +6 -5
- data/lib/gemsmith/generators/rspec.rb +8 -7
- data/lib/gemsmith/generators/rubocop.rb +7 -6
- data/lib/gemsmith/identity.rb +1 -1
- data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +2 -2
- data/lib/gemsmith/templates/%gem_name%/.rubocop.yml.tt +5 -5
- data/lib/gemsmith/templates/%gem_name%/CHANGES.md.tt +1 -1
- data/lib/gemsmith/templates/%gem_name%/README.md.tt +3 -3
- data/lib/gemsmith/templates/%gem_name%/Rakefile.tt +10 -14
- data/lib/gemsmith/templates/%gem_name%/bin/console.tt +1 -0
- data/lib/gemsmith/templates/%gem_name%/spec/spec_helper.rb.tt +1 -1
- metadata +11 -11
- 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: fcc2b1cdd8cf1f537b975a7d029526ff44f1fb76bc419e1af5c3b195e7109b78
|
4
|
+
data.tar.gz: 8be7ea5b3a7af39159b32c35f73e0cdf788fe19229372626575ac276d05819f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d5d7738986a2d0af916256912aa7f5b73ce535866bee5ecc1c17b898d6b3df973bdd4dc57a935529263391ef88ae293e966baf75b102af3007853f299b7dea1
|
7
|
+
data.tar.gz: 94db019dccc3cc799082ddf656a36385a6f14c9bd3b3c86e1435b446c4bbc029777902d4ec8239b626e6287e652cb0e62621bf46164f8cf114d59c7c7adc27bb
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
�
|
1
|
+
���m!b�%t�Sꤎj,�]@�>l����{�0mq5����rg�6��q�0����,��j�b�v-���V���kf�ò��y��Jq �s]����M����E�ё��]e�C���Dq�C�-�ψEP�U#s?as�gs���M�M"�\P�A���_/�Xdo_��E{wU������{iЩ��\���[ͳ���שj����3��W�dJ��g�o95g� D�\-j*��~����_�qҎD`л+y�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -24,6 +24,7 @@ toc::[]
|
|
24
24
|
* Uses link:https://www.alchemists.io/projects/tocer[Tocer] for README table of contents generation.
|
25
25
|
* Supports link:https://github.com/rubysec/bundler-audit[Bundler Audit].
|
26
26
|
* Supports link:https://circleci.com[Circle CI].
|
27
|
+
* Supports link:https://git-scm.com[Git]
|
27
28
|
* Supports link:https://www.alchemists.io/projects/git-lint[Git Lint].
|
28
29
|
* Supports link:https://github.com[GitHub].
|
29
30
|
* Supports link:https://github.com/guard/guard[Guard].
|
@@ -32,9 +33,9 @@ toc::[]
|
|
32
33
|
* Supports link:https://rspec.info[RSpec].
|
33
34
|
* Supports link:https://github.com/rubocop-hq/rubocop[Rubocop].
|
34
35
|
* Supports link:https://github.com/rubocop-hq/rubocop-rspec[Rubocop RSpec].
|
35
|
-
* Supports link:
|
36
|
+
* Supports link:https://rubyonrails.org[Ruby on Rails].
|
36
37
|
* Supports link:https://guides.rubygems.org/security[RubyGems Security].
|
37
|
-
* Supports link:https://github.com/
|
38
|
+
* Supports link:https://github.com/simplecov-ruby/simplecov[SimpleCov].
|
38
39
|
* Supports link:https://github.com/erikhuda/thor[Thor].
|
39
40
|
* Supports common settings and a structured layout for building gems.
|
40
41
|
* Supports publishing to public or private gem servers.
|
@@ -50,12 +51,12 @@ toc::[]
|
|
50
51
|
== Screencasts
|
51
52
|
|
52
53
|
[link=https://www.alchemists.io/screencasts/gemsmith]
|
53
|
-
image::https://www.alchemists.io/images/screencasts/gemsmith/cover
|
54
|
+
image::https://www.alchemists.io/images/screencasts/gemsmith/cover.svg[Screencast,600,240,role=focal_point]
|
54
55
|
|
55
56
|
== Requirements
|
56
57
|
|
57
58
|
. A UNIX-based system.
|
58
|
-
. link:https://www.ruby-lang.org[Ruby
|
59
|
+
. link:https://www.ruby-lang.org[Ruby].
|
59
60
|
. link:https://rubygems.org[RubyGems].
|
60
61
|
. link:https://github.com/bundler/bundler[Bundler].
|
61
62
|
|
@@ -140,14 +141,14 @@ rake build # Build example-0.1.0.gem package
|
|
140
141
|
rake bundle:audit # Updates the ruby-advisory-db then runs bundle-audit
|
141
142
|
rake clean # Clean gem artifacts
|
142
143
|
rake code_quality # Run code quality checks
|
143
|
-
rake
|
144
|
+
rake git_lint # Run Git Lint
|
144
145
|
rake install # Install example-0.1.0.gem package
|
145
146
|
rake publish # Build, tag as 0.1.0 (unsigned), and push example-0.1.0.gem to RubyGems
|
146
147
|
rake reek # Check for code smells
|
147
148
|
rake rubocop # Run RuboCop
|
148
149
|
rake rubocop:auto_correct # Auto-correct RuboCop offenses
|
149
150
|
rake spec # Run RSpec code examples
|
150
|
-
rake toc
|
151
|
+
rake toc[label,includes] # Add/Update Table of Contents (README)
|
151
152
|
....
|
152
153
|
|
153
154
|
_NOTE: Some tasks might differ depending on what options you enabled/disabled during gem
|
data/bin/gemsmith
CHANGED
data/lib/gemsmith/cli.rb
CHANGED
@@ -167,7 +167,6 @@ module Gemsmith
|
|
167
167
|
desc: "Add security support.",
|
168
168
|
type: :boolean,
|
169
169
|
default: configuration.to_h.dig(:generate, :security)
|
170
|
-
# rubocop:disable Metrics/AbcSize
|
171
170
|
# :reek:TooManyStatements
|
172
171
|
def generate name
|
173
172
|
print_cli_and_rails_engine_option_error && return if options.cli? && options.engine?
|
@@ -179,7 +178,6 @@ module Gemsmith
|
|
179
178
|
|
180
179
|
say_status :info, "Gem generation finished.", :green
|
181
180
|
end
|
182
|
-
# rubocop:enable Metrics/AbcSize
|
183
181
|
|
184
182
|
desc "-o, [--open=GEM]", "Open a gem in default editor."
|
185
183
|
map %w[-o --open] => :open
|
@@ -44,11 +44,11 @@ module Gemsmith
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def allowed_push_key
|
47
|
-
spec.metadata.fetch
|
47
|
+
spec.metadata.fetch "allowed_push_key", "rubygems_api_key"
|
48
48
|
end
|
49
49
|
|
50
50
|
def allowed_push_host
|
51
|
-
spec.metadata.fetch
|
51
|
+
spec.metadata.fetch "allowed_push_host", self.class.default_gem_host
|
52
52
|
end
|
53
53
|
|
54
54
|
def package_file_name
|
@@ -5,10 +5,10 @@ module Gemsmith
|
|
5
5
|
# Generates Bundler Audit support.
|
6
6
|
class BundlerAudit < Base
|
7
7
|
def run
|
8
|
-
return
|
8
|
+
return if configuration.dig :generate, :bundler_audit
|
9
9
|
|
10
|
-
cli.
|
11
|
-
cli.
|
10
|
+
cli.gsub_file "#{gem_name}/Rakefile", %r(require.+bundler/audit.+\n), ""
|
11
|
+
cli.gsub_file "#{gem_name}/Rakefile", /Bundler::Audit.+\n/, ""
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
@@ -5,9 +5,9 @@ module Gemsmith
|
|
5
5
|
# Generates Git Lint support.
|
6
6
|
class GitLint < Base
|
7
7
|
def run
|
8
|
-
return
|
8
|
+
return if configuration.dig :generate, :git_lint
|
9
9
|
|
10
|
-
cli.
|
10
|
+
cli.gsub_file "#{gem_name}/Rakefile", %r(require.+git/lint.+\n), ""
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -10,11 +10,7 @@ module Gemsmith
|
|
10
10
|
DEFAULT_COMMENTS = ["# frozen_string_literal: true"].freeze
|
11
11
|
|
12
12
|
def run
|
13
|
-
Pragmater::Runner.
|
14
|
-
gem_root,
|
15
|
-
comments: DEFAULT_COMMENTS,
|
16
|
-
includes: includes
|
17
|
-
).run action: :add
|
13
|
+
Pragmater::Runner.for(**attributes).call
|
18
14
|
end
|
19
15
|
|
20
16
|
# rubocop:disable Metrics/MethodLength
|
@@ -37,6 +33,17 @@ module Gemsmith
|
|
37
33
|
]
|
38
34
|
end
|
39
35
|
# rubocop:enable Metrics/MethodLength
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def attributes
|
40
|
+
{
|
41
|
+
action: :insert,
|
42
|
+
root_dir: gem_root,
|
43
|
+
comments: DEFAULT_COMMENTS,
|
44
|
+
includes: includes
|
45
|
+
}
|
46
|
+
end
|
40
47
|
end
|
41
48
|
end
|
42
49
|
end
|
@@ -5,11 +5,12 @@ module Gemsmith
|
|
5
5
|
# Generates Reek support.
|
6
6
|
class Reek < Base
|
7
7
|
def run
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
if configuration.dig :generate, :reek
|
9
|
+
template "%gem_name%/.reek.yml.tt"
|
10
|
+
else
|
11
|
+
cli.gsub_file "#{gem_name}/Rakefile", /require.+reek.+\n/, ""
|
12
|
+
cli.gsub_file "#{gem_name}/Rakefile", /Reek.+\n/, ""
|
13
|
+
end
|
13
14
|
end
|
14
15
|
end
|
15
16
|
end
|
@@ -5,17 +5,18 @@ module Gemsmith
|
|
5
5
|
# Generates RSpec support.
|
6
6
|
class Rspec < Base
|
7
7
|
def run
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
if configuration.dig :generate, :rspec
|
9
|
+
install_templates
|
10
|
+
else
|
11
|
+
remove_rake_lines
|
12
|
+
end
|
12
13
|
end
|
13
14
|
|
14
15
|
private
|
15
16
|
|
16
|
-
def
|
17
|
-
cli.
|
18
|
-
cli.
|
17
|
+
def remove_rake_lines
|
18
|
+
cli.gsub_file "#{gem_name}/Rakefile", /require.+rspec.+\n/, ""
|
19
|
+
cli.gsub_file "#{gem_name}/Rakefile", /RSpec.+\n/, ""
|
19
20
|
end
|
20
21
|
|
21
22
|
def install_templates
|
@@ -5,12 +5,13 @@ module Gemsmith
|
|
5
5
|
# Generates Rubocop support.
|
6
6
|
class Rubocop < Base
|
7
7
|
def run
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
if configuration.dig :generate, :rubocop
|
9
|
+
template "%gem_name%/.rubocop.yml.tt"
|
10
|
+
cli.run "cd #{gem_name} && bundle exec rubocop --auto-correct > /dev/null"
|
11
|
+
else
|
12
|
+
cli.gsub_file "#{gem_name}/Rakefile", /require.+rubocop.+\n/, ""
|
13
|
+
cli.gsub_file "#{gem_name}/Rakefile", /RuboCop.+\n/, ""
|
14
|
+
end
|
14
15
|
end
|
15
16
|
end
|
16
17
|
end
|
data/lib/gemsmith/identity.rb
CHANGED
@@ -51,7 +51,7 @@ Gem::Specification.new do |spec|
|
|
51
51
|
spec.add_development_dependency "<%= config.dig(:generate, :engine) ? "rspec-rails" : "rspec" %>", "~> 3.9"
|
52
52
|
<%- end -%>
|
53
53
|
<%- if config.dig(:generate, :rubocop) -%>
|
54
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
54
|
+
spec.add_development_dependency "rubocop", "~> 0.89"
|
55
55
|
spec.add_development_dependency "rubocop-performance", "~> 1.5"
|
56
56
|
spec.add_development_dependency "rubocop-rake", "~> 0.5"
|
57
57
|
<%- end -%>
|
@@ -59,7 +59,7 @@ Gem::Specification.new do |spec|
|
|
59
59
|
spec.add_development_dependency "rubocop-rspec", "~> 1.39"
|
60
60
|
<%- end -%>
|
61
61
|
<%- if config.dig(:generate, :simple_cov) -%>
|
62
|
-
spec.add_development_dependency "simplecov", "~> 0.
|
62
|
+
spec.add_development_dependency "simplecov", "~> 0.19"
|
63
63
|
<%- end -%>
|
64
64
|
|
65
65
|
<%- if config.dig(:generate, :engine) -%>
|
@@ -1,12 +1,12 @@
|
|
1
1
|
inherit_from:
|
2
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.
|
3
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.
|
4
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.
|
2
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.14.0/configurations/rubocop/ruby.yml
|
3
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.14.0/configurations/rubocop/rake.yml
|
4
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.14.0/configurations/rubocop/performance.yml
|
5
5
|
<%- if config.dig(:generate, :rspec) -%>
|
6
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.
|
6
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.14.0/configurations/rubocop/rspec.yml
|
7
7
|
<%- end -%>
|
8
8
|
<%- if config.dig(:generate, :engine) -%>
|
9
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.
|
9
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/4.14.0/configurations/rubocop/rails.yml
|
10
10
|
<%- end -%>
|
11
11
|
|
12
12
|
<%- if config.dig(:generate, :cli) -%>
|
@@ -18,9 +18,9 @@
|
|
18
18
|
|
19
19
|
## Requirements
|
20
20
|
|
21
|
-
1. [Ruby
|
21
|
+
1. [Ruby](https://www.ruby-lang.org)
|
22
22
|
<%- if config.dig(:generate, :engine) -%>
|
23
|
-
1. [Ruby on Rails](
|
23
|
+
1. [Ruby on Rails](https://rubyonrails.org)
|
24
24
|
<%- end -%>
|
25
25
|
|
26
26
|
## Setup
|
@@ -84,7 +84,7 @@ Read [LICENSE](LICENSE.md) for details.
|
|
84
84
|
## History
|
85
85
|
|
86
86
|
Read [CHANGES](CHANGES.md) for details.
|
87
|
-
Built with [Gemsmith](https://
|
87
|
+
Built with [Gemsmith](https://www.alchemists.io/projects/gemsmith).
|
88
88
|
|
89
89
|
## Credits
|
90
90
|
|
@@ -1,15 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
# require "rubocop/rake_task"
|
1
|
+
require "gemsmith/rake/setup"
|
2
|
+
require "bundler/audit/task"
|
3
|
+
require "git/lint/rake/setup"
|
4
|
+
require "rspec/core/rake_task"
|
5
|
+
require "reek/rake/task"
|
6
|
+
require "rubocop/rake_task"
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
rescue LoadError => error
|
14
|
-
puts error.message
|
15
|
-
end
|
8
|
+
Bundler::Audit::Task.new
|
9
|
+
RSpec::Core::RakeTask.new :spec
|
10
|
+
Reek::Rake::Task.new
|
11
|
+
RuboCop::RakeTask.new
|
@@ -13,7 +13,7 @@ require "pry-byebug"
|
|
13
13
|
require "<%= config.dig(:gem, :path) %>"
|
14
14
|
<%- end -%>
|
15
15
|
|
16
|
-
Dir[File.join(__dir__, "support", "shared_contexts", "**/*.rb")].each(&method(:require))
|
16
|
+
Dir[File.join(__dir__, "support", "shared_contexts", "**/*.rb")].sort.each(&method(:require))
|
17
17
|
|
18
18
|
RSpec.configure do |config|
|
19
19
|
config.color = true
|
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: 14.
|
4
|
+
version: 14.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
|
29
29
|
QWc=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2020-
|
31
|
+
date: 2020-10-11 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: milestoner
|
@@ -50,42 +50,42 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '8.0'
|
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: '
|
60
|
+
version: '8.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: refinements
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '7.
|
67
|
+
version: '7.11'
|
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: '7.
|
74
|
+
version: '7.11'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rubocop
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '0.
|
81
|
+
version: '0.89'
|
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: '0.
|
88
|
+
version: '0.89'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: runcom
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -316,14 +316,14 @@ dependencies:
|
|
316
316
|
requirements:
|
317
317
|
- - "~>"
|
318
318
|
- !ruby/object:Gem::Version
|
319
|
-
version: '0.
|
319
|
+
version: '0.19'
|
320
320
|
type: :development
|
321
321
|
prerelease: false
|
322
322
|
version_requirements: !ruby/object:Gem::Requirement
|
323
323
|
requirements:
|
324
324
|
- - "~>"
|
325
325
|
- !ruby/object:Gem::Version
|
326
|
-
version: '0.
|
326
|
+
version: '0.19'
|
327
327
|
description:
|
328
328
|
email:
|
329
329
|
- brooke@alchemists.io
|
@@ -434,5 +434,5 @@ requirements: []
|
|
434
434
|
rubygems_version: 3.1.4
|
435
435
|
signing_key:
|
436
436
|
specification_version: 4
|
437
|
-
summary: A command line interface for smithing
|
437
|
+
summary: A command line interface for smithing Ruby gems.
|
438
438
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|