gemsmith 14.11.0 → 15.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.adoc +0 -1
  5. data/bin/gemsmith +0 -3
  6. data/lib/gemsmith.rb +0 -2
  7. data/lib/gemsmith/cli.rb +13 -12
  8. data/lib/gemsmith/credentials.rb +10 -8
  9. data/lib/gemsmith/gem/requirement.rb +1 -1
  10. data/lib/gemsmith/gem/specification.rb +3 -2
  11. data/lib/gemsmith/generators/base.rb +5 -3
  12. data/lib/gemsmith/generators/bundler.rb +5 -1
  13. data/lib/gemsmith/generators/circle_ci.rb +1 -1
  14. data/lib/gemsmith/generators/documentation.rb +1 -2
  15. data/lib/gemsmith/generators/git.rb +4 -1
  16. data/lib/gemsmith/identity.rb +1 -1
  17. data/lib/gemsmith/rake/builder.rb +9 -6
  18. data/lib/gemsmith/rake/publisher.rb +5 -3
  19. data/lib/gemsmith/rake/tasks.rb +5 -2
  20. data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +4 -3
  21. data/lib/gemsmith/templates/%gem_name%/.circleci/config.yml.tt +31 -0
  22. data/lib/gemsmith/templates/%gem_name%/.rubocop.yml.tt +5 -5
  23. data/lib/gemsmith/templates/%gem_name%/Gemfile.tt +2 -2
  24. data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_path%/install/install_generator.rb.tt +3 -1
  25. data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_path%/upgrade/upgrade_generator.rb.tt +1 -1
  26. data/lib/gemsmith/templates/%gem_name%/spec/lib/%gem_path%/cli_spec.rb.tt +5 -2
  27. data/lib/gemsmith/templates/%gem_name%/spec/spec_helper.rb.tt +3 -0
  28. data/lib/gemsmith/templates/%gem_name%/spec/support/shared_contexts/temp_dir.rb.tt +1 -1
  29. metadata +43 -31
  30. metadata.gz.sig +3 -3
  31. data/lib/gemsmith/generators/git_cop.rb +0 -14
  32. data/lib/gemsmith/git.rb +0 -22
  33. data/lib/gemsmith/templates/%gem_name%/circle.yml.tt +0 -64
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4050ed16bcda89b28da9286eb0b48d055897aae78ad80b7cee369c5f2fb8975
4
- data.tar.gz: 51c40260ce4729e8ee3abc90fd72a63782fef35f465ddf7f39cc4839c81e4e97
3
+ metadata.gz: a94b8beb95fcc0bb202a3c8480156d53f12eb6340f695fce5bab3b981656e083
4
+ data.tar.gz: 6c687751f63f6fe9b03ad3d8683b871005641aba8c541567273d484765393baa
5
5
  SHA512:
6
- metadata.gz: 9113b601bab5b74db24b3e22304f3340e0b6010b14b91ede2153e9f14a10f1eba919fff6c45729bd9e3cdd451111e43374d7410f159afa60c82eb08c8346f9ba
7
- data.tar.gz: fc6466a0075145ea85641c0f7524f7c83fc65bb5682dc5afbcbe0af7f33a0e4a926875d2c94d004ac3d11b82eaa3c4a75406b8c23438908bd1b5941be770a6b3
6
+ metadata.gz: 7659c98e951971f1aad46ebb36467aad31bd8a888114eddf25df8b44d284bd368f7350fd0a82cadaaedf56f39658bea39aeea677c7548a19825120f8c71c5cb2
7
+ data.tar.gz: 55f2d665296859685dc9212e289ed4d8f0ac1104b6745bb55d20d021914a837e4f97ccb49c9c53aff802307d4147f66df3029a8d8e2120f81289a253bb9f774b
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -94,7 +94,6 @@ For more gem generation options, type: `gemsmith --help --generate`
94
94
  [--circle-ci], [--no-circle-ci] # Add Circle CI support.
95
95
  [--cli], [--no-cli] # Add CLI support.
96
96
  [--engine], [--no-engine] # Add Rails Engine support.
97
- [--git-cop], [--no-git-cop] # Add Git Cop support. DEPRECATED: Use Git Lint instead.
98
97
  [--git-lint], [--no-git-lint] # Add Git Lint support.
99
98
  # Default: true
100
99
  [--git-hub], [--no-git-hub] # Add GitHub support.
data/bin/gemsmith CHANGED
@@ -1,9 +1,6 @@
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
-
7
4
  require "gemsmith"
8
5
  require "gemsmith/cli"
9
6
  require "gemsmith/identity"
data/lib/gemsmith.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "gemsmith/identity"
4
- require "gemsmith/git"
5
4
  require "gemsmith/credentials"
