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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fec266e5af75d5e73a8406e702430fcbe4e9d007b4206a7f66822801edb6a0ef
4
- data.tar.gz: 7f96466a64fe9ea9c0dd29e9ac54e277ff2abd4a08f8c44e186934304285b277
3
+ metadata.gz: fcc2b1cdd8cf1f537b975a7d029526ff44f1fb76bc419e1af5c3b195e7109b78
4
+ data.tar.gz: 8be7ea5b3a7af39159b32c35f73e0cdf788fe19229372626575ac276d05819f2
5
5
  SHA512:
6
- metadata.gz: 5c79e2e4f66f4f6f9c52d6e6ab142a56dbd70871324e5bb1fda2ac96ea36904863021e2ea0800aa90ec4a37ff44e507777c0394837741f671502750325dd2c9a
7
- data.tar.gz: 759ec8bd5cd230f47b564ae0b2cafe7e81d345c1d26353614ac4d38ddf3df4995a3cf8b19e28577a7a334b63eb475b3b0cf7ebdca8e831ebf544ac865853d2e4
6
+ metadata.gz: 3d5d7738986a2d0af916256912aa7f5b73ce535866bee5ecc1c17b898d6b3df973bdd4dc57a935529263391ef88ae293e966baf75b102af3007853f299b7dea1
7
+ data.tar.gz: 94db019dccc3cc799082ddf656a36385a6f14c9bd3b3c86e1435b446c4bbc029777902d4ec8239b626e6287e652cb0e62621bf46164f8cf114d59c7c7adc27bb
@@ -1 +1 @@
1
- H9#G���Q��e]�� PV�b�g8O��nɚiY�� 7���5nn��}�!s���0)Q�<'mq6N�V/���N�"��c���`{?�oK����{j��@�}�#܈�z���4�ђI�!@P/c\@ ����j����̇�mv�Bp
1
+ ���m!b�%t�Sꤎj,�]@�>l����{0mq5����rg6��q�0����,��j�b�v-���V���kf ò��y��Jq s]����M����E�ё��]eC ���DqC�-�ψEPU#s?asgs���M�M"�΂\PA���_/�Xdo_��E{wU����� �{iЩ��\���[ͳ���שj����3��W�dJ��g�o95g� D�\-j*��~����_�qҎD`л+y�
data.tar.gz.sig CHANGED
Binary file
@@ -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:http://rubyonrails.org[Ruby on Rails].
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/colszowka/simplecov[SimpleCov].
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-original.png[Screencast,role=focal_point]
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 2.7.x].
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 git_cop # Run Git Cop
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 # Update Table of Contents (README)
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
@@ -1,6 +1,9 @@
1
1
  #! /usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
+ # TODO: Remove once the Pattern Matching feature is fully supported.
5
+ Warning[:experimental] = false
6
+
4
7
  require "gemsmith"
5
8
  require "gemsmith/cli"
6
9
  require "gemsmith/identity"
@@ -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("allowed_push_key") { "rubygems_api_key" }
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("allowed_push_host") { self.class.default_gem_host }
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 unless configuration.dig :generate, :bundler_audit
8
+ return if configuration.dig :generate, :bundler_audit
9
9
 
10
- cli.uncomment_lines "#{gem_name}/Rakefile", %r(require.+bundler/audit.+)
11
- cli.uncomment_lines "#{gem_name}/Rakefile", /Bundler::Audit.+/
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 unless configuration.dig :generate, :git_lint
8
+ return if configuration.dig :generate, :git_lint
9
9
 
10
- cli.uncomment_lines "#{gem_name}/Rakefile", %r(require.+git/lint.+)
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.new(
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
- return unless configuration.dig :generate, :reek
9
-
10
- cli.uncomment_lines "#{gem_name}/Rakefile", /require.+reek.+/
11
- cli.uncomment_lines "#{gem_name}/Rakefile", /Reek.+/
12
- template "%gem_name%/.reek.yml.tt"
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
- return unless configuration.dig :generate, :rspec
9
-
10
- uncomment_lines
11
- install_templates
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 uncomment_lines
17
- cli.uncomment_lines "#{gem_name}/Rakefile", /require.+rspec.+/
18
- cli.uncomment_lines "#{gem_name}/Rakefile", /RSpec.+/
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
- return unless configuration.dig :generate, :rubocop
9
-
10
- cli.uncomment_lines "#{gem_name}/Rakefile", /require.+rubocop.+/
11
- cli.uncomment_lines "#{gem_name}/Rakefile", /RuboCop.+/
12
- template "%gem_name%/.rubocop.yml.tt"
13
- cli.run "cd #{gem_name} && bundle exec rubocop --auto-correct > /dev/null"
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
@@ -5,7 +5,7 @@ module Gemsmith
5
5
  module Identity
6
6
  NAME = "gemsmith"
7
7
  LABEL = "Gemsmith"
8
- VERSION = "14.2.0"
8
+ VERSION = "14.7.0"
9
9
  VERSION_LABEL = "#{LABEL} #{VERSION}"
10
10
  URL = "https://www.alchemists.io/projects/gemsmith"
11
11
  end
@@ -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.83"
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.18"
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.8.0/configurations/rubocop/ruby.yml
3
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/4.8.0/configurations/rubocop/rake.yml
4
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/4.8.0/configurations/rubocop/performance.yml
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.8.0/configurations/rubocop/rspec.yml
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.8.0/configurations/rubocop/rails.yml
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) -%>
@@ -1,3 +1,3 @@
1
1
  # 0.1.0 (<%= Time.now.strftime "%Y-%m-%d" %>)
2
2
 
3
- - Initial implementation.
3
+ - Added initial implementation.
@@ -18,9 +18,9 @@
18
18
 
19
19
  ## Requirements
20
20
 
21
- 1. [Ruby <%= config.dig(:versions, :ruby) %>](https://www.ruby-lang.org)
21
+ 1. [Ruby](https://www.ruby-lang.org)
22
22
  <%- if config.dig(:generate, :engine) -%>
23
- 1. [Ruby on Rails](http://rubyonrails.org)
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://github.com/bkuhlmann/gemsmith).
87
+ Built with [Gemsmith](https://www.alchemists.io/projects/gemsmith).
88
88
 
89
89
  ## Credits
90
90
 
@@ -1,15 +1,11 @@
1
- begin
2
- require "gemsmith/rake/setup"
3
- # require "bundler/audit/task"
4
- # require "git/lint/rake/setup"
5
- # require "rspec/core/rake_task"
6
- # require "reek/rake/task"
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
- # Bundler::Audit::Task.new
10
- # RSpec::Core::RakeTask.new :spec
11
- # Reek::Rake::Task.new
12
- # RuboCop::RakeTask.new
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
@@ -1,4 +1,5 @@
1
1
  #! /usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require "bundler/setup"
4
5
  require "<%= config.dig :gem, :path %>"
@@ -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.2.0
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-06-13 00:00:00.000000000 Z
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: '7.0'
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: '7.0'
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.4'
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.4'
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.83'
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.83'
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.18'
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.18'
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 new Ruby gems.
437
+ summary: A command line interface for smithing Ruby gems.
438
438
  test_files: []
metadata.gz.sig CHANGED
Binary file