gemsmith 13.6.0 → 13.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17ce2acb370a7eb6551ce4436a8791eb1ec63cdb64e428216845d87e05034b97
4
- data.tar.gz: a3a69c866c4590a14e24bc288d76e3e7bc920b2b12e594efa323cf463e4092cc
3
+ metadata.gz: 7428e78cc0f985f6bff2b65d034881a515c64b9b59e02427a1f3ecaca8dcc29f
4
+ data.tar.gz: 35c183c427084fdb2209839b959757ead3673d830990e3a103c037108fec0eaf
5
5
  SHA512:
6
- metadata.gz: 2e1143b954e77b497856dec6471107f910183347cb2503fbdcd2057dc589de3d6f1962c3f84583d2caca4ab4c3d4f459532c1024d5af7a5190719b4ad9633479
7
- data.tar.gz: 5e86e94c2109cd2ce6010f3db596c123ace2e0ec7ff8750fc69fcf7ca9ca54d08008f5422b5ed44ab873119e40df2c4f77ffeb26ebb671e04d6b5da5a0569c5e
6
+ metadata.gz: fc281691b6d7ca1b0211cd6fdb16ce7a148383c2a04df4f4824bd7d1e7f6941b734e2a553f57da6a128df01b179472d09043609dcffcaf969da33e7dd32623e4
7
+ data.tar.gz: 0a0d13b78331f41e386ef7892861fea6df8a2c7a5022bf014e620ab3a6d208abab0eb4569d511c97c51473827f84b072870a0e09384bcca725f04ddb065d713f
@@ -1,4 +1 @@
1
- ")�,��Vp�2|I�x�ϻ�<"����%�յ@�:9�k�'�k� �aH�m��o~��ʾ΂�KR�\~jYm�F��`�)���.4����/���N��m^�7����E9K�^H
2
- @���~o�8޿o���J�(o�ꁄ0�Z����{�c���I�T�U.�cK��f�s �v����W��C���Ah�-X
3
- ȲU���hI�@B6 V)R��]�C�O
4
- ��#��#���75���X�Je:<���S�
1
+ b�0e��l5��FC~mƫ�E�,�~U��D3����Nu��-�+�������a7Z�>�SxQ��޳�g�f���A��M��
data.tar.gz.sig CHANGED
Binary file
@@ -7,15 +7,15 @@ module Gemsmith
7
7
  LIB_ROOT = File.join("%gem_name%", "lib").freeze
8
8
  LIB_ROOT_GEM = File.join(LIB_ROOT, "%gem_path%").freeze
9
9
 
10
+ def self.run cli, configuration: {}
11
+ new(cli, configuration: configuration).run
12
+ end
13
+
10
14
  def initialize cli, configuration: {}
11
15
  @cli = cli
12
16
  @configuration = configuration
13
17
  end
14
18
 
15
- def self.run cli, configuration: {}
16
- new(cli, configuration: configuration).run
17
- end
18
-
19
19
  def run
20
20
  fail NotImplementedError, "The method, #run, is not implemented yet."
21
21
  end
@@ -6,6 +6,13 @@ module Gemsmith
6
6
  module Generators
7
7
  # Generates documentation support.
8
8
  class Documentation < Base
9
+ def run
10
+ create_files
11
+ update_readme
12
+ end
13
+
14
+ private
15
+
9
16
  def create_files
10
17
  template "%gem_name%/README.md.tt"
11
18
  template "%gem_name%/CONTRIBUTING.md.tt"
@@ -18,11 +25,6 @@ module Gemsmith
18
25
  File.join(gem_root, "README.md")
19
26
  .then { |readme| Tocer::Writer.new(readme).call }
20
27
  end
21
-
22
- def run
23
- create_files
24
- update_readme
25
- end
26
28
  end
27
29
  end
28
30
  end
@@ -4,15 +4,27 @@ module Gemsmith
4
4
  module Generators
