gemsmith 9.0.0 → 9.1.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
  SHA1:
3
- metadata.gz: b08284244aeaddea3f3d3b8b96080bc3e836b950
4
- data.tar.gz: 1c5ffe0e06e10034acee7795a8bf8586325c783d
3
+ metadata.gz: e5f55d84251f20431e1121f296e9d86012d0a3a5
4
+ data.tar.gz: c675b86c73436f12fdebc56c10539e1d4a9b3c61
5
5
  SHA512:
6
- metadata.gz: ba6952350cd01cbbf932a83ab3afefb4221a9540b8807109b12fc995c13e22763bf4d59532bbd8047463962f1c492a1627d628a0f02776fca5327eeb4eec2316
7
- data.tar.gz: c7b95301f395bc829f2949aea66f9226a40012a30ded74e47b749328717ae3e24218a099f3304c4b516deed99cd00ef77ca6f8a0f4864f57911d96150c5ba486
6
+ metadata.gz: d486e73b98e1f8fc9c7407862fb30a8c9a4f6fdd1859d877db698523b9feb11d93989f793935ceb17ea3fcc3f0e7ec732b4bc3a6fbc29f95a0df817db7810686
7
+ data.tar.gz: e748b627bcceae7c034a904205b17b6d56f3e5e4fdc9bd741d56babdba1741dd2601cb7046ffbc5a193908e3d288f8a2edcc3e7e4c85e58e7f1cf72281a46b73
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -28,6 +28,7 @@ module Gemsmith
28
28
  File.expand_path File.join(File.dirname(__FILE__), "templates")
29
29
  end
30
30
 
31
+ # rubocop:disable Metrics/MethodLength
31
32
  def self.configuration
