rubysmith 0.6.1 → 0.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: 613f818841d26d35d707a4a014d7ce18f35b63167cc6e7f830ea045ee9987a53
4
- data.tar.gz: c755c4375d9e6f784a570bbe69189529fe5a57d8ee402bda473e1a69534d5baf
3
+ metadata.gz: bd9ee381ebc8f67ae293544be845606f47500fb44529b127936d89b071d77af8
4
+ data.tar.gz: 25a4b4469bbd3e5b7e43874e7552e94da1156682c15248c91cb2a16073290a33
5
5
  SHA512:
6
- metadata.gz: 1c89a8f4692ec295585b752b14cb45ce3e20cece58287f98874ca65af25fd2ff87b227d862e880ceb6296eecd46f5aecb9825f43f5a87cf9a1a3cad05be6dc37
7
- data.tar.gz: 6d8f894ee75c1e840442982ffd2534c233ab97406e1f8f85c3a00e8fda8feab57e3fc5c1f248665bf85e59ab1e602c0557d8f7d5cac50d01fa6b64c59bfa7ef5
6
+ metadata.gz: a83315a0432b40b43ebc89efaf7cd79d42f9886e711440698b5550e8e90e5ba442d78f655951684ff6c533b4bd07ab3237de60ef037a2c010bf5871859615b0d
7
+ data.tar.gz: 272bdef0ba9dfa1842af8b8715d554f28a83fb86174a762fff42e97ae4c7b8d52b549f702bcb75f0ad87af4ace2901e954cece399f2e8a6ec9b0025b460206b4
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -23,7 +23,6 @@ toc::[]
23
23
  == Features
24
24
 
25
25
  * Builds a Ruby project skeleton for custom design and development.
26
- * Uses link:https://www.alchemists.io/projects/refinements[Refinements] Ruby core library enhancements.
27
26
  * Uses link:https://www.alchemists.io/projects/runcom[Runcom] for resource configuration management.
28
27
  * Uses link:https://www.alchemists.io/projects/pragmater[Pragmater] for Ruby source pragma directives.
29
28
  * Supports link:https://github.com/amazing-print/amazing_print[Amazing Print].
@@ -40,6 +39,7 @@ toc::[]
40
39
  * Supports link:https://docs.rubocop.org/rubocop-performance[Rubocop Performance].
41
40
  * Supports link:https://github.com/rubocop-hq/rubocop-rake[Rubocop Rake].
42
41
  * Supports link:https://github.com/rubocop-hq/rubocop-rspec[Rubocop RSpec].
42
+ * Supports link:https://github.com/whitesmith/RubyCritic[RubyCritic].
43
43
  * Supports link:https://github.com/simplecov-ruby/simplecov[SimpleCov].
44
44
  * Supports common settings and a structured layout for building projects.
45
45
  * Provides common documentation:
@@ -97,8 +97,9 @@ BUILD OPTIONS:
97
97
  --[no-]refinements Add Refinements.
98
98
  --[no-]rspec Add RSpec.
99
99
  --[no-]rubocop Add Rubocop.
100
+ --[no-]ruby_critic Add RubyCritic.
100
101
  --[no-]setup Add setup script.
101
- --[no-]simple_cov Add SimpleCov
102
+ --[no-]simple_cov Add SimpleCov.
102
103
  --min Use minimum/no options.
103
104
  ....
104
105
 
@@ -173,6 +174,7 @@ The default configuration is as follows:
173
174
  :refinements: true
174
175
  :rspec: true
175
176
  :rubocop: true
177
+ :ruby_critic: true
176
178
  :setup: true
177
179
  :simple_cov: true
178
180
  :builders:
@@ -22,6 +22,7 @@ require "rubysmith/builders/rspec/helper"
22
22
  require "rubysmith/builders/pragma"
23
23
  require "rubysmith/builders/rubocop/setup"
24
24
  require "rubysmith/builders/rubocop/formatter"
25
+ require "rubysmith/builders/ruby_critic"
25
26
  require "rubysmith/cli/parsers/core"
26
27
  require "rubysmith/cli/parsers/build"
