gemsmith 10.4.2 → 11.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 +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/LICENSE.md +163 -20
- data/README.md +8 -23
- data/lib/gemsmith.rb +0 -1
- data/lib/gemsmith/cli.rb +10 -14
- data/lib/gemsmith/credentials.rb +1 -0
- data/lib/gemsmith/gem/module_formatter.rb +1 -1
- data/lib/gemsmith/generators/cli.rb +1 -0
- data/lib/gemsmith/generators/gem.rb +1 -0
- data/lib/gemsmith/generators/pragma.rb +3 -2
- data/lib/gemsmith/generators/rails.rb +3 -0
- data/lib/gemsmith/generators/rake.rb +1 -6
- data/lib/gemsmith/identity.rb +1 -1
- data/lib/gemsmith/rake/publisher.rb +2 -0
- data/lib/gemsmith/rake/tasks.rb +2 -0
- data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +1 -5
- data/lib/gemsmith/templates/%gem_name%/.codeclimate.yml.tt +40 -34
- data/lib/gemsmith/templates/%gem_name%/README.md.tt +3 -5
- data/lib/gemsmith/templates/%gem_name%/Rakefile.tt +0 -2
- metadata +23 -24
- metadata.gz.sig +0 -0
- data/lib/gemsmith/generators/scss_lint.rb +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31a29c937bfb001a0f3a67e9029f3147ea4cb3df3dc3adc6f5f2e8f8f7c9b946
|
|
4
|
+
data.tar.gz: 7ffc75e5444ca44c5f169e93c0e790a73e29c5042f2f478dfe0f064034968304
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af33a2c99f10c9077d98f1ac0e133844ed5e9eaca9015764145e244685beadebe26da36e5b422f58e0dfb63a8f4fccdf8be34df11148b230a22323d0ff1772f5
|
|
7
|
+
data.tar.gz: 36ac766c917bb59e01cdadd91a17289fd1c6e7b48964915b01d1301cee87a05b2826350a2cf9a436628e4b806ccd56a3e69359cff28111395805c73774715603
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
*�����dK�g��8��2��ˋ�O�U���h
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/LICENSE.md
CHANGED
|
@@ -1,20 +1,163 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
# Apache License
|
|
2
|
+
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
|
|
5
|
+
http://www.apache.org/licenses
|
|
6
|
+
|
|
7
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
8
|
+
|
|
9
|
+
## 1. Definitions
|
|
10
|
+
|
|
11
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by
|
|
12
|
+
Sections 1 through 9 of this document.
|
|
13
|
+
|
|
14
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is
|
|
15
|
+
granting the License.
|
|
16
|
+
|
|
17
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are
|
|
18
|
+
controlled by, or are under common control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the direction or management of such
|
|
20
|
+
entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this
|
|
24
|
+
License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to
|
|
27
|
+
software source code, documentation source, and configuration files.
|
|
28
|
+
|
|
29
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a
|
|
30
|
+
Source form, including but not limited to compiled object code, generated documentation, and
|
|
31
|
+
conversions to other media types.
|
|
32
|
+
|
|
33
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the
|
|
34
|
+
License, as indicated by a copyright notice that is included in or attached to the work (an example
|
|
35
|
+
is provided in the Appendix below).
|
|
36
|
+
|
|
37
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or
|
|
38
|
+
derived from) the Work and for which the editorial revisions, annotations, elaborations, or other
|
|
39
|
+
modifications represent, as a whole, an original work of authorship. For the purposes of this
|
|
40
|
+
License, Derivative Works shall not include works that remain separable from, or merely link (or
|
|
41
|
+
bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
42
|
+
|
|
43
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any
|
|
44
|
+
modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted
|
|
45
|
+
to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity
|
|
46
|
+
authorized to submit on behalf of the copyright owner. For the purposes of this definition,
|
|
47
|
+
"submitted" means any form of electronic, verbal, or written communication sent to the Licensor or
|
|
48
|
+
its representatives, including but not limited to communication on electronic mailing lists, source
|
|
49
|
+
code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor
|
|
50
|
+
for the purpose of discussing and improving the Work, but excluding communication that is
|
|
51
|
+
conspicuously marked or otherwise designated in writing by the copyright owner as "Not a
|
|
52
|
+
Contribution."
|
|
53
|
+
|
|
54
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a
|
|
55
|
+
Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
56
|
+
|
|
57
|
+
## 2. Grant of Copyright License
|
|
58
|
+
|
|
59
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a
|
|
60
|
+
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to
|
|
61
|
+
reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and
|
|
62
|
+
distribute the Work and such Derivative Works in Source or Object form.
|
|
63
|
+
|
|
64
|
+
## 3. Grant of Patent License
|
|
65
|
+
|
|
66
|
+
Subject to the terms and conditions of this License, each Contributor hereby grants to You a
|
|
67
|
+
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
|
|
68
|
+
section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer
|
|
69
|
+
the Work, where such license applies only to those patent claims licensable by such Contributor that
|
|
70
|
+
are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s)
|
|
71
|
+
with the Work to which such Contribution(s) was submitted. If You institute patent litigation
|
|
72
|
+
against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or
|
|
73
|
+
a Contribution incorporated within the Work constitutes direct or contributory patent infringement,
|
|
74
|
+
then any patent licenses granted to You under this License for that Work shall terminate as of the
|
|
75
|
+
date such litigation is filed.
|
|
76
|
+
|
|
77
|
+
## 4. Redistribution
|
|
78
|
+
|
|
79
|
+
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with
|
|
80
|
+
or without modifications, and in Source or Object form, provided that You meet the following
|
|
81
|
+
conditions:
|
|
82
|
+
|
|
83
|
+
1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
84
|
+
|
|
85
|
+
2. You must cause any modified files to carry prominent notices stating that You changed the
|
|
86
|
+
files; and
|
|
87
|
+
|
|
88
|
+
3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright,
|
|
89
|
+
patent, trademark, and attribution notices from the Source form of the Work, excluding those
|
|
90
|
+
notices that do not pertain to any part of the Derivative Works; and
|
|
91
|
+
|
|
92
|
+
4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative
|
|
93
|
+
Works that You distribute must include a readable copy of the attribution notices contained
|
|
94
|
+
within such NOTICE file, excluding those notices that do not pertain to any part of the
|
|
95
|
+
Derivative Works, in at least one of the following places: within a NOTICE text file
|
|
96
|
+
distributed as part of the Derivative Works; within the Source form or documentation, if
|
|
97
|
+
provided along with the Derivative Works; or, within a display generated by the Derivative
|
|
98
|
+
Works, if and wherever such third-party notices normally appear. The contents of the NOTICE
|
|
99
|
+
file are for informational purposes only and do not modify the License. You may add Your own
|
|
100
|
+
attribution notices within Derivative Works that You distribute, alongside or as an addendum to
|
|
101
|
+
the NOTICE text from the Work, provided that such additional attribution notices cannot be
|
|
102
|
+
construed as modifying the License.
|
|
103
|
+
|
|
104
|
+
You may add Your own copyright statement to Your modifications and may provide additional or
|
|
105
|
+
different license terms and conditions for use, reproduction, or distribution of Your modifications,
|
|
106
|
+
or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of
|
|
107
|
+
the Work otherwise complies with the conditions stated in this License.
|
|
108
|
+
|
|
109
|
+
## 5. Submission of Contributions
|
|
110
|
+
|
|
111
|
+
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the
|
|
112
|
+
Work by You to the Licensor shall be under the terms and conditions of this License, without any
|
|
113
|
+
additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify
|
|
114
|
+
the terms of any separate license agreement you may have executed with Licensor regarding such
|
|
115
|
+
Contributions.
|
|
116
|
+
|
|
117
|
+
## 6. Trademarks
|
|
118
|
+
|
|
119
|
+
This License does not grant permission to use the trade names, trademarks, service marks, or product
|
|
120
|
+
names of the Licensor, except as required for reasonable and customary use in describing the origin
|
|
121
|
+
of the Work and reproducing the content of the NOTICE file.
|
|
122
|
+
|
|
123
|
+
## 7. Disclaimer of Warranty
|
|
124
|
+
|
|
125
|
+
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each
|
|
126
|
+
Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
127
|
+
KIND, either express or implied, including, without limitation, any warranties or conditions of
|
|
128
|
+
TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely
|
|
129
|
+
responsible for determining the appropriateness of using or redistributing the Work and assume any
|
|
130
|
+
risks associated with Your exercise of permissions under this License.
|
|
131
|
+
|
|
132
|
+
## 8. Limitation of Liability
|
|
133
|
+
|
|
134
|
+
In no event and under no legal theory, whether in tort (including negligence), contract, or
|
|
135
|
+
otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or
|
|
136
|
+
agreed to in writing, shall any Contributor be liable to You for damages, including any direct,
|
|
137
|
+
indirect, special, incidental, or consequential damages of any character arising as a result of this
|
|
138
|
+
License or out of the use or inability to use the Work (including but not limited to damages for
|
|
139
|
+
loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial
|
|
140
|
+
damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
141
|
+
|
|
142
|
+
## 9. Accepting Warranty or Additional Liability
|
|
143
|
+
|
|
144
|
+
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee
|
|
145
|
+
for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights
|
|
146
|
+
consistent with this License. However, in accepting such obligations, You may act only on Your own
|
|
147
|
+
behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You
|
|
148
|
+
agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or
|
|
149
|
+
claims asserted against, such Contributor by reason of your accepting any such warranty or
|
|
150
|
+
additional liability.
|
|
151
|
+
|
|
152
|
+
END OF TERMS AND CONDITIONS
|
|
153
|
+
|
|
154
|
+
Copyright 2011 [Alchemists](https://www.alchemists.io).
|
|
155
|
+
|
|
156
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
|
157
|
+
compliance with the License. You may obtain a [copy](http://www.apache.org/licenses/LICENSE-2.0) of
|
|
158
|
+
the License.
|
|
159
|
+
|
|
160
|
+
Unless required by applicable law or agreed to in writing, software distributed under the License is
|
|
161
|
+
distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
162
|
+
implied. See the License for the specific language governing permissions and limitations under the
|
|
163
|
+
License.
|
data/README.md
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
# Gemsmith
|
|
2
2
|
|
|
3
3
|
[](http://badge.fury.io/rb/gemsmith)
|
|
4
|
-
[](https://codeclimate.com/github/bkuhlmann/gemsmith/maintainability)
|
|
5
|
+
[](https://codeclimate.com/github/bkuhlmann/gemsmith/test_coverage)
|
|
6
6
|
[](https://gemnasium.com/bkuhlmann/gemsmith)
|
|
7
7
|
[](https://circleci.com/gh/bkuhlmann/gemsmith)
|
|
8
|
-
[](https://www.patreon.com/bkuhlmann)
|
|
9
8
|
|
|
10
9
|
A command line interface for smithing new Ruby gems.
|
|
11
10
|
|
|
@@ -57,14 +56,12 @@ A command line interface for smithing new Ruby gems.
|
|
|
57
56
|
- Supports [Git Cop](https://github.com/bkuhlmann/git-cop).
|
|
58
57
|
- Supports [GitHub](https://github.com).
|
|
59
58
|
- Supports [Guard](https://github.com/guard/guard).
|
|
60
|
-
- Supports [Patreon](https://www.patreon.com).
|
|
61
59
|
- Supports [Pry](http://pryrepl.org).
|
|
62
60
|
- Supports [Reek](https://github.com/troessner/reek).
|
|
63
61
|
- Supports [RSpec](http://rspec.info).
|
|
64
62
|
- Supports [Rubocop](https://github.com/bbatsov/rubocop).
|
|
65
63
|
- Supports [Ruby on Rails](http://rubyonrails.org).
|
|
66
64
|
- Supports [RubyGems Security](http://guides.rubygems.org/security).
|
|
67
|
-
- Supports [SCSS Lint](https://github.com/brigade/scss-lint).
|
|
68
65
|
- Supports [Thor](https://github.com/erikhuda/thor).
|
|
69
66
|
- Supports common settings and a structured layout for building gems.
|
|
70
67
|
- Supports publishing to public or private gem servers.
|
|
@@ -92,16 +89,7 @@ A command line interface for smithing new Ruby gems.
|
|
|
92
89
|
|
|
93
90
|
### Install
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
gem cert --add <(curl --location --silent https://www.alchemists.io/gem-public.pem)
|
|
98
|
-
gem install gemsmith --trust-policy MediumSecurity
|
|
99
|
-
|
|
100
|
-
NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification
|
|
101
|
-
while allowing the installation of unsigned dependencies since they are beyond the scope of this
|
|
102
|
-
gem.
|
|
103
|
-
|
|
104
|
-
For an insecure install, type the following (not recommended):
|
|
92
|
+
Type the following to install:
|
|
105
93
|
|
|
106
94
|
gem install gemsmith
|
|
107
95
|
|
|
@@ -137,22 +125,20 @@ The default configuration is as follows:
|
|
|
137
125
|
:ruby: "<current Ruby version>"
|
|
138
126
|
:rails: "5.1"
|
|
139
127
|
:generate:
|
|
140
|
-
:bundler_audit:
|
|
128
|
+
:bundler_audit: true
|
|
141
129
|
:circle_ci: false
|
|
142
130
|
:cli: false
|
|
143
131
|
:code_climate: false
|
|
144
132
|
:gemnasium: false
|
|
145
133
|
:git_cop: true
|
|
146
|
-
:git_hub:
|
|
134
|
+
:git_hub: true
|
|
147
135
|
:guard: true
|
|
148
|
-
:patreon: false
|
|
149
136
|
:pry: true
|
|
150
137
|
:rails: false
|
|
151
138
|
:reek: true
|
|
152
139
|
:rspec: true
|
|
153
140
|
:rubocop: true
|
|
154
|
-
:
|
|
155
|
-
:security: true
|
|
141
|
+
:security: false
|
|
156
142
|
:publish:
|
|
157
143
|
:sign: false
|
|
158
144
|
|
|
@@ -198,6 +184,7 @@ From the command line, type: `gemsmith --help`
|
|
|
198
184
|
For more gem generation options, type: `gemsmith --help --generate`
|
|
199
185
|
|
|
200
186
|
[--bundler-audit], [--no-bundler-audit] # Add Bundler Audit support.
|
|
187
|
+
# Default: true
|
|
201
188
|
[--circle-ci], [--no-circle-ci] # Add Circle CI support.
|
|
202
189
|
[--cli], [--no-cli] # Add CLI support.
|
|
203
190
|
[--code-climate], [--no-code-climate] # Add Code Climate support.
|
|
@@ -205,9 +192,9 @@ For more gem generation options, type: `gemsmith --help --generate`
|
|
|
205
192
|
[--git-cop], [--no-git-cop] # Add Git Cop support.
|
|
206
193
|
# Default: true
|
|
207
194
|
[--git-hub], [--no-git-hub] # Add GitHub support.
|
|
195
|
+
# Default: true
|
|
208
196
|
[--guard], [--no-guard] # Add Guard support.
|
|
209
197
|
# Default: true
|
|
210
|
-
[--patreon], [--no-patreon] # Add Patreon support.
|
|
211
198
|
[--pry], [--no-pry] # Add Pry support.
|
|
212
199
|
# Default: true
|
|
213
200
|
[--rails], [--no-rails] # Add Rails support.
|
|
@@ -217,9 +204,7 @@ For more gem generation options, type: `gemsmith --help --generate`
|
|
|
217
204
|
# Default: true
|
|
218
205
|
[--rubocop], [--no-rubocop] # Add Rubocop support.
|
|
219
206
|
# Default: true
|
|
220
|
-
[--scss-lint], [--no-scss-lint] # Add SCSS Lint support.
|
|
221
207
|
[--security], [--no-security] # Add security support.
|
|
222
|
-
# Default: true
|
|
223
208
|
|
|
224
209
|
### Rake
|
|
225
210
|
|
data/lib/gemsmith.rb
CHANGED
|
@@ -30,7 +30,6 @@ require "gemsmith/generators/reek"
|
|
|
30
30
|
require "gemsmith/generators/rspec"
|
|
31
31
|
require "gemsmith/generators/rubocop"
|
|
32
32
|
require "gemsmith/generators/ruby"
|
|
33
|
-
require "gemsmith/generators/scss_lint"
|
|
34
33
|
require "gemsmith/rake/builder"
|
|
35
34
|
require "gemsmith/rake/publisher"
|
|
36
35
|
require "gemsmith/rake/tasks"
|
data/lib/gemsmith/cli.rb
CHANGED
|
@@ -54,29 +54,29 @@ module Gemsmith
|
|
|
54
54
|
rails: "5.1"
|
|
55
55
|
},
|
|
56
56
|
generate: {
|
|
57
|
-
bundler_audit:
|
|
57
|
+
bundler_audit: true,
|
|
58
58
|
circle_ci: false,
|
|
59
59
|
cli: false,
|
|
60
60
|
code_climate: false,
|
|
61
61
|
gemnasium: false,
|
|
62
62
|
git_cop: true,
|
|
63
|
-
git_hub:
|
|
63
|
+
git_hub: true,
|
|
64
64
|
guard: true,
|
|
65
|
-
patreon: false,
|
|
66
65
|
pry: true,
|
|
67
66
|
rails: false,
|
|
68
67
|
reek: true,
|
|
69
68
|
rspec: true,
|
|
70
69
|
rubocop: true,
|
|
71
|
-
|
|
72
|
-
security: true
|
|
70
|
+
security: false
|
|
73
71
|
},
|
|
74
72
|
publish: {
|
|
75
73
|
sign: false
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
76
|
end
|
|
77
|
+
# rubocop:enable Metrics/MethodLength
|
|
79
78
|
|
|
79
|
+
# rubocop:disable Metrics/MethodLength
|
|
80
80
|
def self.generators
|
|
81
81
|
[
|
|
82
82
|
Generators::Gem,
|
|
@@ -90,7 +90,6 @@ module Gemsmith
|
|
|
90
90
|
Generators::GitCop,
|
|
91
91
|
Generators::Reek,
|
|
92
92
|
Generators::Rubocop,
|
|
93
|
-
Generators::SCSSLint,
|
|
94
93
|
Generators::CodeClimate,
|
|
95
94
|
Generators::Guard,
|
|
96
95
|
Generators::CircleCI,
|
|
@@ -100,6 +99,7 @@ module Gemsmith
|
|
|
100
99
|
Generators::Git
|
|
101
100
|
]
|
|
102
101
|
end
|
|
102
|
+
# rubocop:enable Metrics/MethodLength
|
|
103
103
|
|
|
104
104
|
# Initialize.
|
|
105
105
|
def initialize args = [], options = {}, config = {}
|
|
@@ -143,10 +143,6 @@ module Gemsmith
|
|
|
143
143
|
desc: "Add Guard support.",
|
|
144
144
|
type: :boolean,
|
|
145
145
|
default: configuration.to_h.dig(:generate, :guard)
|
|
146
|
-
method_option :patreon,
|
|
147
|
-
desc: "Add Patreon support.",
|
|
148
|
-
type: :boolean,
|
|
149
|
-
default: configuration.to_h.dig(:generate, :patreon)
|
|
150
146
|
method_option :pry,
|
|
151
147
|
desc: "Add Pry support.",
|
|
152
148
|
type: :boolean,
|
|
@@ -167,10 +163,6 @@ module Gemsmith
|
|
|
167
163
|
desc: "Add Rubocop support.",
|
|
168
164
|
type: :boolean,
|
|
169
165
|
default: configuration.to_h.dig(:generate, :rubocop)
|
|
170
|
-
method_option :scss_lint,
|
|
171
|
-
desc: "Add SCSS Lint support.",
|
|
172
|
-
type: :boolean,
|
|
173
|
-
default: configuration.to_h.dig(:generate, :scss_lint)
|
|
174
166
|
method_option :security,
|
|
175
167
|
desc: "Add security support.",
|
|
176
168
|
type: :boolean,
|
|
@@ -187,6 +179,7 @@ module Gemsmith
|
|
|
187
179
|
|
|
188
180
|
say_status :info, "Gem generation finished.", :green
|
|
189
181
|
end
|
|
182
|
+
# rubocop:enable Metrics/AbcSize
|
|
190
183
|
|
|
191
184
|
desc "-o, [--open=GEM]", "Open a gem in default editor."
|
|
192
185
|
map %w[-o --open] => :open
|
|
@@ -237,6 +230,7 @@ module Gemsmith
|
|
|
237
230
|
attr_reader :configuration
|
|
238
231
|
|
|
239
232
|
# :reek:FeatureEnvy
|
|
233
|
+
# rubocop:disable Metrics/MethodLength
|
|
240
234
|
def setup_configuration name:, options: {}
|
|
241
235
|
@configuration = configuration.to_h.merge(
|
|
242
236
|
gem: {
|
|
@@ -251,6 +245,7 @@ module Gemsmith
|
|
|
251
245
|
generate: options.symbolize_keys
|
|
252
246
|
)
|
|
253
247
|
end
|
|
248
|
+
# rubocop:enable Metrics/MethodLength
|
|
254
249
|
|
|
255
250
|
def print_cli_and_rails_engine_option_error
|
|
256
251
|
say_status :error,
|
|
@@ -259,4 +254,5 @@ module Gemsmith
|
|
|
259
254
|
:red
|
|
260
255
|
end
|
|
261
256
|
end
|
|
257
|
+
# rubocop:enable Metrics/ClassLength
|
|
262
258
|
end
|
data/lib/gemsmith/credentials.rb
CHANGED
|
@@ -33,7 +33,7 @@ module Gemsmith
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def body content
|
|
36
|
-
content.
|
|
36
|
+
content.lstrip.split("\n").reduce "" do |body, line|
|
|
37
37
|
next "#{body}\n" if line.blank?
|
|
38
38
|
body + "#{self.class.indent depth + 1}#{line.gsub(/^\s{2}/, "")}\n"
|
|
39
39
|
end
|
|
@@ -12,7 +12,7 @@ module Gemsmith
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# rubocop:disable Metrics/MethodLength
|
|
15
|
-
def
|
|
15
|
+
def includes
|
|
16
16
|
%W[
|
|
17
17
|
**/*Gemfile
|
|
18
18
|
**/*Guardfile
|
|
@@ -30,12 +30,13 @@ module Gemsmith
|
|
|
30
30
|
**/*.rb
|
|
31
31
|
]
|
|
32
32
|
end
|
|
33
|
+
# rubocop:enable Metrics/MethodLength
|
|
33
34
|
|
|
34
35
|
def run
|
|
35
36
|
Pragmater::Runner.new(
|
|
36
37
|
gem_root,
|
|
37
38
|
comments: self.class.comments,
|
|
38
|
-
|
|
39
|
+
includes: includes
|
|
39
40
|
).run action: :add
|
|
40
41
|
end
|
|
41
42
|
end
|
|
@@ -27,18 +27,21 @@ module Gemsmith
|
|
|
27
27
|
cli.template "#{generator_root}/upgrade/upgrade_generator.rb.tt", configuration
|
|
28
28
|
cli.template "#{generator_root}/upgrade/USAGE.tt", configuration
|
|
29
29
|
end
|
|
30
|
+
# rubocop:enable Metrics/AbcSize
|
|
30
31
|
|
|
31
32
|
def stub_assets
|
|
32
33
|
cli.run %(printf "%s" > "#{gem_name}/app/assets/javascripts/#{gem_path}/application.js")
|
|
33
34
|
cli.run %(printf "%s" > "#{gem_name}/app/assets/stylesheets/#{gem_path}/application.css")
|
|
34
35
|
end
|
|
35
36
|
|
|
37
|
+
# rubocop:disable Metrics/AbcSize
|
|
36
38
|
def remove_files
|
|
37
39
|
cli.remove_file "#{gem_name}/app/helpers/#{gem_path}/application_helper.rb", configuration
|
|
38
40
|
cli.remove_file "#{gem_name}/lib/#{gem_path}/version.rb", configuration
|
|
39
41
|
cli.remove_file "#{gem_name}/MIT-LICENSE", configuration
|
|
40
42
|
cli.remove_file "#{gem_name}/README.rdoc", configuration
|
|
41
43
|
end
|
|
44
|
+
# rubocop:enable Metrics/AbcSize
|
|
42
45
|
|
|
43
46
|
# :reek:TooManyStatements
|
|
44
47
|
def run
|
|
@@ -46,17 +46,12 @@ module Gemsmith
|
|
|
46
46
|
configuration.dig(:generate, :rubocop) ? "rubocop" : ""
|
|
47
47
|
end
|
|
48
48
|
|
|
49
|
-
def scss_lint_task
|
|
50
|
-
configuration.dig(:generate, :scss_lint) ? "scss_lint" : ""
|
|
51
|
-
end
|
|
52
|
-
|
|
53
49
|
def code_quality_tasks
|
|
54
50
|
[
|
|
55
51
|
bundler_audit_task,
|
|
56
52
|
git_cop_task,
|
|
57
53
|
reek_task,
|
|
58
|
-
rubocop_task
|
|
59
|
-
scss_lint_task
|
|
54
|
+
rubocop_task
|
|
60
55
|
].compress.join " "
|
|
61
56
|
end
|
|
62
57
|
|
data/lib/gemsmith/identity.rb
CHANGED
|
@@ -31,6 +31,7 @@ module Gemsmith
|
|
|
31
31
|
@shell = shell
|
|
32
32
|
@kernel = kernel
|
|
33
33
|
end
|
|
34
|
+
# rubocop:enable Metrics/ParameterLists
|
|
34
35
|
|
|
35
36
|
# rubocop:disable Metrics/AbcSize
|
|
36
37
|
def push
|
|
@@ -41,6 +42,7 @@ module Gemsmith
|
|
|
41
42
|
status = kernel.system %(gem push "pkg/#{gem_spec.package_file_name}" #{options})
|
|
42
43
|
process_push status
|
|
43
44
|
end
|
|
45
|
+
# rubocop:enable Metrics/AbcSize
|
|
44
46
|
|
|
45
47
|
def publish
|
|
46
48
|
publisher.publish gem_spec.version_number, sign: signed?
|
data/lib/gemsmith/rake/tasks.rb
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
$LOAD_PATH.
|
|
1
|
+
$LOAD_PATH.append File.expand_path("../lib", __FILE__)
|
|
2
2
|
require "<%= config.dig(:gem, :path) %>/identity"
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |spec|
|
|
@@ -10,7 +10,6 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.homepage = "<%= config.dig(:gem, :url) %>"
|
|
11
11
|
spec.summary = ""
|
|
12
12
|
spec.license = "MIT"
|
|
13
|
-
|
|
14
13
|
<%- if config.dig(:generate, :security) -%>
|
|
15
14
|
if File.exist?(Gem.default_key_path) && File.exist?(Gem.default_cert_path)
|
|
16
15
|
spec.signing_key = Gem.default_key_path
|
|
@@ -53,9 +52,6 @@ Gem::Specification.new do |spec|
|
|
|
53
52
|
<%- if config.dig(:generate, :rubocop) -%>
|
|
54
53
|
spec.add_development_dependency "rubocop", "~> 0.51"
|
|
55
54
|
<%- end -%>
|
|
56
|
-
<%- if config.dig(:generate, :scss_lint) -%>
|
|
57
|
-
spec.add_development_dependency "scss_lint", "~> 0.50"
|
|
58
|
-
<%- end -%>
|
|
59
55
|
|
|
60
56
|
<%- if config.dig(:generate, :rails) -%>
|
|
61
57
|
spec.files = Dir["app/**/*", "bin/**/*", "config/**/*", "lib/**/*", "vendor/**/*"]
|
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
- "
|
|
34
|
-
- "
|
|
1
|
+
version: 2
|
|
2
|
+
checks:
|
|
3
|
+
argument-count:
|
|
4
|
+
config:
|
|
5
|
+
threshold: 3
|
|
6
|
+
complex-logic:
|
|
7
|
+
config:
|
|
8
|
+
threshold: 3
|
|
9
|
+
file-lines:
|
|
10
|
+
config:
|
|
11
|
+
threshold: 250
|
|
12
|
+
method-complexity:
|
|
13
|
+
config:
|
|
14
|
+
threshold: 3
|
|
15
|
+
method-count:
|
|
16
|
+
config:
|
|
17
|
+
threshold: 20
|
|
18
|
+
method-lines:
|
|
19
|
+
config:
|
|
20
|
+
threshold: 20
|
|
21
|
+
nested-control-flow:
|
|
22
|
+
config:
|
|
23
|
+
threshold: 3
|
|
24
|
+
return-statements:
|
|
25
|
+
config:
|
|
26
|
+
threshold: 3
|
|
27
|
+
similar-code:
|
|
28
|
+
enabled: false
|
|
29
|
+
identical-code:
|
|
30
|
+
config:
|
|
31
|
+
threshold: 3
|
|
32
|
+
exclude_patterns:
|
|
33
|
+
- "config/"
|
|
34
|
+
- "db/"
|
|
35
|
+
- "**/elm-stuff/"
|
|
36
|
+
- "**/node_modules/"
|
|
37
|
+
- "**/spec/"
|
|
38
|
+
- "**/test/"
|
|
39
|
+
- "**/tests/"
|
|
40
|
+
- "**/vendor/"
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[ %>.svg)](http://badge.fury.io/rb/<%= config.dig(:gem, :name) %>)
|
|
4
4
|
<%- if config.dig(:generate, :code_climate) -%>
|
|
5
|
-
|
|
6
|
-
[](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>/maintainability)
|
|
7
|
+
[](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>/test_coverage)
|
|
7
8
|
<%- end -%>
|
|
8
9
|
<%- if config.dig(:generate, :gemnasium) -%>
|
|
9
10
|
[ %>.svg)](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>)
|
|
@@ -11,9 +12,6 @@
|
|
|
11
12
|
<%- if config.dig(:generate, :circle_ci) -%>
|
|
12
13
|
[](https://circleci.com/gh/<%= config.fetch :github_user %>/<%= config.dig :gem, :name %>)
|
|
13
14
|
<%- end -%>
|
|
14
|
-
<%- if config.dig(:generate, :patreon) -%>
|
|
15
|
-
[](https://www.patreon.com/<%= config.fetch :github_user %>)
|
|
16
|
-
<%- end -%>
|
|
17
15
|
|
|
18
16
|
<!-- Tocer[start]: Auto-generated, don't remove. -->
|
|
19
17
|
<!-- Tocer[finish]: Auto-generated, don't remove. -->
|
|
@@ -5,13 +5,11 @@ begin
|
|
|
5
5
|
# require "rspec/core/rake_task"
|
|
6
6
|
# require "reek/rake/task"
|
|
7
7
|
# require "rubocop/rake_task"
|
|
8
|
-
# require "scss_lint/rake_task"
|
|
9
8
|
|
|
10
9
|
# Bundler::Audit::Task.new
|
|
11
10
|
# RSpec::Core::RakeTask.new(:spec)
|
|
12
11
|
# Reek::Rake::Task.new
|
|
13
12
|
# RuboCop::RakeTask.new
|
|
14
|
-
# SCSSLint::RakeTask.new { |task| task.files = ["app/assets"] }
|
|
15
13
|
rescue LoadError => error
|
|
16
14
|
puts error.message
|
|
17
15
|
end
|
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:
|
|
4
|
+
version: 11.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brooke Kuhlmann
|
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
|
30
30
|
MQXa5aqjoFEODxVbBBI6NyNVH4gMKDsILEFlH/mcBQKKQwXj2McJmB8jIG+WuKoE
|
|
31
31
|
GyTL6s+8CnN9sL2Spfh/YdRn/29r4g2qi6FomQ==
|
|
32
32
|
-----END CERTIFICATE-----
|
|
33
|
-
date:
|
|
33
|
+
date: 2018-01-01 00:00:00.000000000 Z
|
|
34
34
|
dependencies:
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: bundler
|
|
@@ -38,84 +38,84 @@ dependencies:
|
|
|
38
38
|
requirements:
|
|
39
39
|
- - "~>"
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: '1.
|
|
41
|
+
version: '1.16'
|
|
42
42
|
type: :runtime
|
|
43
43
|
prerelease: false
|
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
45
45
|
requirements:
|
|
46
46
|
- - "~>"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: '1.
|
|
48
|
+
version: '1.16'
|
|
49
49
|
- !ruby/object:Gem::Dependency
|
|
50
50
|
name: milestoner
|
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
|
53
53
|
- - "~>"
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: '
|
|
55
|
+
version: '7.0'
|
|
56
56
|
type: :runtime
|
|
57
57
|
prerelease: false
|
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
|
59
59
|
requirements:
|
|
60
60
|
- - "~>"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '
|
|
62
|
+
version: '7.0'
|
|
63
63
|
- !ruby/object:Gem::Dependency
|
|
64
64
|
name: pragmater
|
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
|
67
67
|
- - "~>"
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '
|
|
69
|
+
version: '5.0'
|
|
70
70
|
type: :runtime
|
|
71
71
|
prerelease: false
|
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
73
|
requirements:
|
|
74
74
|
- - "~>"
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: '
|
|
76
|
+
version: '5.0'
|
|
77
77
|
- !ruby/object:Gem::Dependency
|
|
78
78
|
name: refinements
|
|
79
79
|
requirement: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
|
81
81
|
- - "~>"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
|
-
version: '
|
|
83
|
+
version: '5.0'
|
|
84
84
|
type: :runtime
|
|
85
85
|
prerelease: false
|
|
86
86
|
version_requirements: !ruby/object:Gem::Requirement
|
|
87
87
|
requirements:
|
|
88
88
|
- - "~>"
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
|
-
version: '
|
|
90
|
+
version: '5.0'
|
|
91
91
|
- !ruby/object:Gem::Dependency
|
|
92
92
|
name: rubocop
|
|
93
93
|
requirement: !ruby/object:Gem::Requirement
|
|
94
94
|
requirements:
|
|
95
95
|
- - "~>"
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
|
-
version: '0.
|
|
97
|
+
version: '0.52'
|
|
98
98
|
type: :runtime
|
|
99
99
|
prerelease: false
|
|
100
100
|
version_requirements: !ruby/object:Gem::Requirement
|
|
101
101
|
requirements:
|
|
102
102
|
- - "~>"
|
|
103
103
|
- !ruby/object:Gem::Version
|
|
104
|
-
version: '0.
|
|
104
|
+
version: '0.52'
|
|
105
105
|
- !ruby/object:Gem::Dependency
|
|
106
106
|
name: runcom
|
|
107
107
|
requirement: !ruby/object:Gem::Requirement
|
|
108
108
|
requirements:
|
|
109
109
|
- - "~>"
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
|
-
version: '
|
|
111
|
+
version: '2.0'
|
|
112
112
|
type: :runtime
|
|
113
113
|
prerelease: false
|
|
114
114
|
version_requirements: !ruby/object:Gem::Requirement
|
|
115
115
|
requirements:
|
|
116
116
|
- - "~>"
|
|
117
117
|
- !ruby/object:Gem::Version
|
|
118
|
-
version: '
|
|
118
|
+
version: '2.0'
|
|
119
119
|
- !ruby/object:Gem::Dependency
|
|
120
120
|
name: thor
|
|
121
121
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,28 +136,28 @@ dependencies:
|
|
|
136
136
|
requirements:
|
|
137
137
|
- - "~>"
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
|
-
version: '
|
|
139
|
+
version: '7.0'
|
|
140
140
|
type: :runtime
|
|
141
141
|
prerelease: false
|
|
142
142
|
version_requirements: !ruby/object:Gem::Requirement
|
|
143
143
|
requirements:
|
|
144
144
|
- - "~>"
|
|
145
145
|
- !ruby/object:Gem::Version
|
|
146
|
-
version: '
|
|
146
|
+
version: '7.0'
|
|
147
147
|
- !ruby/object:Gem::Dependency
|
|
148
148
|
name: versionaire
|
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
|
150
150
|
requirements:
|
|
151
151
|
- - "~>"
|
|
152
152
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: '
|
|
153
|
+
version: '4.0'
|
|
154
154
|
type: :runtime
|
|
155
155
|
prerelease: false
|
|
156
156
|
version_requirements: !ruby/object:Gem::Requirement
|
|
157
157
|
requirements:
|
|
158
158
|
- - "~>"
|
|
159
159
|
- !ruby/object:Gem::Version
|
|
160
|
-
version: '
|
|
160
|
+
version: '4.0'
|
|
161
161
|
- !ruby/object:Gem::Dependency
|
|
162
162
|
name: awesome_print
|
|
163
163
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -234,14 +234,14 @@ dependencies:
|
|
|
234
234
|
requirements:
|
|
235
235
|
- - "~>"
|
|
236
236
|
- !ruby/object:Gem::Version
|
|
237
|
-
version: '
|
|
237
|
+
version: '2.0'
|
|
238
238
|
type: :development
|
|
239
239
|
prerelease: false
|
|
240
240
|
version_requirements: !ruby/object:Gem::Requirement
|
|
241
241
|
requirements:
|
|
242
242
|
- - "~>"
|
|
243
243
|
- !ruby/object:Gem::Version
|
|
244
|
-
version: '
|
|
244
|
+
version: '2.0'
|
|
245
245
|
- !ruby/object:Gem::Dependency
|
|
246
246
|
name: guard-rspec
|
|
247
247
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -399,7 +399,6 @@ files:
|
|
|
399
399
|
- lib/gemsmith/generators/rspec.rb
|
|
400
400
|
- lib/gemsmith/generators/rubocop.rb
|
|
401
401
|
- lib/gemsmith/generators/ruby.rb
|
|
402
|
-
- lib/gemsmith/generators/scss_lint.rb
|
|
403
402
|
- lib/gemsmith/git.rb
|
|
404
403
|
- lib/gemsmith/helpers/cli.rb
|
|
405
404
|
- lib/gemsmith/helpers/template.rb
|
|
@@ -440,7 +439,7 @@ files:
|
|
|
440
439
|
- lib/gemsmith/templates/%gem_name%/spec/support/shared_contexts/temp_dir.rb.tt
|
|
441
440
|
homepage: https://github.com/bkuhlmann/gemsmith
|
|
442
441
|
licenses:
|
|
443
|
-
-
|
|
442
|
+
- Apache-2.0
|
|
444
443
|
metadata: {}
|
|
445
444
|
post_install_message:
|
|
446
445
|
rdoc_options: []
|
|
@@ -450,7 +449,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
450
449
|
requirements:
|
|
451
450
|
- - "~>"
|
|
452
451
|
- !ruby/object:Gem::Version
|
|
453
|
-
version: '2.
|
|
452
|
+
version: '2.5'
|
|
454
453
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
455
454
|
requirements:
|
|
456
455
|
- - ">="
|
|
@@ -458,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
458
457
|
version: '0'
|
|
459
458
|
requirements: []
|
|
460
459
|
rubyforge_project:
|
|
461
|
-
rubygems_version: 2.7.
|
|
460
|
+
rubygems_version: 2.7.4
|
|
462
461
|
signing_key:
|
|
463
462
|
specification_version: 4
|
|
464
463
|
summary: A command line interface for smithing new Ruby gems.
|
metadata.gz.sig
CHANGED
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Gemsmith
|
|
4
|
-
module Generators
|
|
5
|
-
# Generates SCSS Lint support.
|
|
6
|
-
class SCSSLint < Base
|
|
7
|
-
def run
|
|
8
|
-
return unless configuration.dig(:generate, :scss_lint)
|
|
9
|
-
|
|
10
|
-
gem_name = configuration.dig :gem, :name
|
|
11
|
-
cli.uncomment_lines "#{gem_name}/Rakefile", /require.+scss.+/
|
|
12
|
-
cli.uncomment_lines "#{gem_name}/Rakefile", /SCSSLint.+/
|
|
13
|
-
end
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|