gemsmith 16.2.0 → 17.0.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: ac0feae9681ea0c70f0057b6f147ad41055cc6b590455c820c6f262d3f480ad2
4
- data.tar.gz: bc9a92fcd0b894ccbc7bf4d0bc8d67027daae68d69f8655857eb51315dce671d
3
+ metadata.gz: eee92d7f565b704f53494328cc55bcbf3115346088df35f165ccdcd3152abbe5
4
+ data.tar.gz: 1e75b09378363453f7d18f25004ab1f0c878fc6fdbe8a5f969807a48135e45a8
5
5
  SHA512:
6
- metadata.gz: a79b7e75db67d9c0ca46deac367dc9f0ec82ca8dfc4a05c184f92d2383654b1aa1ffe7ba3406ae4f3e336de6807fda6edf0f2284cc032eaacccf19d36b86659f
7
- data.tar.gz: 1c125eedee89a2bea26145075cc419fdd54e563ab84ee01c993ce7506e3616a26a79b7d4a31463e2c8c7719eeefebd6d9afc9dec221cdfeefb821e31178f2ee2
6
+ metadata.gz: b762c8024c1fb8b4d7c5bd4601d85f0b78272e3be09ab2a26e1981394f04b293115976b8e40c51b476efb7dc721796af4380d16f9c92060f036d29a58782d82e
7
+ data.tar.gz: 3ed00ce68ab41469290de5c6d1172cf1132c86980fe1862d40bca72608665d3204553350984eca67177e9357c2ca6c6052438c3376628fbd969610213ca26ebd
checksums.yaml.gz.sig CHANGED
@@ -1,3 +1,2 @@
1
- 3E��V�;���K0ۢ�E�"��QEOF�%���d܊io���M�$
2
- _��qE���6sS��f��TY�E�[��6#��VO P FJ4�����*�7����X�7�h�pFr�����{�- �J�;�n��� 7Ś��nć���o��� b�����Q.�ÿ�� ����r���x_$��s{;�'܋jĊ���:��_��t[l�^ U+�ん�]�%���v��<0Ug��5;K
3
- I��Z��H�L�
1
+ l}� #/��f�wg/O�r JmNh�����W�E��>����˕� 5ݬdT�P�I���@#�$���B�ܙ�jmL8f��j�+9ū�fF��K���˥�Z���3����b�_NM�����A�Ds21o_�*C5-*��[/�h5&\��z��օy���F8'� �&��a��*f��C15�>�b>�� <��wú/�ٷU5�
2
+ ���T��&��z�X�!�~��LE!lx�; O�֚���H�+�Ifxt
data/README.adoc CHANGED
@@ -35,6 +35,16 @@ To install, run:
35
35
  gem install gemsmith
36
36
  ----
37
37
 
38
+ == Upgrade
39
+
40
+ If upgrading from 16.0.0 to 17.0.0, you'll need to make the following changes:
41
+
42
+ * README badges are no longer injected so you can customize as desired.
43
+ * The `:rubocop:` build configuration has been removed. Use `:caliber:` instead.
44
+ * The `--rubocop` build option has been removed. Use `--caliber` instead.
45
+ * You no longer have to Git ignore RuboCop cached configurations since this is handled by the
46
+ link:https://www.alchemists.io/projects/caliber[Caliber] gem now.
47
+
38
48
  == Usage
39
49
 
40
50
  === Command Line Interface (CLI)
@@ -55,6 +65,7 @@ USAGE:
55
65
  BUILD OPTIONS:
56
66
  --[no-]amazing_print Add Amazing Print gem. Default: true.
57
67
  --[no-]bundler-leak Add Bundler Leak gem. Default: true.
68
+ --[no-]caliber Add Caliber gem. Default: true.
58
69
  --[no-]circle_ci Add Circle CI configuration and badge. Default: false.
59
70
  --[no-]citation Add citation documentation. Default: true.
60
71
  --[no-]community Add community documentation. Default: false.
@@ -75,7 +86,6 @@ BUILD OPTIONS:
75
86
  --[no-]reek Add Reek gem. Default: true.
76
87
  --[no-]refinements Add Refinements gem. Default: true.
77
88
  --[no-]rspec Add RSpec gem. Default: true.
78
- --[no-]rubocop Add RuboCop gems. Default: true.
79
89
  --[no-]security Add security. Default: true.