6
5
  require "gemsmith/errors/base"
7
6
  require "gemsmith/errors/requirement_conversion"
@@ -19,7 +18,6 @@ require "gemsmith/generators/cli"
19
18
  require "gemsmith/generators/documentation"
20
19
  require "gemsmith/generators/gem"
21
20
  require "gemsmith/generators/git"
22
- require "gemsmith/generators/git_cop"
23
21
  require "gemsmith/generators/git_lint"
24
22
  require "gemsmith/generators/git_hub"
25
23
  require "gemsmith/generators/guard"
data/lib/gemsmith/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "git_plus"
3
4
  require "thor"
4
5
  require "thor/actions"
5
6
  require "refinements/strings"
@@ -7,6 +8,7 @@ require "refinements/hashes"
7
8
  require "runcom"
8
9
  require "gemsmith/helpers/cli"
9
10
  require "gemsmith/helpers/template"
11
+ require "pathname"
10
12
 
11
13
  module Gemsmith
12
14
  # The Command Line Interface (CLI) for the gem.
@@ -23,27 +25,29 @@ module Gemsmith
23
25
 
24
26
  # Overwrites Thor's template source root.
25
27
  def self.source_root
26
- File.expand_path File.join(File.dirname(__FILE__), "templates")
28
+ Pathname(__dir__).join("templates").freeze
27
29
  end
28
30
 
29
31
  # rubocop:disable Metrics/MethodLength
30
32
  def self.configuration
33
+ repository = GitPlus::Repository.new
34
+
31
35
  Runcom::Config.new "#{Identity::NAME}/configuration.yml",
