rubysmith 0.2.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.adoc +63 -38
- data/lib/rubysmith.rb +2 -1
- data/lib/rubysmith/builders/bundler.rb +6 -2
- data/lib/rubysmith/builders/documentation.rb +4 -2
- data/lib/rubysmith/builders/rake.rb +2 -2
- data/lib/rubysmith/builders/rspec/context.rb +4 -3
- data/lib/rubysmith/builders/rspec/helper.rb +1 -2
- data/lib/rubysmith/builders/rubocop/formatter.rb +33 -0
- data/lib/rubysmith/builders/rubocop/setup.rb +33 -0
- data/lib/rubysmith/cli/defaults.yml +4 -0
- data/lib/rubysmith/cli/parsers/build.rb +26 -1
- data/lib/rubysmith/cli/parsers/core.rb +5 -1
- data/lib/rubysmith/cli/processors/build.rb +33 -20
- data/lib/rubysmith/cli/shell.rb +9 -7
- data/lib/rubysmith/identity.rb +1 -1
- data/lib/rubysmith/realm.rb +4 -0
- data/lib/rubysmith/templates/%project_name%/Gemfile.erb +53 -30
- data/lib/rubysmith/templates/%project_name%/README.adoc.erb +8 -3
- data/lib/rubysmith/templates/%project_name%/README.md.erb +7 -3
- data/lib/rubysmith/templates/%project_name%/Rakefile.erb +9 -1
- data/lib/rubysmith/templates/%project_name%/bin/console.erb +3 -5
- data/lib/rubysmith/templates/%project_name%/spec/spec_helper.rb.erb +11 -5
- data/lib/rubysmith/templates/%project_name%/spec/support/shared_contexts/temp_dir.rb.erb +5 -3
- metadata +13 -194
- metadata.gz.sig +0 -0
- data/lib/rubysmith/builders/rubocop.rb +0 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 613f818841d26d35d707a4a014d7ce18f35b63167cc6e7f830ea045ee9987a53
|
4
|
+
data.tar.gz: c755c4375d9e6f784a570bbe69189529fe5a57d8ee402bda473e1a69534d5baf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c89a8f4692ec295585b752b14cb45ce3e20cece58287f98874ca65af25fd2ff87b227d862e880ceb6296eecd46f5aecb9825f43f5a87cf9a1a3cad05be6dc37
|
7
|
+
data.tar.gz: 6d8f894ee75c1e840442982ffd2534c233ab97406e1f8f85c3a00e8fda8feab57e3fc5c1f248665bf85e59ab1e602c0557d8f7d5cac50d01fa6b64c59bfa7ef5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
[link=http://badge.fury.io/rb/rubysmith]
|
8
8
|
image::https://badge.fury.io/rb/rubysmith.svg[Gem Version]
|
9
|
+
[link=https://www.alchemists.io/projects/code_quality]
|
10
|
+
image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
|
9
11
|
[link=https://circleci.com/gh/bkuhlmann/rubysmith]
|
10
12
|
image::https://circleci.com/gh/bkuhlmann/rubysmith.svg?style=svg[Circle CI Status]
|
11
13
|
|
@@ -24,14 +26,19 @@ toc::[]
|
|
24
26
|
* Uses link:https://www.alchemists.io/projects/refinements[Refinements] Ruby core library enhancements.
|
25
27
|
* Uses link:https://www.alchemists.io/projects/runcom[Runcom] for resource configuration management.
|
26
28
|
* Uses link:https://www.alchemists.io/projects/pragmater[Pragmater] for Ruby source pragma directives.
|
29
|
+
* Supports link:https://github.com/amazing-print/amazing_print[Amazing Print].
|
27
30
|
* Supports link:https://github.com/rubysec/bundler-audit[Bundler Audit].
|
31
|
+
* Supports link:https://github.com/rubymem/bundler-leak[Bundler Leak].
|
28
32
|
* Supports link:https://git-scm.com[Git].
|
29
33
|
* Supports link:https://www.alchemists.io/projects/git-lint[Git Lint].
|
30
34
|
* Supports link:https://github.com/guard/guard[Guard].
|
31
35
|
* Supports link:http://pryrepl.org[Pry].
|
32
36
|
* Supports link:https://github.com/troessner/reek[Reek].
|
37
|
+
* Supports link:https://www.alchemists.io/projects/refinements[Refinements].
|
33
38
|
* Supports link:https://rspec.info[RSpec].
|
34
39
|
* Supports link:https://github.com/rubocop-hq/rubocop[Rubocop].
|
40
|
+
* Supports link:https://docs.rubocop.org/rubocop-performance[Rubocop Performance].
|
41
|
+
* Supports link:https://github.com/rubocop-hq/rubocop-rake[Rubocop Rake].
|
35
42
|
* Supports link:https://github.com/rubocop-hq/rubocop-rspec[Rubocop RSpec].
|
36
43
|
* Supports link:https://github.com/simplecov-ruby/simplecov[SimpleCov].
|
37
44
|
* Supports common settings and a structured layout for building projects.
|
@@ -56,8 +63,6 @@ toc::[]
|
|
56
63
|
|
57
64
|
== Setup
|
58
65
|
|
59
|
-
=== Production
|
60
|
-
|
61
66
|
To install, run:
|
62
67
|
|
63
68
|
[source,bash]
|
@@ -65,24 +70,6 @@ To install, run:
|
|
65
70
|
gem install rubysmith
|
66
71
|
----
|
67
72
|
|
68
|
-
=== Development
|
69
|
-
|
70
|
-
To contribute, run:
|
71
|
-
|
72
|
-
[source,bash]
|
73
|
-
----
|
74
|
-
git clone https://github.com/bkuhlmann/rubysmith.git
|
75
|
-
cd rubysmith
|
76
|
-
bin/setup
|
77
|
-
----
|
78
|
-
|
79
|
-
You can also use the IRB console for direct access to all objects:
|
80
|
-
|
81
|
-
[source,bash]
|
82
|
-
----
|
83
|
-
bin/console
|
84
|
-
----
|
85
|
-
|
86
73
|
== Usage
|
87
74
|
|
88
75
|
=== Command Line Interface (CLI)
|
@@ -91,24 +78,28 @@ From the command line, type: `rubysmith --help`
|
|
91
78
|
|
92
79
|
....
|
93
80
|
USAGE:
|
94
|
-
-
|
95
|
-
-b, --build NAME [options] Build new gem.
|
81
|
+
-b, --build NAME [options] Build new project.
|
96
82
|
-v, --version Show gem version.
|
97
83
|
-h, --help Show this message.
|
84
|
+
-c, --config ACTION Manage gem configuration: edit or view.
|
98
85
|
|
99
86
|
BUILD OPTIONS:
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
87
|
+
--[no-]amazing_print Add Amazing Print.
|
88
|
+
--[no-]bundler-audit Add Bundler Audit.
|
89
|
+
--[no-]bundler-leak Add Bundler Leak.
|
90
|
+
--[no-]console Add console script.
|
91
|
+
--[no-]documentation Add documentation.
|
92
|
+
--[no-]git Add Git.
|
93
|
+
--[no-]git-lint Add Git Lint.
|
94
|
+
--[no-]guard Add Guard.
|
95
|
+
--[no-]pry Add Pry.
|
96
|
+
--[no-]reek Add Reek.
|
97
|
+
--[no-]refinements Add Refinements.
|
98
|
+
--[no-]rspec Add RSpec.
|
99
|
+
--[no-]rubocop Add Rubocop.
|
100
|
+
--[no-]setup Add setup script.
|
101
|
+
--[no-]simple_cov Add SimpleCov
|
102
|
+
--min Use minimum/no options.
|
112
103
|
....
|
113
104
|
|
114
105
|
=== Building
|
@@ -122,16 +113,28 @@ rubysmith --build demo
|
|
122
113
|
----
|
123
114
|
|
124
115
|
Running the above will generate a new `demo` Ruby project with all options enabled. Should you wish
|
125
|
-
to disable
|
116
|
+
to disable specific options, you can use the `--no-*` prefix. Example:
|
126
117
|
|
127
118
|
[source,bash]
|
128
119
|
----
|
129
120
|
rubysmith --build demo --no-pry --no-guard
|
130
121
|
----
|
131
122
|
|
132
|
-
|
133
|
-
|
134
|
-
|
123
|
+
With the above example, both Pry and Guard support would have been disabled when building the `demo`
|
124
|
+
project. Taking this a step further, you can also use the `--min` option to generate a project with
|
125
|
+
bare minimum of options. Example:
|
126
|
+
|
127
|
+
[source,bash]
|
128
|
+
----
|
129
|
+
rubysmith --build demo --min
|
130
|
+
----
|
131
|
+
|
132
|
+
The above is essentially the same as building with _all_ options disabled. This is handy in
|
133
|
+
situations where you need to quickly script something up for sharing with others yet still want to
|
134
|
+
avoid using a Bundler Inline script so gem dependencies are not installed each time the code is run.
|
135
|
+
|
136
|
+
To have specific options enabled/disabled _every time_ you build a new Ruby project, you can edit
|
137
|
+
your global configuration for making these settings permanent (see below for details).
|
135
138
|
|
136
139
|
=== Configuration
|
137
140
|
|
@@ -156,14 +159,18 @@ The default configuration is as follows:
|
|
156
159
|
:format: "md"
|
157
160
|
:license: "mit"
|
158
161
|
:build:
|
162
|
+
:amazing_print: true
|
159
163
|
:bundler_audit: true
|
164
|
+
:bundler_leak: true
|
160
165
|
:console: true
|
161
166
|
:documentation: true
|
162
167
|
:git: true
|
163
168
|
:git_lint: true
|
164
169
|
:guard: true
|
170
|
+
:minimum: false
|
165
171
|
:pry: true
|
166
172
|
:reek: true
|
173
|
+
:refinements: true
|
167
174
|
:rspec: true
|
168
175
|
:rubocop: true
|
169
176
|
:setup: true
|
@@ -185,6 +192,24 @@ The default configuration is as follows:
|
|
185
192
|
Feel free to take this default configuration, modify, and save as your own custom
|
186
193
|
`configuration.yml`.
|
187
194
|
|
195
|
+
== Development
|
196
|
+
|
197
|
+
To contribute, run:
|
198
|
+
|
199
|
+
[source,bash]
|
200
|
+
----
|
201
|
+
git clone https://github.com/bkuhlmann/rubysmith.git
|
202
|
+
cd rubysmith
|
203
|
+
bin/setup
|
204
|
+
----
|
205
|
+
|
206
|
+
You can also use the IRB console for direct access to all objects:
|
207
|
+
|
208
|
+
[source,bash]
|
209
|
+
----
|
210
|
+
bin/console
|
211
|
+
----
|
212
|
+
|
188
213
|
== Tests
|
189
214
|
|
190
215
|
To test, run:
|
data/lib/rubysmith.rb
CHANGED
@@ -20,7 +20,8 @@ require "rubysmith/builders/reek"
|
|
20
20
|
require "rubysmith/builders/rspec/context"
|
21
21
|
require "rubysmith/builders/rspec/helper"
|
22
22
|
require "rubysmith/builders/pragma"
|
23
|
-
require "rubysmith/builders/rubocop"
|
23
|
+
require "rubysmith/builders/rubocop/setup"
|
24
|
+
require "rubysmith/builders/rubocop/formatter"
|
24
25
|
require "rubysmith/cli/parsers/core"
|
25
26
|
require "rubysmith/cli/parsers/build"
|
26
27
|
require "rubysmith/cli/parsers/assembler"
|
@@ -20,8 +20,12 @@ module Rubysmith
|
|
20
20
|
def call
|
21
21
|
builder.call(realm.with(template_path: "%project_name%/Gemfile.erb"))
|
22
22
|
.render
|
23
|
-
.replace(
|
24
|
-
.replace(/\n\s
|
23
|
+
.replace(/\n\s+group/, "\n\ngroup")
|
24
|
+
.replace(/\n\s+gem/, "\n gem")
|
25
|
+
.replace(/ (?=.+refinements)/, "")
|
26
|
+
.replace(/(\n+|\s+)end/, "\nend")
|
27
|
+
.replace(/\n\ngroup :(code_quality|test|tools) do\nend/, "")
|
28
|
+
.replace(/org"\n+/, "org\"\n\n")
|
25
29
|
Dir.chdir(realm.project_root) { runner.start %w[install --quiet] }
|
26
30
|
nil
|
27
31
|
end
|
@@ -16,7 +16,7 @@ module Rubysmith
|
|
16
16
|
def call
|
17
17
|
return unless realm.build_documentation
|
18
18
|
|
19
|
-
private_methods.grep(/render_/).each
|
19
|
+
private_methods.grep(/render_/).each { |method| __send__ method }
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -45,7 +45,9 @@ module Rubysmith
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def render_readme
|
48
|
-
builder.call(realm.with(template_path: "%project_name%/README.#{kind}.erb"))
|
48
|
+
builder.call(realm.with(template_path: "%project_name%/README.#{kind}.erb"))
|
49
|
+
.render
|
50
|
+
.replace("\n\n\n", "\n\n")
|
49
51
|
end
|
50
52
|
|
51
53
|
def kind
|
@@ -16,11 +16,11 @@ module Rubysmith
|
|
16
16
|
def call
|
17
17
|
builder.call(realm.with(template_path: "%project_name%/Rakefile.erb"))
|
18
18
|
.render
|
19
|
-
.replace(/\A\n+/, "")
|
20
19
|
.replace(/\[\s+/, "[")
|
21
20
|
.replace(/\s+\]/, "]")
|
22
|
-
.replace(/\n{2,}/, "\n\n")
|
23
21
|
.replace(" ", "")
|
22
|
+
.replace(/\n+(?=require)/, "\n")
|
23
|
+
.replace(/\n{2,}/, "\n\n")
|
24
24
|
nil
|
25
25
|
end
|
26
26
|
|
@@ -17,9 +17,10 @@ module Rubysmith
|
|
17
17
|
def call
|
18
18
|
return unless realm.build_rspec
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
realm.with(template_path: "%project_name%/spec/support/shared_contexts/temp_dir.rb.erb")
|
21
|
+
.then { |new_realm| builder.call new_realm }
|
22
|
+
.render
|
23
|
+
.replace(/\n\s+\n\s+/, "\n ")
|
23
24
|
end
|
24
25
|
|
25
26
|
private
|
@@ -20,8 +20,7 @@ module Rubysmith
|
|
20
20
|
builder.call(realm.with(template_path: "%project_name%/spec/spec_helper.rb.erb"))
|
21
21
|
.render
|
22
22
|
.replace(/\n{3,}/, "\n\n")
|
23
|
-
.replace(
|
24
|
-
.replace(" Simple", "Simple")
|
23
|
+
.replace(/\n\s{2}(?=(require|Simple|using|Pathname|Dir))/, "\n")
|
25
24
|
end
|
26
25
|
|
27
26
|
private
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubocop"
|
4
|
+
require "refinements/ios"
|
5
|
+
|
6
|
+
module Rubysmith
|
7
|
+
module Builders
|
8
|
+
module Rubocop
|
9
|
+
# Executes Rubocop auto-correct on newly generated project.
|
10
|
+
class Formatter
|
11
|
+
using Refinements::IOs
|
12
|
+
|
13
|
+
def self.call realm
|
14
|
+
new(realm).call
|
15
|
+
end
|
16
|
+
|
17
|
+
def initialize realm, client: RuboCop::CLI.new
|
18
|
+
@realm = realm
|
19
|
+
@client = client
|
20
|
+
end
|
21
|
+
|
22
|
+
def call
|
23
|
+
STDOUT.squelch { client.run ["--auto-correct", realm.project_root.to_s] }
|
24
|
+
nil
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_reader :realm, :client
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Rubysmith
|
4
|
+
module Builders
|
5
|
+
module Rubocop
|
6
|
+
# Builds project skeleton for Rubocop code quality support.
|
7
|
+
class Setup
|
8
|
+
def self.call realm, builder: Builder
|
9
|
+
new(realm, builder: builder).call
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize realm, builder: Builder
|
13
|
+
@realm = realm
|
14
|
+
@builder = builder
|
15
|
+
end
|
16
|
+
|
17
|
+
def call
|
18
|
+
return unless realm.build_rubocop
|
19
|
+
|
20
|
+
builder.call(realm.with(template_path: "%project_name%/bin/rubocop.erb"))
|
21
|
+
.render
|
22
|
+
.permit 0o755
|
23
|
+
|
24
|
+
builder.call(realm.with(template_path: "%project_name%/.rubocop.yml.erb")).render
|
25
|
+
end
|
26
|
+
|
27
|
+
private
|
28
|
+
|
29
|
+
attr_reader :realm, :builder
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -8,14 +8,18 @@
|
|
8
8
|
:format: "md"
|
9
9
|
:license: "mit"
|
10
10
|
:build:
|
11
|
+
:amazing_print: true
|
11
12
|
:bundler_audit: true
|
13
|
+
:bundler_leak: true
|
12
14
|
:console: true
|
13
15
|
:documentation: true
|
14
16
|
:git: true
|
15
17
|
:git_lint: true
|
16
18
|
:guard: true
|
19
|
+
:minimum: false
|
17
20
|
:pry: true
|
18
21
|
:reek: true
|
22
|
+
:refinements: true
|
19
23
|
:rspec: true
|
20
24
|
:rubocop: true
|
21
25
|
:setup: true
|
@@ -4,6 +4,7 @@ module Rubysmith
|
|
4
4
|
module CLI
|
5
5
|
module Parsers
|
6
6
|
# Handles parsing of Command Line Interface (CLI) build options.
|
7
|
+
# :reek:TooManyMethods
|
7
8
|
class Build
|
8
9
|
def self.call client:, options:
|
9
10
|
new(client: client, options: options).call
|
@@ -16,7 +17,7 @@ module Rubysmith
|
|
16
17
|
|
17
18
|
def call arguments = []
|
18
19
|
client.separator "\nBUILD OPTIONS:\n"
|
19
|
-
private_methods.grep(/add_/).each
|
20
|
+
private_methods.grep(/add_/).each { |method| __send__ method }
|
20
21
|
arguments.empty? ? arguments : client.parse!(arguments)
|
21
22
|
end
|
22
23
|
|
@@ -24,12 +25,30 @@ module Rubysmith
|
|
24
25
|
|
25
26
|
attr_reader :client, :options
|
26
27
|
|
28
|
+
def add_minimum
|
29
|
+
client.on "--min", "Use minimum/no options." do |value|
|
30
|
+
options[:build_minimum] = value
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_amazing_print
|
35
|
+
client.on "--[no-]amazing_print", "Add Amazing Print." do |value|
|
36
|
+
options[:build_amazing_print] = value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
27
40
|
def add_bundler_audit
|
28
41
|
client.on "--[no-]bundler-audit", "Add Bundler Audit." do |value|
|
29
42
|
options[:build_bundler_audit] = value
|
30
43
|
end
|
31
44
|
end
|
32
45
|
|
46
|
+
def add_bundler_leak
|
47
|
+
client.on "--[no-]bundler-leak", "Add Bundler Leak." do |value|
|
48
|
+
options[:build_bundler_leak] = value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
33
52
|
def add_console
|
34
53
|
client.on "--[no-]console", "Add console script." do |value|
|
35
54
|
options[:build_console] = value
|
@@ -72,6 +91,12 @@ module Rubysmith
|
|
72
91
|
end
|
73
92
|
end
|
74
93
|
|
94
|
+
def add_refinements
|
95
|
+
client.on "--[no-]refinements", "Add Refinements." do |value|
|
96
|
+
options[:build_refinements] = value
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
75
100
|
def add_rspec
|
76
101
|
client.on "--[no-]rspec", "Add RSpec." do |value|
|
77
102
|
options[:build_rspec] = value
|
@@ -19,7 +19,7 @@ module Rubysmith
|
|
19
19
|
def call arguments = []
|
20
20
|
client.banner = "#{Identity::LABEL} - #{Identity::SUMMARY}"
|
21
21
|
client.separator "\nUSAGE:\n"
|
22
|
-
|
22
|
+
collate
|
23
23
|
arguments.empty? ? arguments : client.parse!(arguments)
|
24
24
|
end
|
25
25
|
|
@@ -27,6 +27,10 @@ module Rubysmith
|
|
27
27
|
|
28
28
|
attr_reader :client, :options
|
29
29
|
|
30
|
+
def collate
|
31
|
+
private_methods.grep(/add_/).each { |method| __send__ method }
|
32
|
+
end
|
33
|
+
|
30
34
|
def add_config
|
31
35
|
client.on "-c",
|
32
36
|
"--config ACTION",
|
@@ -3,32 +3,45 @@
|
|
3
3
|
module Rubysmith
|
4
4
|
module CLI
|
5
5
|
module Processors
|
6
|
-
# Order is important.
|
7
|
-
BUILDERS = [
|
8
|
-
Builders::Core,
|
9
|
-
Builders::Documentation,
|
10
|
-
Builders::Git::Setup,
|
11
|
-
Builders::Bundler,
|
12
|
-
Builders::Rake,
|
13
|
-
Builders::Console,
|
14
|
-
Builders::Setup,
|
15
|
-
Builders::Guard,
|
16
|
-
Builders::Reek,
|
17
|
-
Builders::RSpec::Context,
|
18
|
-
Builders::RSpec::Helper,
|
19
|
-
Builders::Pragma,
|
20
|
-
Builders::Rubocop,
|
21
|
-
Builders::Git::Commit
|
22
|
-
].freeze
|
23
|
-
|
24
6
|
# Handles the Command Line Interface (CLI) for building of a project skeleton.
|
25
7
|
class Build
|
26
|
-
|
8
|
+
# Order is important.
|
9
|
+
MINIMUM = [
|
10
|
+
Builders::Core,
|
11
|
+
Builders::Bundler,
|
12
|
+
Builders::Pragma,
|
13
|
+
Builders::Rubocop::Formatter
|
14
|
+
].freeze
|
15
|
+
|
16
|
+
# Order is important.
|
17
|
+
MAXIMUM = [
|
18
|
+
Builders::Core,
|
19
|
+
Builders::Documentation,
|
20
|
+
Builders::Git::Setup,
|
21
|
+
Builders::Bundler,
|
22
|
+
Builders::Rake,
|
23
|
+
Builders::Console,
|
24
|
+
Builders::Setup,
|
25
|
+
Builders::Guard,
|
26
|
+
Builders::Reek,
|
27
|
+
Builders::RSpec::Context,
|
28
|
+
Builders::RSpec::Helper,
|
29
|
+
Builders::Pragma,
|
30
|
+
Builders::Rubocop::Setup,
|
31
|
+
Builders::Rubocop::Formatter,
|
32
|
+
Builders::Git::Commit
|
33
|
+
].freeze
|
34
|
+
|
35
|
+
def self.with_minimum
|
36
|
+
new builders: MINIMUM
|
37
|
+
end
|
38
|
+
|
39
|
+
def initialize builders: MAXIMUM
|
27
40
|
@builders = builders
|
28
41
|
end
|
29
42
|
|
30
43
|
def call options
|
31
|
-
Realm[**options].then
|
44
|
+
Realm[**options].then { |realm| process realm }
|
32
45
|
end
|
33
46
|
|
34
47
|
private
|
data/lib/rubysmith/cli/shell.rb
CHANGED
@@ -11,7 +11,8 @@ module Rubysmith
|
|
11
11
|
|
12
12
|
PROCESSORS = {
|
13
13
|
config: Processors::Config.new,
|
14
|
-
|
14
|
+
build_minimum: Processors::Build.with_minimum,
|
15
|
+
build_maximum: Processors::Build.new
|
15
16
|
}.freeze
|
16
17
|
|
17
18
|
def initialize parser: Parsers::Assembler.new, processors: PROCESSORS
|
@@ -23,8 +24,9 @@ module Rubysmith
|
|
23
24
|
parse arguments
|
24
25
|
|
25
26
|
case options
|
26
|
-
in config: action, **remainder then
|
27
|
-
in
|
27
|
+
in config: action, **remainder then process_config action
|
28
|
+
in build_minimum: true, **remainder then process_build :build_minimum, options
|
29
|
+
in build:, **remainder then process_build :build_maximum, options
|
28
30
|
in version:, **remainder then puts version
|
29
31
|
in help:, **remainder then usage
|
30
32
|
else usage
|
@@ -41,12 +43,12 @@ module Rubysmith
|
|
41
43
|
puts error.message
|
42
44
|
end
|
43
45
|
|
44
|
-
def
|
45
|
-
processors.fetch(
|
46
|
+
def process_config action
|
47
|
+
processors.fetch(:config).call action
|
46
48
|
end
|
47
49
|
|
48
|
-
def
|
49
|
-
processors.fetch(
|
50
|
+
def process_build kind, settings
|
51
|
+
processors.fetch(kind).call settings.rekey(build: :project_name).merge(now: Time.now)
|
50
52
|
end
|
51
53
|
|
52
54
|
def options
|
data/lib/rubysmith/identity.rb
CHANGED
data/lib/rubysmith/realm.rb
CHANGED
@@ -16,7 +16,10 @@ module Rubysmith
|
|
16
16
|
now
|
17
17
|
documentation_format
|
18
18
|
documentation_license
|
19
|
+
build_minimum
|
20
|
+
build_amazing_print
|
19
21
|
build_bundler_audit
|
22
|
+
build_bundler_leak
|
20
23
|
build_console
|
21
24
|
build_documentation
|
22
25
|
build_git
|
@@ -24,6 +27,7 @@ module Rubysmith
|
|
24
27
|
build_guard
|
25
28
|
build_pry
|
26
29
|
build_reek
|
30
|
+
build_refinements
|
27
31
|
build_rspec
|
28
32
|
build_rubocop
|
29
33
|
build_setup
|
@@ -1,33 +1,56 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
<% if realm.
|
5
|
-
gem "
|
3
|
+
<% unless realm.build_minimum %>
|
4
|
+
<% if realm.build_refinements %>
|
5
|
+
gem "refinements", "~> 7.16"
|
6
6
|
<% end %>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
7
|
+
|
8
|
+
group :code_quality do
|
9
|
+
<% if realm.build_bundler_audit %>
|
10
|
+
gem "bundler-audit", "~> 0.7"
|
11
|
+
<% end %>
|
12
|
+
<% if realm.build_bundler_leak %>
|
13
|
+
gem "bundler-leak", "~> 0.2"
|
14
|
+
<% end %>
|
15
|
+
<% if realm.build_git && realm.build_git_lint %>
|
16
|
+
gem "git-lint", "~> 1.3"
|
17
|
+
<% end %>
|
18
|
+
<% if realm.build_reek %>
|
19
|
+
gem "reek", "~> 6.0"
|
20
|
+
<% end %>
|
21
|
+
<% if realm.build_rubocop %>
|
22
|
+
gem "rubocop", "~> 1.5"
|
23
|
+
gem "rubocop-performance", "~> 1.9"
|
24
|
+
gem "rubocop-rake", "~> 0.5"
|
25
|
+
<% end %>
|
26
|
+
<% if realm.build_rspec && realm.build_rubocop %>
|
27
|
+
gem "rubocop-rspec", "~> 2.0"
|
28
|
+
<% end %>
|
29
|
+
<% if realm.build_simple_cov %>
|
30
|
+
gem "simplecov", "~> 0.20"
|
31
|
+
<% end %>
|
32
|
+
end
|
33
|
+
|
34
|
+
group :development do
|
35
|
+
gem "rake", "~> 13.0"
|
36
|
+
end
|
37
|
+
|
38
|
+
group :test do
|
39
|
+
<% if realm.build_guard %>
|
40
|
+
gem "guard-rspec", "~> 4.7", require: false
|
41
|
+
<% end %>
|
42
|
+
<% if realm.build_rspec %>
|
43
|
+
gem "rspec", "~> 3.10"
|
44
|
+
<% end %>
|
45
|
+
end
|
46
|
+
|
47
|
+
group :tools do
|
48
|
+
<% if realm.build_amazing_print %>
|
49
|
+
gem "amazing_print", "~> 1.2"
|
50
|
+
<% end %>
|
51
|
+
<% if realm.build_pry %>
|
52
|
+
gem "pry", "~> 0.13"
|
53
|
+
gem "pry-byebug", "~> 3.9"
|
54
|
+
<% end %>
|
55
|
+
end
|
56
|
+
<% end %>
|
@@ -4,6 +4,11 @@
|
|
4
4
|
|
5
5
|
= <%= realm.project_label %>
|
6
6
|
|
7
|
+
<% if realm.build_rubocop %>
|
8
|
+
[link=https://www.alchemists.io/projects/code_quality]
|
9
|
+
image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
|
10
|
+
<% end %>
|
11
|
+
|
7
12
|
toc::[]
|
8
13
|
|
9
14
|
== Features
|
@@ -26,11 +31,11 @@ bin/setup
|
|
26
31
|
<% end %>
|
27
32
|
|
28
33
|
== Usage
|
29
|
-
<% if realm.build_console %>
|
30
34
|
|
31
|
-
|
35
|
+
== Development
|
36
|
+
<% if realm.build_console %>
|
32
37
|
|
33
|
-
|
38
|
+
You can also use the IRB console for direct access to all objects:
|
34
39
|
|
35
40
|
[source,bash]
|
36
41
|
----
|
@@ -1,5 +1,9 @@
|
|
1
1
|
# <%= realm.project_label %>
|
2
2
|
|
3
|
+
<% if realm.build_rubocop %>
|
4
|
+
[![Alchemists Style Guide](https://img.shields.io/badge/code_style-alchemists-brightgreen.svg)](https://www.alchemists.io/projects/code_quality)
|
5
|
+
<% end %>
|
6
|
+
|
3
7
|
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
4
8
|
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
5
9
|
|
@@ -20,11 +24,11 @@ To set up the project, run:
|
|
20
24
|
<% end %>
|
21
25
|
|
22
26
|
## Usage
|
23
|
-
<% if realm.build_console %>
|
24
27
|
|
25
|
-
|
28
|
+
## Development
|
29
|
+
<% if realm.build_console %>
|
26
30
|
|
27
|
-
|
31
|
+
You can also use the IRB console for direct access to all objects:
|
28
32
|
|
29
33
|
bin/console
|
30
34
|
<% end %>
|
@@ -1,6 +1,11 @@
|
|
1
|
+
require "bundler/setup"
|
2
|
+
|
1
3
|
<% if realm.build_bundler_audit %>
|
2
4
|
require "bundler/audit/task"
|
3
5
|
<% end %>
|
6
|
+
<% if realm.build_bundler_leak %>
|
7
|
+
require "bundler/plumber/task"
|
8
|
+
<% end %>
|
4
9
|
<% if realm.build_git && realm.build_git_lint %>
|
5
10
|
require "git/lint/rake/setup"
|
6
11
|
<% end %>
|
@@ -17,6 +22,9 @@
|
|
17
22
|
<% if realm.build_bundler_audit %>
|
18
23
|
Bundler::Audit::Task.new
|
19
24
|
<% end %>
|
25
|
+
<% if realm.build_bundler_leak %>
|
26
|
+
Bundler::Plumber::Task.new
|
27
|
+
<% end %>
|
20
28
|
<% if realm.build_reek %>
|
21
29
|
Reek::Rake::Task.new
|
22
30
|
<% end %>
|
@@ -28,6 +36,6 @@
|
|
28
36
|
<% end %>
|
29
37
|
|
30
38
|
desc "Run code quality checks"
|
31
|
-
task code_quality: %i[<% if realm.build_bundler_audit %>bundle:audit<% end %> <% if realm.build_git && realm.build_git_lint %>git_lint<% end %> <% if realm.build_reek %>reek<% end %> <% if realm.build_rubocop %>rubocop<% end %>]
|
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 %>]
|
32
40
|
|
33
41
|
task default: %i[code_quality <% if realm.build_rspec %>spec<% end %>]
|
@@ -1,11 +1,9 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
require
|
5
|
-
|
6
|
-
|
7
|
-
require "pry-byebug"
|
8
|
-
<% end %>
|
4
|
+
Bundler.require :tools
|
5
|
+
|
6
|
+
require_relative "../lib/<%= realm.project_name %>"
|
9
7
|
require "irb"
|
10
8
|
|
11
9
|
IRB.start __FILE__
|
@@ -1,16 +1,22 @@
|
|
1
1
|
require "bundler/setup"
|
2
|
+
Bundler.require :tools
|
2
3
|
|
3
4
|
<% if realm.build_simple_cov %>
|
4
5
|
require "simplecov"
|
5
6
|
SimpleCov.start { enable_coverage :branch }
|
6
7
|
<% end %>
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
require "
|
11
|
-
|
9
|
+
require "<%= realm.project_name %>"
|
10
|
+
<% if realm.build_refinements %>
|
11
|
+
require "refinements"
|
12
|
+
|
13
|
+
using Refinements::Pathnames
|
12
14
|
|
13
|
-
|
15
|
+
Pathname.require_tree __dir__, "support/shared_contexts/**/*.rb"
|
16
|
+
<% else %>
|
17
|
+
|
18
|
+
Dir[File.join(__dir__, "support", "shared_contexts", "**/*.rb")].sort.each { |path| require path }
|
19
|
+
<% end %>
|
14
20
|
|
15
21
|
RSpec.configure do |config|
|
16
22
|
config.color = true
|
@@ -1,9 +1,11 @@
|
|
1
1
|
RSpec.shared_context "with temporary directory", :temp_dir do
|
2
|
-
|
2
|
+
<% if realm.build_refinements %>using Refinements::Pathnames<% end %>
|
3
|
+
|
4
|
+
let(:temp_dir) { Bundler.root.join "tmp/rspec" }
|
3
5
|
|
4
6
|
around do |example|
|
5
|
-
FileUtils.mkdir_p temp_dir
|
7
|
+
<%= realm.build_refinements ? "temp_dir.make_path" : "FileUtils.mkdir_p temp_dir" %>
|
6
8
|
example.run
|
7
|
-
FileUtils.rm_rf temp_dir
|
9
|
+
<%= realm.build_refinements ? "temp_dir.remove_tree" : "FileUtils.rm_rf temp_dir" %>
|
8
10
|
end
|
9
11
|
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.
|
4
|
+
version: 0.6.1
|
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-
|
31
|
+
date: 2020-12-11 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: pragmater
|
@@ -36,238 +36,56 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '8.
|
39
|
+
version: '8.1'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '8.
|
46
|
+
version: '8.1'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: refinements
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '7.
|
53
|
+
version: '7.16'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '7.
|
60
|
+
version: '7.16'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rubocop
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '1.5'
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '1.5'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: runcom
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '6.
|
81
|
+
version: '6.4'
|
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: '6.
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: bundler-audit
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0.7'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0.7'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: gemsmith
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '14.6'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '14.6'
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: git-lint
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '1.0'
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '1.0'
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: guard-rspec
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
134
|
-
requirements:
|
135
|
-
- - "~>"
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
version: '4.7'
|
138
|
-
type: :development
|
139
|
-
prerelease: false
|
140
|
-
version_requirements: !ruby/object:Gem::Requirement
|
141
|
-
requirements:
|
142
|
-
- - "~>"
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: '4.7'
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
name: pry
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - "~>"
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '0.13'
|
152
|
-
type: :development
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - "~>"
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '0.13'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: pry-byebug
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: '3.9'
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '3.9'
|
173
|
-
- !ruby/object:Gem::Dependency
|
174
|
-
name: rake
|
175
|
-
requirement: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '13.0'
|
180
|
-
type: :development
|
181
|
-
prerelease: false
|
182
|
-
version_requirements: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '13.0'
|
187
|
-
- !ruby/object:Gem::Dependency
|
188
|
-
name: reek
|
189
|
-
requirement: !ruby/object:Gem::Requirement
|
190
|
-
requirements:
|
191
|
-
- - "~>"
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: '6.0'
|
194
|
-
type: :development
|
195
|
-
prerelease: false
|
196
|
-
version_requirements: !ruby/object:Gem::Requirement
|
197
|
-
requirements:
|
198
|
-
- - "~>"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '6.0'
|
201
|
-
- !ruby/object:Gem::Dependency
|
202
|
-
name: rspec
|
203
|
-
requirement: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '3.9'
|
208
|
-
type: :development
|
209
|
-
prerelease: false
|
210
|
-
version_requirements: !ruby/object:Gem::Requirement
|
211
|
-
requirements:
|
212
|
-
- - "~>"
|
213
|
-
- !ruby/object:Gem::Version
|
214
|
-
version: '3.9'
|
215
|
-
- !ruby/object:Gem::Dependency
|
216
|
-
name: rubocop-performance
|
217
|
-
requirement: !ruby/object:Gem::Requirement
|
218
|
-
requirements:
|
219
|
-
- - "~>"
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: '1.8'
|
222
|
-
type: :development
|
223
|
-
prerelease: false
|
224
|
-
version_requirements: !ruby/object:Gem::Requirement
|
225
|
-
requirements:
|
226
|
-
- - "~>"
|
227
|
-
- !ruby/object:Gem::Version
|
228
|
-
version: '1.8'
|
229
|
-
- !ruby/object:Gem::Dependency
|
230
|
-
name: rubocop-rake
|
231
|
-
requirement: !ruby/object:Gem::Requirement
|
232
|
-
requirements:
|
233
|
-
- - "~>"
|
234
|
-
- !ruby/object:Gem::Version
|
235
|
-
version: '0.5'
|
236
|
-
type: :development
|
237
|
-
prerelease: false
|
238
|
-
version_requirements: !ruby/object:Gem::Requirement
|
239
|
-
requirements:
|
240
|
-
- - "~>"
|
241
|
-
- !ruby/object:Gem::Version
|
242
|
-
version: '0.5'
|
243
|
-
- !ruby/object:Gem::Dependency
|
244
|
-
name: rubocop-rspec
|
245
|
-
requirement: !ruby/object:Gem::Requirement
|
246
|
-
requirements:
|
247
|
-
- - "~>"
|
248
|
-
- !ruby/object:Gem::Version
|
249
|
-
version: '1.43'
|
250
|
-
type: :development
|
251
|
-
prerelease: false
|
252
|
-
version_requirements: !ruby/object:Gem::Requirement
|
253
|
-
requirements:
|
254
|
-
- - "~>"
|
255
|
-
- !ruby/object:Gem::Version
|
256
|
-
version: '1.43'
|
257
|
-
- !ruby/object:Gem::Dependency
|
258
|
-
name: simplecov
|
259
|
-
requirement: !ruby/object:Gem::Requirement
|
260
|
-
requirements:
|
261
|
-
- - "~>"
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
version: '0.19'
|
264
|
-
type: :development
|
265
|
-
prerelease: false
|
266
|
-
version_requirements: !ruby/object:Gem::Requirement
|
267
|
-
requirements:
|
268
|
-
- - "~>"
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
version: '0.19'
|
88
|
+
version: '6.4'
|
271
89
|
description:
|
272
90
|
email:
|
273
91
|
- brooke@alchemists.io
|
@@ -295,7 +113,8 @@ files:
|
|
295
113
|
- lib/rubysmith/builders/reek.rb
|
296
114
|
- lib/rubysmith/builders/rspec/context.rb
|
297
115
|
- lib/rubysmith/builders/rspec/helper.rb
|
298
|
-
- lib/rubysmith/builders/rubocop.rb
|
116
|
+
- lib/rubysmith/builders/rubocop/formatter.rb
|
117
|
+
- lib/rubysmith/builders/rubocop/setup.rb
|
299
118
|
- lib/rubysmith/builders/setup.rb
|
300
119
|
- lib/rubysmith/cli/configuration.rb
|
301
120
|
- lib/rubysmith/cli/defaults.yml
|
@@ -359,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
178
|
- !ruby/object:Gem::Version
|
360
179
|
version: '0'
|
361
180
|
requirements: []
|
362
|
-
rubygems_version: 3.
|
181
|
+
rubygems_version: 3.2.0
|
363
182
|
signing_key:
|
364
183
|
specification_version: 4
|
365
184
|
summary: A command line interface for smithing Ruby projects.
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "rubocop"
|
4
|
-
require "stringio"
|
5
|
-
|
6
|
-
module Rubysmith
|
7
|
-
module Builders
|
8
|
-
# Builds project skeleton Rubocop code quality support.
|
9
|
-
class Rubocop
|
10
|
-
def self.call realm, builder: Builder
|
11
|
-
new(realm, builder: builder).call
|
12
|
-
end
|
13
|
-
|
14
|
-
def initialize realm, builder: Builder, runner: RuboCop::CLI.new
|
15
|
-
@realm = realm
|
16
|
-
@builder = builder
|
17
|
-
@runner = runner
|
18
|
-
end
|
19
|
-
|
20
|
-
def call
|
21
|
-
return unless realm.build_rubocop
|
22
|
-
|
23
|
-
builder.call(realm.with(template_path: "%project_name%/bin/rubocop.erb"))
|
24
|
-
.render
|
25
|
-
.permit 0o755
|
26
|
-
|
27
|
-
builder.call(realm.with(template_path: "%project_name%/.rubocop.yml.erb")).render
|
28
|
-
auto_correct
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
attr_reader :realm, :builder, :runner
|
34
|
-
|
35
|
-
def auto_correct
|
36
|
-
backup = $stdout
|
37
|
-
$stdout = StringIO.new
|
38
|
-
runner.run ["--auto-correct", "--format", "quiet", realm.project_root.to_s]
|
39
|
-
$stdout = backup
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|