27
28
  require "rubysmith/cli/parsers/assembler"
@@ -10,10 +10,7 @@ module Rubysmith
10
10
  class Builder
11
11
  using Refinements::Pathnames
12
12
 
13
- LOGGER = Logger.new(
14
- STDOUT,
15
- formatter: ->(severity, _at, _program, message) { "#{severity} #{message}\n" }
16
- )
13
+ LOGGER = Logger.new(STDOUT, formatter: ->(_severity, _at, _program, message) { "#{message}\n" })
17
14
 
18
15
  HELPERS = {
19
16
  inserter: Text::Inserter,
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubysmith
4
+ module Builders
5
+ # Builds project skeleton RubyCritic code quality support.
6
+ class RubyCritic
7
+ def self.call realm, builder: Builder
8
+ new(realm, builder: builder).call
9
+ end
10
+
11
+ def initialize realm, builder: Builder
12
+ @realm = realm
13
+ @builder = builder
14
+ end
15
+
16
+ def call
17
+ return unless realm.build_ruby_critic
18
+
19
+ builder.call(realm.with(template_path: "%project_name%/.rubycritic.yml.erb")).render
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :realm, :builder
25
+ end
26
+ end
27
+ end
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "yaml"
3
+ require "pathname"
4
4
  require "refinements/hashes"
5
5
  require "runcom"
6
+ require "yaml"
6
7
 
7
8
  module Rubysmith
8
9
  module CLI
@@ -22,6 +22,7 @@
22
22
  :refinements: true
23
23
  :rspec: true
24
24
  :rubocop: true
25
+ :ruby_critic: true
25
26
  :setup: true
26
27
  :simple_cov: true
27
28
  :builders:
@@ -109,6 +109,12 @@ module Rubysmith
109
109
  end
110
110
  end
111
111
 
112
+ def add_ruby_critic
113
+ client.on "--[no-]ruby_critic", "Add RubyCritic." do |value|
114
+ options[:build_ruby_critic] = value
115
+ end
116
+ end
117
+
112
118
  def add_setup
113
119
  client.on "--[no-]setup", "Add setup script." do |value|
114
120
  options[:build_setup] = value
@@ -29,6 +29,7 @@ module Rubysmith
29
29
  Builders::Pragma,
30
30
  Builders::Rubocop::Setup,
31
31
  Builders::Rubocop::Formatter,
32
+ Builders::RubyCritic,
32
33
  Builders::Git::Commit
33
34
  ].freeze
34
35
 
@@ -4,7 +4,7 @@ module Rubysmith
4
4
  module Identity
5
5
  NAME = "rubysmith"
6
6
  LABEL = "Rubysmith"
7
- VERSION = "0.6.1"
7
+ VERSION = "0.7.0"
8
8
  VERSION_LABEL = "#{LABEL} #{VERSION}"
9
9
  SUMMARY = "A command line interface for smithing Ruby projects."
10
10
  end
@@ -30,6 +30,7 @@ module Rubysmith
30
30
  build_refinements
31
31
  build_rspec
32
32
  build_rubocop
33
+ build_ruby_critic
33
34
  build_setup
34
35
  build_simple_cov
35
36
  builders_pragmater_comments
@@ -0,0 +1,3 @@
1
+ paths:
2
+ - "lib"
3
+ no_browser: true
@@ -26,6 +26,9 @@ source "https://rubygems.org"
26
26
  <% if realm.build_rspec && realm.build_rubocop %>
27
27
  gem "rubocop-rspec", "~> 2.0"
28
28
  <% end %>
29
+ <% if realm.build_ruby_critic %>
30
+ gem "rubycritic", "~> 4.5", require: false
31
+ <% end %>
29
32
  <% if realm.build_simple_cov %>
30
33
  gem "simplecov", "~> 0.20"
31
34
  <% end %>
@@ -18,6 +18,9 @@ require "bundler/setup"
18
18
  <% if realm.build_rubocop %>
19
19
  require "rubocop/rake_task"
20
20
  <% end %>
21
+ <% if realm.build_ruby_critic %>
22
+ require "rubycritic/rake_task"
23
+ <% end %>
21
24
 