32
36
  defaults: {
33
37
  year: Time.now.year,
34
- github_user: Git.github_user,
38
+ github_user: repository.config_get("github.user"),
35
39
  gem: {
36
40
  label: "Undefined",
37
41
  name: "undefined",
38
42
  path: "undefined",
39
43
  class: "Undefined",
40
44
  platform: "Gem::Platform::RUBY",
41
- url: Git.github_url("undefined"),
45
+ url: "",
42
46
  license: "MIT"
43
47
  },
44
48
  author: {
45
- name: Git.config_value("user.name"),
46
- email: Git.config_value("user.email"),
49
+ name: repository.config_get("user.name"),
50
+ email: repository.config_get("user.email"),
47
51
  url: ""
48
52
  },
49
53
  organization: {
@@ -52,7 +56,7 @@ module Gemsmith
52
56
  },
53
57
  versions: {
54
58
  ruby: RUBY_VERSION,
55
- rails: "5.1"
59
+ rails: "6.1"
56
60
  },
57
61
  generate: {
58
62
  bundler_audit: true,
@@ -87,7 +91,6 @@ module Gemsmith
87
91
  Generators::Engine,
88
92
  Generators::Rspec,
89
93
  Generators::BundlerAudit,
90
- Generators::GitCop,
91
94
  Generators::GitLint,
92
95
  Generators::Reek,
93
96
  Generators::Guard,
@@ -127,10 +130,6 @@ module Gemsmith
127
130
  desc: "Add Rails Engine support.",
128
131
  type: :boolean,
129
132
  default: configuration.to_h.dig(:generate, :engine)
130
- method_option :git_cop,
131
- desc: "Add Git Cop support. DEPRECATED: Use Git Lint instead.",
132
- type: :boolean,
133
- default: false
134
133
  method_option :git_lint,
135
134
  desc: "Add Git Lint support.",
136
135
  type: :boolean,
@@ -232,6 +231,8 @@ module Gemsmith
232
231
  # :reek:FeatureEnvy
233
232
  # rubocop:disable Metrics/MethodLength
234
233
  def setup_configuration name:, options: {}
234
+ repository = GitPlus::Repository.new
235
+
235
236
  @configuration = configuration.to_h.merge(
236
237
  gem: {
237
238
  label: name.titleize,
@@ -239,7 +240,7 @@ module Gemsmith
239
240
  path: name.snakecase,
240
241
  class: name.camelcase,
241
242
  platform: "Gem::Platform::RUBY",
242
- url: Git.github_url(name),
243
+ url: %(https://github.com/#{repository.config_get "github.user"}/#{name}),
243
244
  license: "MIT"
244
245
  },
245
246
  generate: options.symbolize_keys
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "yaml"
4
- require "fileutils"
4
+ require "refinements/pathnames"
5
5
  require "gemsmith/authenticators/basic"
6
6
  require "gemsmith/authenticators/ruby_gems"
7
7
 
@@ -11,10 +11,12 @@ module Gemsmith
11
11
  DEFAULT_KEY = :rubygems_api_key
12
12
  DEFAULT_URL = "https://rubygems.org"
13
13
 
14
+ using Refinements::Pathnames
15
+
14
16
  attr_reader :key, :url
15
17
 
16
18
  def self.file_path
17
- File.join ENV.fetch("HOME"), ".gem", "credentials"
19
+ Pathname(ENV.fetch("HOME")).join ".gem", "credentials"
18
20
  end
19
21
 
20
22
  def self.authenticators
@@ -52,7 +54,7 @@ module Gemsmith
52
54
  attr_reader :credentials, :shell
53
55
 
54
56
  def exist?
55
- File.exist? self.class.file_path
57
+ self.class.file_path.exist?
56
58
  end
57
59
 
58
60
  def read
@@ -62,11 +64,11 @@ module Gemsmith
62
64
  end
63
65
 
64
66
  def write
65
- file_path = self.class.file_path
66
-
67
- FileUtils.mkdir_p File.dirname file_path
68
- File.open(file_path, "w") { |file| file << YAML.dump(update) }
69
- FileUtils.chmod 0o600, file_path
67
+ self.class
68
+ .file_path
69
+ .tap { |path| path.parent.make_path }
70
+ .write(YAML.dump(update))
71
+ .chmod 0o600
70
72
  end
71
73
 
72
74
  def update
@@ -13,7 +13,7 @@ module Gemsmith
13
13
  end
14
14
 
15
15
  def self.version_segments version
16
- String(version).split(Versionaire::DELIMITER).map(&:to_i)
16
+ String(version).split(Versionaire::Version.delimiter).map(&:to_i)
17
17
  end
18
18
 
19
19
  def self.for object
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
3
4
  require "versionaire"
4
5
 
5
6
  module Gemsmith
@@ -26,7 +27,7 @@ module Gemsmith
26
27
 
27
28
  def initialize file_path
28
29
  @file_path = file_path
29
- @spec = self.class.specification.load file_path
30
+ @spec = self.class.specification.load file_path.to_s
30
31
  validate
31
32
  @version = Versionaire::Version @spec.version.to_s
32
33
  end
@@ -56,7 +57,7 @@ module Gemsmith
56
57
  end
57
58
 
58
59
  def package_path
59
- File.join "pkg", package_file_name
60
+ Pathname("pkg").join package_file_name
60
61
  end
61
62
 
62
63
  private
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "pathname"
4
+
3
5
  module Gemsmith
4
6
  module Generators
5
7
  # Abstract class from which all generators inherit from.
6
8
  class Base
7
- LIB_ROOT = File.join("%gem_name%", "lib").freeze
8
- LIB_ROOT_GEM = File.join(LIB_ROOT, "%gem_path%").freeze
9
+ LIB_ROOT = Pathname("%gem_name%/lib").freeze
10
+ LIB_ROOT_GEM = LIB_ROOT.join("%gem_path%").freeze
9
11
 
10
12
  def self.run cli, configuration: {}
11
13
  new(cli, configuration: configuration).run
@@ -33,7 +35,7 @@ module Gemsmith
33
35
  end
34
36
 
35
37
  def gem_root
36
- File.join cli.destination_root, gem_name
38
+ Pathname(cli.destination_root).join gem_name
37
39
  end
38
40
 
39
41
  def template path
@@ -1,11 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/pathnames"
4
+
3
5
  module Gemsmith
4
6
  module Generators
5
7
  # Generates Bundler support.
6
8
  class Bundler < Base
9
+ using Refinements::Pathnames
10
+
7
11
  def run
8
- Dir.chdir gem_root do
12
+ gem_root.change_dir do
9
13
  cli.say_status :info, "Installing gem dependencies...", :green
10
14
  cli.run "bundle install"
11
15
  end
@@ -7,7 +7,7 @@ module Gemsmith
7
7
  def run
8
8
  return unless configuration.dig :generate, :circle_ci
9
9
 
10
- template "%gem_name%/circle.yml.tt"
10
+ template "%gem_name%/.circleci/config.yml.tt"
11
11
  end
12
12
  end
13
13
  end
@@ -22,8 +22,7 @@ module Gemsmith
22
22
  end
23
23
 
24
24
  def update_readme
25
- File.join(gem_root, "README.md")
26
- .then { |readme| Tocer::Writer.new(readme).call }
25
+ gem_root.join("README.md").then { |path| Tocer::Writer.new(path).call }
27
26
  end
28
27
  end
29
28
  end
@@ -1,11 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "open3"
4
+ require "refinements/pathnames"
4
5
 
5
6
  module Gemsmith
6
7
  module Generators
7
8
  # Generates Git support.
8
9
  class Git < Base
10
+ using Refinements::Pathnames
11
+
9
12
  def initialize cli, configuration: {}, shell: Open3
10
13
  super cli, configuration: configuration
11
14
  @shell = shell
@@ -31,7 +34,7 @@ module Gemsmith
31
34
  end
32
35
 
33
36
  def create_commit subject, body
34
- Dir.chdir gem_root do
37
+ gem_root.change_dir do
35
38
  shell.capture3 "git init"
36
39
  shell.capture3 "git add ."
37
40
  shell.capture3 %(git commit --all --no-verify --message "#{subject}" --message "#{body}")
@@ -5,7 +5,7 @@ module Gemsmith
5
5
  module Identity
6
6
  NAME = "gemsmith"
7
7
  LABEL = "Gemsmith"
8
- VERSION = "14.11.0"
8
+ VERSION = "15.3.0"
9
9
  VERSION_LABEL = "#{LABEL} #{VERSION}"
10
10
  URL = "https://www.alchemists.io/projects/gemsmith"
11
11
  end
@@ -1,19 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/ui/shell"
4
- require "fileutils"
4
+ require "refinements/pathnames"
5
5
 
6
6
  module Gemsmith
7
7
  module Rake
8
8
  # Provides gem build functionality. Meant to be wrapped in Rake tasks.
9
9
  class Builder
10
- def initialize shell: Bundler::UI::Shell.new, kernel: Kernel
10
+ using Refinements::Pathnames
11
+
12
+ def initialize root: Pathname("pkg"), shell: Bundler::UI::Shell.new, kernel: Kernel
13
+ @root = root
11
14
  @shell = shell
12
15
  @kernel = kernel
13
16
  end
14
17
 
15
18
  def clean
16
- FileUtils.rm_rf "pkg"
19
+ root.remove_tree
17
20
  shell.confirm "Cleaned gem artifacts."
18
21
  end
19
22
 
@@ -28,8 +31,8 @@ module Gemsmith
28
31
  path = gem_spec.package_path
29
32
 
30
33
  if kernel.system "gem build #{gem_spec.name}.gemspec"
31
- FileUtils.mkdir_p "pkg"
32
- FileUtils.mv gem_spec.package_file_name, path
34
+ root.make_path
35
+ Pathname(gem_spec.package_file_name).copy path
33
36
  shell.confirm "Built: #{path}."
34
37
  else
35
38
  shell.error "Unable to build: #{path}."
@@ -48,7 +51,7 @@ module Gemsmith
48
51
 
49
52
  private
50
53
 
51
- attr_reader :shell, :kernel
54
+ attr_reader :root, :shell, :kernel
52
55
  end
53
56
  end
54
57
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "milestoner"
4
+ require "refinements/pathnames"
4
5
  require "gemsmith/identity"
5
6
  require "gemsmith/credentials"
6
- require "gemsmith/git"
7
7
  require "gemsmith/cli"
8
8
 
9
9
  module Gemsmith
@@ -11,13 +11,15 @@ module Gemsmith
11
11
  # Provides gem release functionality. Meant to be wrapped in Rake tasks.
12
12
  # :reek:TooManyInstanceVariables
13
13
  class Publisher
14
+ using Refinements::Pathnames
15
+
14
16
  def self.gem_spec_path
15
- String Dir["#{Dir.pwd}/*.gemspec"].first
17
+ Pathname.pwd.files("*.gemspec").first.to_s
16
18
  end
17
19
 
18
20
  # rubocop:disable Metrics/ParameterLists
19
21
  # :reek:LongParameterList
20
- def initialize gem_spec: Gemsmith::Gem::Specification.new(self.class.gem_spec_path),
22
+ def initialize gem_spec: Gemsmith::Gem::Specification.new(self.class.gem_spec_path.to_s),
21
23
  gem_config: Gemsmith::CLI.configuration.to_h,
22
24
  credentials: Gemsmith::Credentials,
23
25
  publisher: Milestoner::Publisher.new,
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rake"
4
+ require "refinements/pathnames"
4
5
  require "tocer/rake/tasks"
5
6
  require "gemsmith/gem/specification"
6
7
  require "gemsmith/errors/base"
@@ -14,15 +15,17 @@ module Gemsmith
14
15
  class Tasks
15
16
  include ::Rake::DSL
16
17
 
18
+ using Refinements::Pathnames
19
+
17
20
  def self.default_gem_spec
18
- Dir.glob("#{Dir.pwd}/*.gemspec").first
21
+ Pathname.pwd.files("*.gemspec").first
19
22
  end
20
23
 
21
24
  def self.setup
22
25
  new.install
23
26
  end
24
27
 
25
- def initialize gem_spec: Gem::Specification.new(self.class.default_gem_spec),
28
+ def initialize gem_spec: Gem::Specification.new(self.class.default_gem_spec.to_s),
26
29
  builder: Rake::Builder.new,
27
30
  publisher: Rake::Publisher.new
28
31
  @gem_spec = gem_spec
@@ -11,9 +11,10 @@ Gem::Specification.new do |spec|
11
11
  spec.license = "MIT"
12
12
 
13
13
  spec.metadata = {
14
- "source_code_uri" => "<%= config.dig(:gem, :url) %>",
14
+ "bug_tracker_uri" => "<%= config.dig(:gem, :url) %>/issues",
15
15
  "changelog_uri" => "<%= config.dig(:gem, :url) %>/blob/master/CHANGES.md",
16
- "bug_tracker_uri" => "<%= config.dig(:gem, :url) %>/issues"
16
+ "documentation_uri" => "<%= config.dig(:gem, :url) %>",
17
+ "source_code_uri" => "<%= config.dig(:gem, :url) %>"
17
18
  }
18
19
 
19
20
  <%- if config.dig(:generate, :security) -%>
@@ -26,7 +27,7 @@ Gem::Specification.new do |spec|
26
27
  spec.add_dependency "rails", "~> <%= config.dig(:versions, :rails) %>"
27
28
  <%- end -%>
28
29
  <%- if config.dig(:generate, :cli) -%>
29
- spec.add_dependency "runcom", "~> 6.4"
30
+ spec.add_dependency "runcom", "~> 7.0"
30
31
  spec.add_dependency "thor", "~> 0.20"
31
32
  <%- end -%>
32
33
 
@@ -0,0 +1,31 @@
1
+ version: 2.1
2
+ jobs:
3
+ build:
4
+ working_directory: ~/project
5
+ docker:
6
+ - image: bkuhlmann/alpine-ruby:latest
7
+ steps:
8
+ - checkout
9
+
10
+ - restore_cache:
11
+ name: Bundler Restore
12
+ keys:
13
+ - gem-cache-{{.Branch}}-{{checksum "<%= config.dig(:gem, :name) %>.gemspec"}}
14
+ - gem-cache-
15
+
16
+ - run:
17
+ name: Bundler Install
18
+ command: |
19
+ gem update --system
20
+ bundle config set path "vendor/bundle"
21
+ bundle install
22
+
23
+ - save_cache:
24
+ name: Bundler Store
25
+ key: gem-cache-{{.Branch}}-{{checksum "<%= config.dig(:gem, :name) %>.gemspec"}}
26
+ paths:
27
+ - vendor/bundle
28
+
29
+ - run:
30
+ name: Build
31
+ command: bundle exec rake
@@ -1,12 +1,12 @@
1
1
  inherit_from:
2
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/master/configurations/rubocop/ruby.yml
3
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/master/configurations/rubocop/rake.yml
4
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/master/configurations/rubocop/performance.yml
2
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/main/configurations/rubocop/ruby.yml
3
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/main/configurations/rubocop/rake.yml
4
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/main/configurations/rubocop/performance.yml
5
5
  <%- if config.dig(:generate, :rspec) -%>
6
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/master/configurations/rubocop/rspec.yml
6
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/main/configurations/rubocop/rspec.yml
7
7
  <%- end -%>
8
8
  <%- if config.dig(:generate, :engine) -%>
9
- - https://raw.githubusercontent.com/bkuhlmann/code_quality/master/configurations/rubocop/rails.yml
9
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/main/configurations/rubocop/rails.yml
10
10
  <%- end -%>
11
11
 
12
12
  <%- if config.dig(:generate, :cli) -%>
@@ -7,13 +7,13 @@ group :code_quality do
7
7
  gem "bundler-audit", "~> 0.7"
8
8
  <%- end -%>
9
9
  <%- if config.dig(:generate, :git_lint) -%>
10
- gem "git-lint", "~> 1.3"
10
+ gem "git-lint", "~> 2.0"
11
11
  <%- end -%>
12
12
  <%- if config.dig(:generate, :reek) -%>
13
13
  gem "reek", "~> 6.0"
14
14
  <%- end -%>
15
15
  <%- if config.dig(:generate, :rubocop) -%>
16
- gem "rubocop", "~> 1.5"
16
+ gem "rubocop", "~> 1.10"
17
17
  gem "rubocop-performance", "~> 1.8"
18
18
  gem "rubocop-rake", "~> 0.5"
19
19
  <%- end -%>
@@ -1,7 +1,9 @@
1
+ require "pathname"
2
+
1
3
  <% render_namespace do %>
2
4
  # Generator for installing new files.
3
5
  class InstallGenerator < Rails::Generators::Base
4
- source_root File.join(File.dirname(__FILE__), "..", "templates")
6
+ source_root Pathname(__dir__).join("../templates")
5
7
 
6
8
  desc "Installs additional <%= config.dig(:gem, :label) %> resources."
7
9
  def install
@@ -1,7 +1,7 @@
1
1
  <% render_namespace do %>
2
2
  # Generator for updating existing files.
3
3
  class UpgradeGenerator < Rails::Generators::Base
4
- source_root File.join(File.dirname(__FILE__), "..", "templates")
4
+ source_root Pathname(__dir__).join("../templates")
5
5
 
6
6
  desc "Upgrades previously installed <%= config.dig(:gem, :label) %> resources."
7
7
  def upgrade
@@ -3,11 +3,14 @@
3
3
  require "spec_helper"
4
4
 
5
5
  RSpec.describe <%= config.dig(:gem, :class) %>::CLI do
6
+ subject(:cli) { described_class.start command_line }
7
+
8
+ include_context "with temporary directory"
9
+
6
10
  let(:options) { [] }
7
11
  let(:command_line) { Array(command).concat options }
8
- let(:cli) { described_class.start command_line }
9
12
 
10
- shared_examples_for "a config command", :temp_dir do
13
+ shared_examples_for "a config command" do
11
14
  context "with no options" do
12
15
  it "prints help text" do
13
16
  result = -> { cli }
@@ -10,6 +10,9 @@ SimpleCov.start { enable_coverage :branch }
10
10
  require "<%= config.dig(:gem, :path) %>"
11
11
  <%- end -%>
12
12
 
13
+ GC.auto_compact = true
14
+ GC.verify_compaction_references double_heap: true, toward: :empty
15
+
13
16
  Dir[File.join(__dir__, "support", "shared_contexts", "**/*.rb")].sort.each { |path| require path }
14
17
 
15
18
  RSpec.configure do |config|
@@ -1,4 +1,4 @@
1
- RSpec.shared_context "with temporary directory", :temp_dir do
1
+ RSpec.shared_context "with temporary directory" do
2
2
  let(:temp_dir) { Bundler.root.join "tmp", "rspec" }
3
3
 
4
4
  around do |example|
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.11.0
4
+ version: 15.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIC/jCCAeagAwIBAgIBAzANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
- a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMDAzMTUxNDQ1MzJaFw0yMTAzMTUx
15
- NDQ1MzJaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
13
+ MIIC/jCCAeagAwIBAgIBBDANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
14
+ a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0yMTAzMTkxMjQ4MDZaFw0yMjAzMTkx
15
+ MjQ4MDZaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
16
16
  IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
17
17
  xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
18
18
  brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
@@ -20,86 +20,100 @@ cert_chain:
20
20
  D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
21
21
  3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
22
22
  AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
23
- 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAIHhAlD3po4sTYqacXaQ
24
- XI9jIhrfMy//2PgbHWcETtlJPBeNUbbSNBABcllUHKqYsVDlSvSmss034KSWNR8F
25
- bF1GcloicyvcCC4y6IoW4it0COAcdeaaxkxiBSgKdQFpff9REnDlIKK4uQ9lLxIo
26
- Y2G5xubiziKZkyfWFuSr67PIjW3Bu673D1JVBArhA1qbgQmYQcy1CkGOjo+iO8Nf
27
- 7u/QSfBHb+r/bXhKscDgPpnKwbUmvgO2+94zJG9KsrmIydlzYfsD09aXKx0t6Xy4
28
- 2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
- QWc=
23
+ 2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBAEjpaOXHHp8s/7GL2qCb
24
+ YAs7urOLv9VHSPfQWAwaTMVnSsIf3Sw4xzISOP/mmfEPBPXtz61K5esrE/uTFtgb
25
+ FyjxQk2H0sEWgrRXGGNHBWQRhhEs7LP/TByoC15A0br++xLxRz4r7HBLGAWQQDpg
26
+ 66BJ2TBVjxS6K64tKbq7+ACyrOZGgTfNHACh4M076y0x0oRf/rwBrU39/KRfuhbb
27
+ cm+nNCEtO35gTmZ2bVDHLGvWazi3gJt6+huQjfXTCUUG2YYBxwhu+GPdAGQPxpf9
28
+ lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
+ W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-12-29 00:00:00.000000000 Z
31
+ date: 2021-04-04 00:00:00.000000000 Z
32
32
  dependencies:
33
+ - !ruby/object:Gem::Dependency
34
+ name: git_plus
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.4'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.4'
33
47
  - !ruby/object:Gem::Dependency
34
48
  name: milestoner
35
49
  requirement: !ruby/object:Gem::Requirement
36
50
  requirements:
37
51
  - - "~>"
38
52
  - !ruby/object:Gem::Version
39
- version: '10.4'
53
+ version: '11.1'
40
54
  type: :runtime
41
55
  prerelease: false
42
56
  version_requirements: !ruby/object:Gem::Requirement
43
57
  requirements:
44
58
  - - "~>"
45
59
  - !ruby/object:Gem::Version
46
- version: '10.4'
60
+ version: '11.1'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: pragmater
49
63
  requirement: !ruby/object:Gem::Requirement
50
64
  requirements:
51
65
  - - "~>"
52
66
  - !ruby/object:Gem::Version
53
- version: '8.1'
67
+ version: '9.0'
54
68
  type: :runtime
55
69
  prerelease: false
56
70
  version_requirements: !ruby/object:Gem::Requirement
57
71
  requirements:
58
72
  - - "~>"
59
73
  - !ruby/object:Gem::Version
60
- version: '8.1'
74
+ version: '9.0'
61
75
  - !ruby/object:Gem::Dependency
62
76
  name: refinements
63
77
  requirement: !ruby/object:Gem::Requirement
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: '7.18'
81
+ version: '8.0'
68
82
  type: :runtime
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '7.18'
88
+ version: '8.0'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: rubocop
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '1.5'
95
+ version: '1.10'
82
96
  type: :runtime
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '1.5'
102
+ version: '1.10'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: runcom
91
105
  requirement: !ruby/object:Gem::Requirement
92
106
  requirements:
93
107
  - - "~>"
94
108
  - !ruby/object:Gem::Version
95
- version: '6.4'
109
+ version: '7.0'
96
110
  type: :runtime
97
111
  prerelease: false
98
112
  version_requirements: !ruby/object:Gem::Requirement
99
113
  requirements:
100
114
  - - "~>"
101
115
  - !ruby/object:Gem::Version
102
- version: '6.4'
116
+ version: '7.0'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: thor
105
119
  requirement: !ruby/object:Gem::Requirement
@@ -120,28 +134,28 @@ dependencies:
120
134
  requirements:
121
135
  - - "~>"
122
136
  - !ruby/object:Gem::Version
123
- version: '10.4'
137
+ version: '11.0'
124
138
  type: :runtime
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - "~>"
129
143
  - !ruby/object:Gem::Version
130
- version: '10.4'
144
+ version: '11.0'
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: versionaire
133
147
  requirement: !ruby/object:Gem::Requirement
134
148
  requirements:
135
149
  - - "~>"
136
150
  - !ruby/object:Gem::Version
137
- version: '8.7'
151
+ version: '9.0'
138
152
  type: :runtime
139
153
  prerelease: false
140
154
  version_requirements: !ruby/object:Gem::Requirement
141
155
  requirements:
142
156
  - - "~>"
143
157
  - !ruby/object:Gem::Version
144
- version: '8.7'
158
+ version: '9.0'
145
159
  description:
146
160
  email:
147
161
  - brooke@alchemists.io
@@ -177,7 +191,6 @@ files:
177
191
  - lib/gemsmith/generators/engine.rb
178
192
  - lib/gemsmith/generators/gem.rb
179
193
  - lib/gemsmith/generators/git.rb
180
- - lib/gemsmith/generators/git_cop.rb
181
194
  - lib/gemsmith/generators/git_hub.rb
182
195
  - lib/gemsmith/generators/git_lint.rb
183
196
  - lib/gemsmith/generators/guard.rb
@@ -187,7 +200,6 @@ files:
187
200
  - lib/gemsmith/generators/rspec.rb
188
201
  - lib/gemsmith/generators/rubocop.rb
189
202
  - lib/gemsmith/generators/ruby.rb
190
- - lib/gemsmith/git.rb
191
203
  - lib/gemsmith/helpers/cli.rb
192
204
  - lib/gemsmith/helpers/template.rb
193
205
  - lib/gemsmith/identity.rb
@@ -196,6 +208,7 @@ files:
196
208
  - lib/gemsmith/rake/setup.rb
197
209
  - lib/gemsmith/rake/tasks.rb
198
210
  - lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt
211
+ - lib/gemsmith/templates/%gem_name%/.circleci/config.yml.tt
199
212
  - lib/gemsmith/templates/%gem_name%/.github/ISSUE_TEMPLATE.md.tt
200
213
  - lib/gemsmith/templates/%gem_name%/.github/PULL_REQUEST_TEMPLATE.md.tt
201
214
  - lib/gemsmith/templates/%gem_name%/.gitignore.tt
@@ -213,7 +226,6 @@ files:
213
226
  - lib/gemsmith/templates/%gem_name%/bin/%gem_name%.tt
214
227
  - lib/gemsmith/templates/%gem_name%/bin/console.tt
215
228
  - lib/gemsmith/templates/%gem_name%/bin/setup.tt
216
- - lib/gemsmith/templates/%gem_name%/circle.yml.tt
217
229
  - lib/gemsmith/templates/%gem_name%/lib/%gem_path%.rb.tt
218
230
  - lib/gemsmith/templates/%gem_name%/lib/%gem_path%/cli.rb.tt
219
231
  - lib/gemsmith/templates/%gem_name%/lib/%gem_path%/engine.rb.tt
@@ -242,14 +254,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
242
254
  requirements:
243
255
  - - "~>"
244
256
  - !ruby/object:Gem::Version
245
- version: '2.7'
257
+ version: '3.0'
246
258
  required_rubygems_version: !ruby/object:Gem::Requirement
247
259
  requirements:
248
260
  - - ">="
249
261
  - !ruby/object:Gem::Version
250
262
  version: '0'
251
263
  requirements: []
252
- rubygems_version: 3.2.1
264
+ rubygems_version: 3.2.15
253
265
  signing_key:
254
266
  specification_version: 4
255
267
  summary: A command line interface for smithing Ruby gems.
metadata.gz.sig CHANGED
@@ -1,3 +1,3 @@
1
- jd�CD;քY��d��fvZ�� S�rX�:-��|� ���mvM_޽����!�\k�M�2 H���:҉�������#�
2
- ��ȡ����b��Fm��V72hPs�(����R��K�Q=���Ovz��܇��4���
3
- "�6wZ�;Rx�$4��Z��shͮ6A M �z$�]t?U���*��۬T,:r��B��}�v�*��r�b��/�,�C��� BjZ�2ꧣl>4G\͖ �^�֥J*�v�dY&
1
+ a
2
+ P��1�������<=ŗ͹�T#,���3���ܩ�c�F
3
+ ����q�����Q�-���z0q1l��
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gemsmith
4
- module Generators
5
- # Generates Git Cop support.
6
- class GitCop < Base
7
- def run
8
- return unless configuration.dig :generate, :git_cop
9
-
10
- warn "[DEPRECATION]: Git Cop is deprecated, use Git Lint instead."
11
- end
12
- end
13
- end
14
- end
data/lib/gemsmith/git.rb DELETED
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gemsmith
4
- # A thin wrapper to Git.
5
- # rubocop:disable Style/StaticClass
6
- class Git
7
- def self.config_value key
8
- `git config #{key}`.chomp
9
- end
10
-
11
- def self.github_user
12
- config_value "github.user"
13
- end
14
-
15
- def self.github_url project
16
- return "" if github_user.empty?
17
-
18
- "https://github.com/#{github_user}/#{project}"
19
- end
20
- end
21
- # rubocop:enable Style/StaticClass
22
- end
@@ -1,64 +0,0 @@
1
- version: 2
2
- jobs:
3
- build:
4
- working_directory: ~/project
5
- docker:
6
- - image: circleci/ruby
7
- environment:
8
- BUNDLE_JOBS: 3
9
- BUNDLE_RETRY: 3
10
- BUNDLE_PATH: vendor/bundle
11
- EDITOR: vim
12
- RAILS_ENV: test
13
- steps:
14
- - checkout
15
-
16
- - run:
17
- name: Environment Setup
18
- command: |
19
- printf "%s\n" 'export CI_RUBY_VERSION=$(cat ".ruby-version" | tr -d "\n")' >> $BASH_ENV
20
-
21
- - type: cache-restore
22
- name: Ruby Restore
23
- key: ruby-{{checksum ".ruby-version"}}
24
-
25
- - run:
26
- name: Ruby Install
27
- command: |
28
- curl https://cache.ruby-lang.org/pub/ruby/${CI_RUBY_VERSION::-2}/ruby-$CI_RUBY_VERSION.tar.bz2 > ../ruby-$CI_RUBY_VERSION.tar.gz
29
- cd ..
30
- tar --extract --bzip2 --verbose --file ruby-$CI_RUBY_VERSION.tar.gz
31
- cd ruby-$CI_RUBY_VERSION
32
- ./configure
33
- make
34
- make update-gems
35
- make extract-gems
36
- sudo make install
37
-
38
- - type: cache-save
39
- name: Ruby Store
40
- key: ruby-{{checksum ".ruby-version"}}
41
- paths:
42
- - ../ruby-$CI_RUBY_VERSION
43
-
44
- - type: cache-restore
45
- name: Bundler Restore
46
- key: bundler-{{checksum "<%= config.dig(:gem, :name) %>.gemspec"}}
47
-
48
- - run:
49
- name: Bundler Install
50
- command: |
51
- gem update --system
52
- bundle config set path "vendor/bundle"
53
- bundle install
54
-
55
- - type: cache-save
56
- name: Bundler Store
57
- key: bundler-{{checksum "<%= config.dig(:gem, :name) %>.gemspec"}}
58
- paths:
59
- - vendor/bundle
60
-
61
- - run:
62
- name: Build
63
- command: |
64
- bundle exec rake