5
5
  # Generates Ruby on Rails Engine support.
6
6
  class Engine < Base
7
- def rails?
8
- cli.run "command -v rails > /dev/null"
7
+ # :reek:TooManyStatements
8
+ def run
9
+ return unless runnable?
10
+
11
+ install_rails
12
+ create_engine
13
+ create_generator_files
14
+ stub_assets
15
+ remove_files
16
+ end
17
+
18
+ private
19
+
20
+ def runnable?
21
+ configuration.dig :generate, :engine
9
22
  end
10
23
 
11
24
  def install_rails
12
- return if rails?
13
- return unless cli.yes? "Ruby on Rails is not installed. Would you like it installed (y/n)?"
25
+ return if cli.run "command -v rails > /dev/null"
14
26
 
15
- cli.run "gem install rails"
27
+ cli.run "gem install rails" if cli.yes? "Would you like to install Ruby on Rails (y/n)?"
16
28
  end
17
29
 
18
30
  def create_engine
@@ -42,23 +54,6 @@ module Gemsmith
42
54
  end
43
55
  # rubocop:enable Metrics/AbcSize
44
56
 
45
- # :reek:TooManyStatements
46
- def run
47
- return unless runnable?
48
-
49
- install_rails
50
- create_engine
51
- create_generator_files
52
- stub_assets
53
- remove_files
54
- end
55
-
56
- private
57
-
58
- def runnable?
59
- configuration.dig :generate, :engine
60
- end
61
-
62
57
  def engine_options
63
58
  "--skip-git " \
64
59
  "--skip-bundle " \
@@ -1,16 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "open3"
4
+
3
5
  module Gemsmith
4
6
  module Generators
5
7
  # Generates Git support.
6
8
  class Git < Base
7
- def create_ignore_file
8
- template "%gem_name%/.gitignore.tt"
9
- end
10
-
11
- def create_repository
12
- create_commit "Added gem skeleton.",
13
- "Built with [#{Identity.label}](#{Identity.url}) #{Identity.version}."
9
+ def initialize cli, configuration: {}, shell: Open3
10
+ super cli, configuration: configuration
11
+ @shell = shell
14
12
  end
15
13
 
16
14
  def run
@@ -20,11 +18,22 @@ module Gemsmith
20
18
 
21
19
  private
22
20
 
21
+ attr_reader :shell
22
+
23
+ def create_ignore_file
24
+ template "%gem_name%/.gitignore.tt"
25
+ end
26
+
27
+ def create_repository
28
+ create_commit "Added gem skeleton.",
29
+ "Built with [#{Identity.label}](#{Identity.url}) #{Identity.version}."
30
+ end
31
+
23
32
  def create_commit subject, body
24
33
  Dir.chdir gem_root do
25
- `git init`
26
- `git add .`
27
- `git commit --all --no-verify --message "#{subject}" --message "#{body}"`
34
+ shell.capture3 "git init"
35
+ shell.capture3 "git add ."
36
+ shell.capture3 %(git commit --all --no-verify --message "#{subject}" --message "#{body}")
28
37
  end
29
38
  end
30
39
  end
@@ -7,8 +7,14 @@ module Gemsmith
7
7
  module Generators
8
8
  # Formats pragma comments in source files.
9
9
  class Pragma < Base
10
- def self.comments
11
- ["# frozen_string_literal: true"]
10
+ DEFAULT_COMMENTS = ["# frozen_string_literal: true"].freeze
11
+
12
+ def run
13
+ Pragmater::Runner.new(
14
+ gem_root,
15
+ comments: DEFAULT_COMMENTS,
16
+ includes: includes
17
+ ).run action: :add
12
18
  end
13
19
 
14
20
  # rubocop:disable Metrics/MethodLength
@@ -31,14 +37,6 @@ module Gemsmith
31
37
  ]
32
38
  end
33
39
  # rubocop:enable Metrics/MethodLength