80
90
  --[no-]setup Add setup script. Default: true.
81
91
  --[no-]simple_cov Add SimpleCov gem. Default: true.
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 = "16.2.0"
5
+ spec.version = "17.0.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://www.alchemists.io/projects/gemsmith"
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency "dry-monads", "~> 1.4"
27
27
  spec.add_dependency "milestoner", "~> 13.0"
28
28
  spec.add_dependency "pastel", "~> 0.8"
29
- spec.add_dependency "refinements", "~> 9.1"
30
- spec.add_dependency "rubysmith", "~> 1.3"
29
+ spec.add_dependency "refinements", "~> 9.2"
30
+ spec.add_dependency "rubysmith", "~> 2.0"
31
31
  spec.add_dependency "runcom", "~> 8.2"
32
32
  spec.add_dependency "spek", "~> 0.0"
33
33
  spec.add_dependency "versionaire", "~> 10.0"
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "refinements/structs"
4
+
5
+ module Gemsmith
6
+ module Builders
7
+ # Builds project skeleton Circle CI configuration.
8
+ class CircleCI
9
+ using Refinements::Structs
10
+
11
+ def self.call(...) = new(...).call
12
+
13
+ def initialize configuration, builder: Rubysmith::Builder
14
+ @configuration = configuration
15
+ @builder = builder
16
+ end
17
+
18
+ def call
19
+ return configuration unless configuration.build_circle_ci
20
+
21
+ builder.call(configuration.merge(template_path: "%project_name%/.circleci/config.yml.erb"))
22
+ .replace("Gemfile.lock", "#{configuration.project_name}.gemspec")
23
+
24
+ configuration
25
+ end
26
+
27
+ private
28
+
29
+ attr_reader :configuration, :builder
30
+ end
31
+ end
32
+ end
@@ -24,6 +24,7 @@ module Gemsmith
24
24
  Rubysmith::Builders::Rake,
25
25
  Rubysmith::Builders::Console,
26
26
  Rubysmith::Builders::CircleCI,
27
+ Builders::CircleCI,
27
28
  Rubysmith::Builders::Setup,
28
29
  Rubysmith::Builders::GitHub,
29
30
  Rubysmith::Builders::Guard,
@@ -31,7 +32,7 @@ module Gemsmith
31
32
  Rubysmith::Builders::RSpec::Context,
32
33
  Rubysmith::Builders::RSpec::Helper,
33
34
  Builders::RSpec::Helper,
34
- Rubysmith::Builders::Rubocop,
35
+ Rubysmith::Builders::Caliber,
35
36
  Rubysmith::Extensions::Bundler,
36
37
  Rubysmith::Extensions::Pragmater,
37
38
  Rubysmith::Extensions::Tocer,
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.add_dependency "pastel", "~> 0.8"
30
30
  <% end %>
31
31
  <% if configuration.build_refinements %>
32
- spec.add_dependency "refinements", "~> 9.1"
32
+ spec.add_dependency "refinements", "~> 9.2"
33
33
  <% end %>
34
34
  <% if configuration.build_cli %>
35
35
  spec.add_dependency "runcom", "~> 8.2"
@@ -2,4 +2,4 @@
2
2
 
3
3
  require "<%= configuration.project_name %>"
4
4
 
5
- <%= configuration.project_class %>::CLI::Shell.new.call ARGV
5
+ <%= configuration.project_namespaced_class %>::CLI::Shell.new.call ARGV
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe <%= configuration.project_class %>::CLI::Actions::Config do
3
+ RSpec.describe <%= configuration.project_namespaced_class %>::CLI::Actions::Config do
4
4
  subject(:action) { described_class.new }
5
5
 
6
6
  include_context "with application container"
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe <%= configuration.project_class %>::CLI::Parser do
3
+ RSpec.describe <%= configuration.project_namespaced_class %>::CLI::Parser do
4
4
  subject(:parser) { described_class.new }
5
5
 
6
6
  include_context "with application container"
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe <%= configuration.project_class %>::CLI::Parsers::Core do
3
+ RSpec.describe <%= configuration.project_namespaced_class %>::CLI::Parsers::Core do
4
4
  subject(:parser) { described_class.new configuration.dup }
5
5
 
6
6
  include_context "with application container"