32
33
  Runcom::Configuration.new file_name: Identity.file_name, defaults: {
33
34
  year: Time.now.year,
@@ -161,6 +162,7 @@ module Gemsmith
161
162
  desc: "Add Patreon support.",
162
163
  type: :boolean,
163
164
  default: configuration.to_h.dig(:generate, :patreon)
165
+ # rubocop:disable Metrics/AbcSize
164
166
  def generate name
165
167
  print_cli_and_rails_engine_option_error && return if options.cli? && options.rails?
166
168
 
@@ -46,6 +46,7 @@ module Gemsmith
46
46
  credentials? && !String(credentials[key]).empty?
47
47
  end
48
48
 
49
+ # rubocop:disable Metrics/AbcSize
49
50
  def create
50
51
  return if valid?
51
52
 
@@ -4,6 +4,7 @@ module Gemsmith
4
4
  module Generators
5
5
  # Generates Command Line Interface (CLI) support.
6
6
  class CLI < Base
7
+ # rubocop:disable Metrics/AbcSize
7
8
  def run
8
9
  return unless configuration.dig(:generate, :cli)
9
10
 
@@ -4,6 +4,7 @@ module Gemsmith
4
4
  module Generators
5
5
  # Generates default gem support.
6
6
  class Gem < Base
7
+ # rubocop:disable Metrics/AbcSize
7
8
  def run
8
9
  cli.template "%gem_name%/bin/setup.tt", configuration
9
10
  cli.template "%gem_name%/Gemfile.tt", configuration
@@ -19,6 +19,7 @@ module Gemsmith
19
19
  cli.run "rails plugin new --skip #{configuration.dig :gem, :name} #{engine_options}"
20
20
  end
21
21
 
22
+ # rubocop:disable Metrics/AbcSize
22
23
  def create_generator_files
23
24
  cli.empty_directory "#{generator_root}/templates"
24
25
  cli.template "#{generator_root}/install/install_generator.rb.tt", configuration
@@ -1,40 +1,67 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/arrays"
4
+
3
5
  module Gemsmith
4
6
  module Generators
5
7
  # Generates Rake support.
6
8
  class Rake < Base
9
+ using Refinements::Arrays
10
+
11
+ def generate_code_quality_task
12
+ return "" if code_quality_tasks.empty?
13
+ %(\ndesc "Run code quality checks"\ntask code_quality: %i[#{code_quality_tasks}]\n)
14
+ end
15
+
16
+ def generate_default_task
17
+ return "" if default_task.empty?
18
+ %(\ntask default: %i[#{default_task}]\n)
19
+ end
20
+
7
21
  def run
8
22
  cli.template "%gem_name%/Rakefile.tt", configuration
9
- configure_rakefile
23
+ append_code_quality_task
24
+ append_default_task
10
25
  end
11
26
 
12
27
  private
13
28
 
14
29
  def rspec_task
15
- "spec" if configuration.dig(:generate, :rspec)
30
+ configuration.dig(:generate, :rspec) ? "spec" : ""
16
31
  end
17
32
 
18
33
  def reek_task
19
- "reek" if configuration.dig(:generate, :reek)
34
+ configuration.dig(:generate, :reek) ? "reek" : ""
20
35
  end
21
36
 
22
37
  def rubocop_task
23
- "rubocop" if configuration.dig(:generate, :rubocop)
38
+ configuration.dig(:generate, :rubocop) ? "rubocop" : ""
24
39
  end
25
40
 
26
41
  def scss_lint_task
27
- "scss_lint" if configuration.dig(:generate, :scss_lint)
42
+ configuration.dig(:generate, :scss_lint) ? "scss_lint" : ""
43
+ end
44
+
45
+ def code_quality_tasks
46
+ [reek_task, rubocop_task, scss_lint_task].compress.join " "
47
+ end
48
+
49
+ def code_quality_task
50
+ code_quality_tasks.empty? ? "" : "code_quality"
51
+ end
52
+
53
+ def default_task
54
+ [code_quality_task, rspec_task].compress.join " "
28
55
  end
29
56
 
30
- def default_tasks
31
- [rspec_task, reek_task, rubocop_task, scss_lint_task].compact
57
+ def append_code_quality_task
58
+ return if code_quality_task.empty?
59
+ cli.append_to_file "%gem_name%/Rakefile", generate_code_quality_task
32
60
  end
33
61
 
34
- def configure_rakefile
35
- return if default_tasks.empty?
36
- cli.append_to_file "%gem_name%/Rakefile",
37
- %(\ntask default: %w[#{default_tasks.join(" ")}]\n)
62
+ def append_default_task
63
+ return if default_task.empty?
64
+ cli.append_to_file "%gem_name%/Rakefile", generate_default_task
38
65
  end
39
66
  end
40
67
  end
@@ -12,7 +12,7 @@ module Gemsmith
12
12
  end
13
13
 
14
14
  def self.version
15
- "9.0.0"
15
+ "9.1.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -30,6 +30,7 @@ module Gemsmith
30
30
  @kernel = kernel
31
31
  end
32
32
 
33
+ # rubocop:disable Metrics/AbcSize
33
34
  def push
34
35
  creds = credentials.new key: gem_spec.allowed_push_key.to_sym,
35
36
  url: gem_spec.allowed_push_host
@@ -29,6 +29,8 @@ module Gemsmith
29
29
  @publisher = publisher
30
30
  end
31
31
 
32
+ # rubocop:disable Metrics/AbcSize
33
+ # rubocop:disable Metrics/MethodLength
32
34
  def install
33
35
  desc "Update README (table of contents)"
34
36
  task :doc do
@@ -1,9 +1,9 @@
1
- ---
1
+ prepare:
2
+ fetch:
3
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/v0.1.0/configurations/.rubocop.yml
2
4
  engines:
3
5
  shellcheck:
4
6
  enabled: true
5
- bundler-audit:
6
- enabled: true
7
7
  reek:
8
8
  enabled: <%= config.dig :generate, :reek %>
9
9
  rubocop:
@@ -16,13 +16,6 @@ engines:
16
16
  languages:
17
17
  - ruby
18
18
  - javascript
19
- fixme:
20
- enabled: true
21
- config:
22
- strings:
23
- - TODO
24
- - FIX
25
- - DUPLICATE
26
19
  ratings:
27
20
  paths:
28
21
  - "app/**/*"
@@ -1,4 +1,6 @@
1
1
  *.gem
2
2
  .bundle
3
+ .rubocop-http*
3
4
  pkg/*
4
5
  Gemfile.lock
6
+ tmp
@@ -1,50 +1,6 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/bkuhlmann/code_quality/v0.1.0/configurations/.rubocop.yml
1
3
  <%- if config.dig(:generate, :rails) -%>
2
- AllCops:
3
- Exclude:
4
- - "spec/dummy/**/*"
5
- - "bin/rails"
6
- - "vendor/**/*"
7
4
  Rails:
8
5
  Enabled: true
9
6
  <%- end -%>
10
- Style/AndOr:
11
- EnforcedStyle: conditionals
12
- Style/CaseIndentation:
13
- IndentOneStep: true
14
- Style/Documentation:
15
- Enabled: false
16
- Style/EmptyMethod:
17
- EnforcedStyle: expanded
18
- Style/MethodDefParentheses:
19
- EnforcedStyle: require_no_parentheses
20
- Style/NumericLiterals:
21
- Enabled: false
22
- Style/PercentLiteralDelimiters:
23
- PreferredDelimiters:
24
- "%w": "[]"
25
- "%W": "[]"
26
- "%i": "[]"
27
- "%I": "[]"
28
- "%r": "()"
29
- Style/SafeNavigation:
30
- Enabled: false
31
- Style/SignalException:
32
- EnforcedStyle: semantic
33
- Style/SingleLineBlockParams:
34
- Enabled: false
35
- Style/SpaceInsideHashLiteralBraces:
36
- EnforcedStyle: no_space
37
- Style/StringLiterals:
38
- EnforcedStyle: double_quotes
39
- Style/StringLiteralsInInterpolation:
40
- EnforcedStyle: double_quotes
41
- Style/VariableNumber:
42
- EnforcedStyle: snake_case
43
- Metrics/BlockLength:
44
- Exclude:
45
- - "**/*.gemspec"
46
- - "spec/**/*"
47
- Metrics/LineLength:
48
- Max: 100
49
- Metrics/ParameterLists:
50
- Max: 3
@@ -3,7 +3,7 @@ language: ruby
3
3
  gemfile:
4
4
  - gemfiles/rails-<%= config.dig(:versions, :rails) %>.x.gemfile
5
5
  <%- end -%>
6
- before_install: gem update --system && gem update && gem cleanup
6
+ before_install: gem update --system
7
7
  <%- if config.dig(:generate, :code_climate) -%>
8
8
  after_script: bundle exec codeclimate-test-reporter
9
9
  <%- end -%>
@@ -1,33 +1,25 @@
1
1
  # Overview
2
2
 
3
- Thanks for taking an interest in this open source project. Your support and involvement is greatly appreciated. The
4
- following details what you need to know in order to contribute.
3
+ Thanks for taking an interest in this open source project. Your support and involvement is greatly
4
+ appreciated. The following details what you need to know in order to contribute.
5
5
 
6
6
  # Requirements
7
7
 
8
- - Follow these [Basic Programming Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/basic.md).
9
- - Follow these [Code Review Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/code_reviews.md).
10
- - Follow these [Git Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/git.md).
11
- - Follow these [Bash Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/languages/bash.md).
12
- - Follow these [CSS Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/languages/css.md).
13
- - Follow these [Ruby Styles](https://github.com/bkuhlmann/style_guides/blob/master/programming/languages/ruby/ruby.md).
8
+ Read through the [Programming Style
9
+ Guides](https://github.com/bkuhlmann/style_guides/tree/master/programming).
14
10
 
15
11
  # Contributing Code
16
12
 
17
- 0. Read the project README thoroughly before starting.
18
- 0. Fork the master branch of the repository.
19
- 0. Ensure there are no setup, usage, and/or test issues (again, follow the README).
20
- 0. Add tests for new functionality (refactoring and documentation changes can be excluded).
21
- 0. Ensure all tests pass.
22
- 0. Push your feature branch and submit a pull request.
13
+ 0. Read the project README before starting.
14
+ 0. Fork the `master` branch of the repository.
15
+ 0. Ensure there are no setup, usage, and/or test issues (see README for details).
16
+ 0. Add tests for new functionality and ensure they pass.
17
+ 0. Submit a pull request and follow the instructions it provides.
23
18
 
24
19
  # Submitting Issues
25
20
 
26
21
  0. Submit an issue via the GitHub Issues tab (assuming one does not already exist).
27
- 0. Clearly describe the issue (including steps to reproduce).
28
- 0. Specify your enviroment setup (OS, browser, language, etc. with version info).
29
- 0. Provide a stack dump (if possible).
30
- 0. Explain any additional details that might help diagnose the problem quickly.
22
+ 0. Follow the instructions provided within the GitHub issue template.
31
23
 
32
24
  # Feedback
33
25
 
@@ -16,6 +16,7 @@ Dir[File.join(File.dirname(__FILE__), "support/shared_contexts/**/*.rb")].each d
16
16
  end
17
17
 
18
18
  RSpec.configure do |config|
19
+ config.color = true
19
20
  config.order = "random"
20
21
  config.disable_monkey_patching!
21
22
  config.filter_run_when_matching :focus
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: 9.0.0
4
+ version: 9.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -30,7 +30,7 @@ cert_chain:
30
30
  n/LUZ1dKhIHzfKx1B4+TEIefArObGfkLIDM8+Dq1RX7TF1k81Men7iu4MgE9bYBn
31
31
  3dE+xI3FdB5gWcdWxdtgRCmWjtXeYYyb4z6NQQ==
32
32
  -----END CERTIFICATE-----
33
- date: 2017-01-22 00:00:00.000000000 Z
33
+ date: 2017-02-05 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: bundler
@@ -457,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
457
457
  version: '0'
458
458
  requirements: []
459
459
  rubyforge_project:
460
- rubygems_version: 2.6.9
460
+ rubygems_version: 2.6.10
461
461
  signing_key:
462
462
  specification_version: 4
463
463
  summary: A command line interface for smithing new Ruby gems.
metadata.gz.sig CHANGED
Binary file