34
-
35
- def run
36
- Pragmater::Runner.new(
37
- gem_root,
38
- comments: self.class.comments,
39
- includes: includes
40
- ).run action: :add
41
- end
42
40
  end
43
41
  end
44
42
  end
@@ -8,6 +8,12 @@ module Gemsmith
8
8
  class Rake < Base
9
9
  using Refinements::Arrays
10
10
 
11
+ def run
12
+ template "%gem_name%/Rakefile.tt"
13
+ append_code_quality_task
14
+ append_default_task
15
+ end
16
+
11
17
  def generate_code_quality_task
12
18
  return "" if code_quality_tasks.empty?
13
19
 
@@ -20,12 +26,6 @@ module Gemsmith
20
26
  %(\ntask default: %i[#{default_task}]\n)
21
27
  end
22
28
 
23
- def run
24
- template "%gem_name%/Rakefile.tt"
25
- append_code_quality_task
26
- append_default_task
27
- end
28
-
29
29
  private
30
30
 
31
31
  def rspec_task
@@ -13,10 +13,6 @@ module Gemsmith
13
13
 
14
14
  private
15
15
 
16
- def rspec_root
17
- "%gem_name%/spec"
18
- end
19
-
20
16
  def uncomment_lines
21
17
  cli.uncomment_lines "#{gem_name}/Rakefile", /require.+rspec.+/
22
18
  cli.uncomment_lines "#{gem_name}/Rakefile", /RSpec.+/
@@ -28,6 +24,10 @@ module Gemsmith
28
24
  template "#{rspec_root}/support/shared_contexts/temp_dir.rb.tt"
29
25
  end
30
26
 
27
+ def rspec_root
28
+ "%gem_name%/spec"
29
+ end
30
+
31
31
  def install_rails_helper
32
32
  return unless configuration.dig :generate, :engine
33
33
 
@@ -12,7 +12,7 @@ module Gemsmith
12
12
  end
13
13
 
14
14
  def self.version
15
- "13.6.0"
15
+ "13.7.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -52,8 +52,8 @@ Gem::Specification.new do |spec|
52
52
  spec.add_development_dependency "<%= config.dig(:generate, :engine) ? "rspec-rails" : "rspec" %>", "~> 3.8"
53
53
  <%- end -%>
54
54
  <%- if config.dig(:generate, :rubocop) -%>
55
- spec.add_development_dependency "rubocop", "~> 0.69"
56
- spec.add_development_dependency "rubocop-performance", "~> 1.3"
55
+ spec.add_development_dependency "rubocop", "~> 0.73"
56
+ spec.add_development_dependency "rubocop-performance", "~> 1.4"
57
57
  <%- end -%>
58
58
  <%- if config.dig(:generate, :rubocop) && config.dig(:generate, :rspec) -%>
59
59
  spec.add_development_dependency "rubocop-rspec", "~> 1.33"
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: 13.6.0
4
+ version: 13.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
29
29
  y84=
30
30
  -----END CERTIFICATE-----
31
- date: 2019-06-09 00:00:00.000000000 Z
31
+ date: 2019-08-01 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: milestoner
@@ -78,14 +78,14 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.69'
81
+ version: '0.73'
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.69'
88
+ version: '0.73'
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: '1.3'
319
+ version: '1.4'
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: '1.3'
326
+ version: '1.4'
327
327
  - !ruby/object:Gem::Dependency
328
328
  name: rubocop-rspec
329
329
  requirement: !ruby/object:Gem::Requirement
@@ -472,7 +472,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
472
472
  - !ruby/object:Gem::Version
473
473
  version: '0'
474
474
  requirements: []
475
- rubygems_version: 3.0.3
475
+ rubygems_version: 3.0.4
476
476
  signing_key:
477
477
  specification_version: 4
478
478
  summary: A command line interface for smithing new Ruby gems.
metadata.gz.sig CHANGED
Binary file