@@ -1,13 +1,13 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe <%= configuration.project_class %>::CLI::Shell do
3
+ RSpec.describe <%= configuration.project_namespaced_class %>::CLI::Shell do
4
4
  using Refinements::Pathnames
5
5
 
6
6
  subject(:shell) { described_class.new actions: described_class::ACTIONS.merge(config:) }
7
7
 
8
8
  include_context "with temporary directory"
9
9
 
10
- let(:config) { instance_spy <%= configuration.project_class %>::CLI::Actions::Config }
10
+ let(:config) { instance_spy <%= configuration.project_namespaced_class %>::CLI::Actions::Config }
11
11
 
12
12
  describe "#call" do
13
13
  it "edits configuration" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe <%= configuration.project_class %>::Configuration::Content do
3
+ RSpec.describe <%= configuration.project_namespaced_class %>::Configuration::Content do
4
4
  subject(:content) { described_class.new }
5
5
 
6
6
  describe "#initialize" do
@@ -1,13 +1,13 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe <%= configuration.project_class %>::Configuration::Loader do
3
+ RSpec.describe <%= configuration.project_namespaced_class %>::Configuration::Loader do
4
4
  subject(:loader) { described_class.with_defaults }
5
5
 
6
- let(:content) { <%= configuration.project_class %>::Configuration::Content.new }
6
+ let(:content) { <%= configuration.project_namespaced_class %>::Configuration::Content.new }
7
7
 
8
8
  describe ".call" do
9
9
  it "answers default configuration" do
10
- expect(described_class.call).to be_a(<%= configuration.project_class %>::Configuration::Content)
10
+ expect(described_class.call).to be_a(<%= configuration.project_namespaced_class %>::Configuration::Content)
11
11
  end
12
12
  end
13
13
 
@@ -5,8 +5,8 @@ RSpec.shared_context "with application container" do
5
5
 
6
6
  include_context "with temporary directory"
7
7
 
8
- let(:container) { <%= configuration.project_class %>::Container }
9
- let(:configuration) { <%= configuration.project_class %>::Configuration::Loader.with_defaults.call }
8
+ let(:container) { <%= configuration.project_namespaced_class %>::Container }
9
+ let(:configuration) { <%= configuration.project_namespaced_class %>::Configuration::Loader.with_defaults.call }
10
10
  let(:kernel) { class_spy Kernel }
11
11
 
12
12
  before do
@@ -1,7 +1,7 @@
1
1
  RSpec.shared_examples "a parser" do
2
2
  describe ".call" do
3
3
  it "answers configuration" do
4
- expect(described_class.call).to be_a(<%= configuration.project_class %>::Configuration::Content)
4
+ expect(described_class.call).to be_a(<%= configuration.project_namespaced_class %>::Configuration::Content)
5
5
  end
6
6
  end
7
7
  end
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: 16.2.0
4
+ version: 17.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
29
  W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2022-02-06 00:00:00.000000000 Z
31
+ date: 2022-02-12 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dry-container
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '9.1'
95
+ version: '9.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: '9.1'
102
+ version: '9.2'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rubysmith
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '1.3'
109
+ version: '2.0'
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: '1.3'
116
+ version: '2.0'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: runcom
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -186,6 +186,7 @@ files:
186
186
  - gemsmith.gemspec
187
187
  - lib/gemsmith.rb
188
188
  - lib/gemsmith/builders/bundler.rb
189
+ - lib/gemsmith/builders/circle_ci.rb
189
190
  - lib/gemsmith/builders/cli.rb
190
191
  - lib/gemsmith/builders/documentation/readme.rb
191
192
  - lib/gemsmith/builders/git/commit.rb
@@ -205,10 +206,6 @@ files:
205
206
  - lib/gemsmith/configuration/enhancers/template_root.rb
206
207
  - lib/gemsmith/configuration/loader.rb
207
208
  - lib/gemsmith/container.rb
208
- - lib/gemsmith/gems/finder.rb
209
- - lib/gemsmith/gems/loader.rb
210
- - lib/gemsmith/gems/picker.rb
211
- - lib/gemsmith/gems/presenter.rb
212
209
  - lib/gemsmith/templates/%project_name%/%project_name%.gemspec.erb
213
210
  - lib/gemsmith/templates/%project_name%/exe/%project_name%.erb
214
211
  - lib/gemsmith/templates/%project_name%/lib/%project_path%/cli/actions/config.rb.erb
@@ -262,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
259
  - !ruby/object:Gem::Version