22
25
  <% if realm.build_bundler_audit %>
23
26
  Bundler::Audit::Task.new
@@ -34,8 +37,11 @@ require "bundler/setup"
34
37
  <% if realm.build_rubocop %>
35
38
  RuboCop::RakeTask.new
36
39
  <% end %>
40
+ <% if realm.build_ruby_critic %>
41
+ RubyCritic::RakeTask.new
42
+ <% end %>
37
43
 
38
44
  desc "Run code quality checks"
39
- task code_quality: %i[<% if realm.build_bundler_audit %>bundle:audit<% end %> <% if realm.build_bundler_leak %>bundle:leak<% end %> <% if realm.build_git && realm.build_git_lint %>git_lint<% end %> <% if realm.build_reek %>reek<% end %> <% if realm.build_rubocop %>rubocop<% end %>]
45
+ task code_quality: %i[<% if realm.build_bundler_audit %>bundle:audit<% end %> <% if realm.build_bundler_leak %>bundle:leak<% end %> <% if realm.build_git && realm.build_git_lint %>git_lint<% end %> <% if realm.build_reek %>reek<% end %> <% if realm.build_rubocop %>rubocop<% end %> <% if realm.build_ruby_critic %>rubycritic<% end %>]
40
46
 
41
47
  task default: %i[code_quality <% if realm.build_rspec %>spec<% end %>]
@@ -1,6 +1,5 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require "rubygems"
4
3
  require "bundler/setup"
5
4
 
6
5
  load Gem.bin_path "guard", "guard"
@@ -1,7 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require "rubygems"
5
4
  require "bundler/setup"
6
5
 
7
6
  load Gem.bin_path "rubocop", "rubocop"
@@ -0,0 +1,3 @@
1
+ # The project namespace.
2
+ module <%= realm.project_class %>
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.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-12-11 00:00:00.000000000 Z
31
+ date: 2020-12-13 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: pragmater
@@ -115,6 +115,7 @@ files:
115
115
  - lib/rubysmith/builders/rspec/helper.rb
116
116
  - lib/rubysmith/builders/rubocop/formatter.rb
117
117
  - lib/rubysmith/builders/rubocop/setup.rb
118
+ - lib/rubysmith/builders/ruby_critic.rb
118
119
  - lib/rubysmith/builders/setup.rb
119
120
  - lib/rubysmith/cli/configuration.rb
120
121
  - lib/rubysmith/cli/defaults.yml
@@ -132,6 +133,7 @@ files:
132
133
  - lib/rubysmith/templates/%project_name%/.reek.yml.erb
133
134
  - lib/rubysmith/templates/%project_name%/.rubocop.yml.erb
134
135
  - lib/rubysmith/templates/%project_name%/.ruby-version.erb
136
+ - lib/rubysmith/templates/%project_name%/.rubycritic.yml.erb
135
137
  - lib/rubysmith/templates/%project_name%/CHANGES.adoc.erb
136
138
  - lib/rubysmith/templates/%project_name%/CHANGES.md.erb
137
139
  - lib/rubysmith/templates/%project_name%/CODE_OF_CONDUCT.adoc.erb
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- JL���Q#F
2
- PA%�'���a�_�?=}� ٨1�S��i�.k��K�� ����V�4� n�4~-�ˠk��D e��M�#��~�T������*�E��`ˡ�Oq�w�|�Bb�W�Z���z��{n��8\X�]��Ù<_��U˟��P^�=�Fy9)Ȱ����J%+w�L��Ì���a�)rQ��e�+�dĠ���8�3\У|ے�?����Ă[���S�M0���#�o-�|���#���B�
1
+ ��c��҉>7<ݥd2�c?sS��kE�L>Ȟ�R� �(�U5�5[8C�#��|Sm����ֳj���{U�*!����$ͫhF��������E�$f�Ø<:���`��c x7B0Meɸ�5�?_�rݧnJ��5E�<�s:�X�0o� :�Z�M_�͚�C���BB-�a�dne1�!�z;;�>\��:d���a�+ ��m1f*p.�k4BwXR'�iW
2
+ Z��