263
260
  version: '0'
264
261
  requirements: []
265
- rubygems_version: 3.3.6
262
+ rubygems_version: 3.3.7
266
263
  signing_key:
267
264
  specification_version: 4
268
265
  summary: A command line interface for smithing Ruby gems.
metadata.gz.sig CHANGED
Binary file
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gemsmith
4
- module Gems
5
- # Finds multiple versions of an installed gem (if any) and answers found specifications.
6
- class Finder
7
- def self.call(path, ...) = new(...).call path
8
-
9
- def initialize client: ::Gem::Specification, presenter: Gems::Presenter
10
- warn "[DEPRECATION]: Finder is deprecated, use Spek gem instead."
11
-
12
- @client = client
13
- @presenter = presenter
14
- end
15
-
16
- def call(name) = client.find_all_by_name(name).map { |record| presenter.new record }
17
-
18
- private
19
-
20
- attr_reader :client, :presenter
21
- end
22
- end
23
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gemsmith
4
- module Gems
5
- # Loads a gem's specification.
6
- class Loader
7
- def self.call(path, ...) = new(...).call path
8
-
9
- def initialize client: ::Gem::Specification, presenter: Gems::Presenter
10
- warn "[DEPRECATION]: Loader is deprecated, use Spek gem instead."
11
-
12
- @client = client
13
- @presenter = presenter
14
- end
15
-
16
- def call(path) = client.load(path.to_s).then { |record| presenter.new record }
17
-
18
- private
19
-
20
- attr_reader :client, :presenter
21
- end
22
- end
23
- end
@@ -1,45 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "dry/monads"
4
-
5
- module Gemsmith
6
- module Gems
7
- # Picks a gem specification.
8
- class Picker
9
- include Dry::Monads[:result]
10
-
11
- def self.call(name, ...) = new(...).call name
12
-
13
- def initialize finder: Finder.new, kernel: Kernel
14
- warn "[DEPRECATION]: Picker is deprecated, use Spek gem instead."
15
-
16
- @finder = finder
17
- @kernel = kernel
18
- end
19
-
20
- def call name
21
- specifications = finder.call name
22
-
23
- case specifications.size
24
- when 1 then Success specifications.first
25
- when 2.. then Success choose(specifications)
26
- else Failure "Unknown gem or gem is not installed: #{name}."
27
- end
28
- end
29
-
30
- def choose specifications
31
- specifications.each.with_index 1 do |specification, index|
32
- kernel.puts "#{index}. #{specification.named_version}"
33
- end
34
-
35
- kernel.puts "\nPlease enter gem selection:"
36
- ARGV.clear
37
- specifications[kernel.gets.chomp.to_i - 1]
38
- end
39
-
40
- private
41
-
42
- attr_reader :finder, :kernel
43
- end
44
- end
45
- end
@@ -1,52 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "forwardable"
4
- require "pathname"
5
- require "refinements/arrays"
6
- require "versionaire"
7
-
8
- module Gemsmith
9
- module Gems
10
- # Provides a gem specification that is more useful than what is provided Ruby Gems.
11
- class Presenter
12
- extend Forwardable
13
-
14
- using Refinements::Arrays
15
- using Versionaire::Cast
16
-
17
- delegate %i[metadata name summary] => :record
18
-
19
- def initialize record
20
- warn "[DEPRECATION]: Presenter is deprecated, use Spek gem instead."
21
-
22
- @record = record
23
- end
24
-
25
- def allowed_push_key = metadata.fetch "allowed_push_key", "rubygems_api_key"
26
-
27
- def allowed_push_host = metadata.fetch "allowed_push_host", ::Gem::DEFAULT_HOST
28
-
29
- def homepage_url = String record.homepage
30
-
31
- def label = metadata.fetch "label", "Undefined"
32
-
33
- def labeled_summary(delimiter: " - ") = [label, summary].compress.join delimiter
34
-
35
- def labeled_version = "#{label} #{version}"
36
-
37
- def named_version = "#{name} #{version}"
38
-
39
- def package_path = Pathname("tmp").join package_name
40
-
41
- def package_name = "#{name}-#{version}.gem"
42
-
43
- def source_path = Pathname record.full_gem_path
44
-
45
- def version = Version record.version.to_s
46
-
47
- private
48
-
49
- attr_reader :record
50
- end
51
- end
52
- end