gemsmith 12.3.0 → 12.4.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 +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +3 -1
- data/lib/gemsmith/credentials.rb +25 -31
- data/lib/gemsmith/gem/module_formatter.rb +1 -0
- data/lib/gemsmith/gem/specification.rb +1 -0
- data/lib/gemsmith/generators/bundler.rb +1 -1
- data/lib/gemsmith/generators/circle_ci.rb +1 -0
- data/lib/gemsmith/generators/code_climate.rb +1 -0
- data/lib/gemsmith/generators/engine.rb +1 -0
- data/lib/gemsmith/generators/git_cop.rb +1 -0
- data/lib/gemsmith/generators/git_hub.rb +1 -0
- data/lib/gemsmith/generators/guard.rb +1 -0
- data/lib/gemsmith/generators/rake.rb +4 -0
- data/lib/gemsmith/generators/rspec.rb +1 -0
- data/lib/gemsmith/git.rb +1 -0
- data/lib/gemsmith/helpers/cli.rb +1 -0
- data/lib/gemsmith/identity.rb +1 -1
- data/lib/gemsmith/rake/builder.rb +1 -0
- data/lib/gemsmith/rake/publisher.rb +1 -1
- data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +4 -1
- data/lib/gemsmith/templates/%gem_name%/.rubocop.yml.tt +10 -2
- data/lib/gemsmith/templates/%gem_name%/CODE_OF_CONDUCT.md.tt +29 -24
- data/lib/gemsmith/templates/%gem_name%/spec/lib/%gem_path%/cli_spec.rb.tt +7 -0
- metadata +19 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b44005b2a835fdd8da0dd85dfefba1bfe65fd26d4a511c1c755428a26c74a03
|
4
|
+
data.tar.gz: 98101b4e988c1628f0cf875a80d06cd7af672576c49a4ac61b3980f9fedb4028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15aadf5fd3156836a11f0919d7b42c81838e6fc73781e74e05e186ebd361ef9a3fbf0912a51ce065e3d60d676b9e33dba5e1a8da946cc19ba5c6ca031209b541
|
7
|
+
data.tar.gz: 6bd18fb2cd91f3991b499af532b315372d669f5efb25fc2c53484d6d678f3a3ee05cf077676c3a8f6c05a7e631368812b682475ce0efc64e58da228389875e0c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -57,7 +57,8 @@ A command line interface for smithing new Ruby gems.
|
|
57
57
|
- Supports [Pry](http://pryrepl.org).
|
58
58
|
- Supports [Reek](https://github.com/troessner/reek).
|
59
59
|
- Supports [RSpec](http://rspec.info).
|
60
|
-
- Supports [Rubocop](https://github.com/
|
60
|
+
- Supports [Rubocop](https://github.com/rubocop-hq/rubocop).
|
61
|
+
- Supports [Rubocop RSpec](https://github.com/rubocop-hq/rubocop-rspec).
|
61
62
|
- Supports [Ruby on Rails](http://rubyonrails.org).
|
62
63
|
- Supports [RubyGems Security](http://guides.rubygems.org/security).
|
63
64
|
- Supports [Thor](https://github.com/erikhuda/thor).
|
@@ -340,6 +341,7 @@ Once your gem is released, you might want to let the world know about your accom
|
|
340
341
|
- [How to Spread the Word About Your Code](https://hacks.mozilla.org/2013/05/how-to-spread-the-word-about-your-code)
|
341
342
|
- [Ruby Community](https://www.ruby-lang.org/en/community)
|
342
343
|
- [RubyFlow](http://www.rubyflow.com)
|
344
|
+
- [RubyDaily](http://rubydaily.org)
|
343
345
|
- [Ruby Devs Slack](https://rubydevs.herokuapp.com)
|
344
346
|
|
345
347
|
## Troubleshooting
|
data/lib/gemsmith/credentials.rb
CHANGED
@@ -8,15 +8,10 @@ require "gemsmith/authenticators/ruby_gems"
|
|
8
8
|
module Gemsmith
|
9
9
|
# Generates gem credentials for RubyGems and/or alternative servers.
|
10
10
|
class Credentials
|
11
|
-
|
12
|
-
|
13
|
-
def self.default_key
|
14
|
-
:rubygems_api_key
|
15
|
-
end
|
11
|
+
DEFAULT_KEY = :rubygems_api_key
|
12
|
+
DEFAULT_URL = "https://rubygems.org"
|
16
13
|
|
17
|
-
|
18
|
-
"https://rubygems.org"
|
19
|
-
end
|
14
|
+
attr_reader :key, :url
|
20
15
|
|
21
16
|
def self.file_path
|
22
17
|
File.join ENV.fetch("HOME"), ".gem", "credentials"
|
@@ -26,14 +21,11 @@ module Gemsmith
|
|
26
21
|
[Authenticators::RubyGems, Authenticators::Basic]
|
27
22
|
end
|
28
23
|
|
29
|
-
|
30
|
-
def initialize key: self.class.default_key,
|
31
|
-
url: self.class.default_url,
|
32
|
-
shell: Thor::Shell::Basic.new
|
24
|
+
def initialize key: DEFAULT_KEY, url: DEFAULT_URL, shell: Thor::Shell::Basic.new
|
33
25
|
@key = key
|
34
26
|
@url = url
|
35
27
|
@shell = shell
|
36
|
-
@credentials =
|
28
|
+
@credentials = read
|
37
29
|
end
|
38
30
|
|
39
31
|
def authenticator
|
@@ -46,39 +38,41 @@ module Gemsmith
|
|
46
38
|
end
|
47
39
|
|
48
40
|
def valid?
|
49
|
-
|
41
|
+
exist? && !String(credentials[key]).empty?
|
50
42
|
end
|
51
43
|
|
52
|
-
# rubocop:disable Metrics/AbcSize
|
53
|
-
# :reek:TooManyStatements
|
54
44
|
def create
|
55
|
-
|
56
|
-
|
57
|
-
login = shell.ask %(What is your "#{url}" login?)
|
58
|
-
password = shell.ask %(What is your "#{url}" password?), echo: false
|
59
|
-
shell.say
|
60
|
-
|
61
|
-
new_credentials = credentials.merge key => authenticator.new(login, password).authorization
|
62
|
-
|
63
|
-
file_path = self.class.file_path
|
64
|
-
FileUtils.mkdir_p File.dirname file_path
|
65
|
-
File.open(file_path, "w") { |file| file << YAML.dump(new_credentials) }
|
66
|
-
FileUtils.chmod(0o600, file_path)
|
45
|
+
write unless valid?
|
67
46
|
end
|
68
|
-
# rubocop:enable Metrics/AbcSize
|
69
47
|
|
70
48
|
private
|
71
49
|
|
72
50
|
attr_reader :credentials, :shell
|
73
51
|
|
74
|
-
def
|
52
|
+
def exist?
|
75
53
|
File.exist? self.class.file_path
|
76
54
|
end
|
77
55
|
|
78
|
-
def
|
56
|
+
def read
|
79
57
|
Hash YAML.load_file(self.class.file_path)
|
80
58
|
rescue StandardError
|
81
59
|
{}
|
82
60
|
end
|
61
|
+
|
62
|
+
def write
|
63
|
+
file_path = self.class.file_path
|
64
|
+
|
65
|
+
FileUtils.mkdir_p File.dirname file_path
|
66
|
+
File.open(file_path, "w") { |file| file << YAML.dump(update) }
|
67
|
+
FileUtils.chmod 0o600, file_path
|
68
|
+
end
|
69
|
+
|
70
|
+
def update
|
71
|
+
login = shell.ask %(What is your "#{url}" login?)
|
72
|
+
password = shell.ask %(What is your "#{url}" password?), echo: false
|
73
|
+
shell.say
|
74
|
+
|
75
|
+
credentials.merge key => authenticator.new(login, password).authorization
|
76
|
+
end
|
83
77
|
end
|
84
78
|
end
|
@@ -10,11 +10,13 @@ module Gemsmith
|
|
10
10
|
|
11
11
|
def generate_code_quality_task
|
12
12
|
return "" if code_quality_tasks.empty?
|
13
|
+
|
13
14
|
%(\ndesc "Run code quality checks"\ntask code_quality: %i[#{code_quality_tasks}]\n)
|
14
15
|
end
|
15
16
|
|
16
17
|
def generate_default_task
|
17
18
|
return "" if default_task.empty?
|
19
|
+
|
18
20
|
%(\ntask default: %i[#{default_task}]\n)
|
19
21
|
end
|
20
22
|
|
@@ -65,11 +67,13 @@ module Gemsmith
|
|
65
67
|
|
66
68
|
def append_code_quality_task
|
67
69
|
return if code_quality_task.empty?
|
70
|
+
|
68
71
|
cli.append_to_file "%gem_name%/Rakefile", generate_code_quality_task
|
69
72
|
end
|
70
73
|
|
71
74
|
def append_default_task
|
72
75
|
return if default_task.empty?
|
76
|
+
|
73
77
|
cli.append_to_file "%gem_name%/Rakefile", generate_default_task
|
74
78
|
end
|
75
79
|
end
|
data/lib/gemsmith/git.rb
CHANGED
data/lib/gemsmith/helpers/cli.rb
CHANGED
@@ -34,6 +34,7 @@ module Gemsmith
|
|
34
34
|
|
35
35
|
def inspect_gem specification, method
|
36
36
|
return unless specification
|
37
|
+
|
37
38
|
Gem::Inspector.new.public_send method, Gem::Specification.new(specification.spec_file)
|
38
39
|
rescue Versionaire::Errors::Conversion => error
|
39
40
|
say_status :error, error.message, :red
|
data/lib/gemsmith/identity.rb
CHANGED
@@ -55,7 +55,10 @@ Gem::Specification.new do |spec|
|
|
55
55
|
spec.add_development_dependency "<%= config.dig(:generate, :engine) ? "rspec-rails" : "rspec" %>", "~> 3.8"
|
56
56
|
<%- end -%>
|
57
57
|
<%- if config.dig(:generate, :rubocop) -%>
|
58
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
58
|
+
spec.add_development_dependency "rubocop", "~> 0.60"
|
59
|
+
<%- end -%>
|
60
|
+
<%- if config.dig(:generate, :rubocop) && config.dig(:generate, :rspec) -%>
|
61
|
+
spec.add_development_dependency "rubocop-rspec", "~> 1.30"
|
59
62
|
<%- end -%>
|
60
63
|
|
61
64
|
<%- if config.dig(:generate, :engine) -%>
|
@@ -1,5 +1,13 @@
|
|
1
1
|
inherit_from:
|
2
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/
|
2
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/2.5.0/configurations/rubocop/ruby.yml
|
3
|
+
<%- if config.dig(:generate, :rspec) -%>
|
4
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/2.5.0/configurations/rubocop/rspec.yml
|
5
|
+
<%- end -%>
|
3
6
|
<%- if config.dig(:generate, :engine) -%>
|
4
|
-
- https://raw.githubusercontent.com/bkuhlmann/code_quality/
|
7
|
+
- https://raw.githubusercontent.com/bkuhlmann/code_quality/2.5.0/configurations/rubocop/rails.yml
|
8
|
+
<%- end -%>
|
9
|
+
|
10
|
+
<%- if config.dig(:generate, :cli) -%>
|
11
|
+
Lint/Void:
|
12
|
+
CheckForMethodsWithNoSideEffects: false
|
5
13
|
<%- end -%>
|
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
## Our Pledge
|
4
4
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as contributors and maintainers
|
6
|
-
participation in our project and our community a harassment-free experience for
|
7
|
-
|
8
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers
|
6
|
+
pledge to making participation in our project and our community a harassment-free experience for
|
7
|
+
everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity
|
8
|
+
and expression, level of experience, education, socio-economic status, nationality, personal
|
9
|
+
appearance, race, religion, or sexual identity and orientation.
|
9
10
|
|
10
11
|
## Our Standards
|
11
12
|
|
@@ -22,40 +23,44 @@ Examples of unacceptable behavior by participants include:
|
|
22
23
|
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
23
24
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
24
25
|
* Public or private harassment
|
25
|
-
* Publishing others' private information, such as a physical or electronic address, without explicit
|
26
|
+
* Publishing others' private information, such as a physical or electronic address, without explicit
|
27
|
+
permission
|
26
28
|
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
27
29
|
|
28
30
|
## Our Responsibilities
|
29
31
|
|
30
|
-
Project maintainers are responsible for clarifying the standards of acceptable behavior and are
|
31
|
-
appropriate and fair corrective action in response to any instances of unacceptable
|
32
|
+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are
|
33
|
+
expected to take appropriate and fair corrective action in response to any instances of unacceptable
|
34
|
+
behavior.
|
32
35
|
|
33
|
-
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
|
34
|
-
issues, and other contributions that are not aligned to this Code of Conduct, or
|
35
|
-
contributor for other behaviors that they deem inappropriate,
|
36
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits,
|
37
|
+
code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or
|
38
|
+
to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,
|
39
|
+
threatening, offensive, or harmful.
|
36
40
|
|
37
41
|
## Scope
|
38
42
|
|
39
|
-
This Code of Conduct applies both within project spaces and in public spaces when an individual is
|
40
|
-
project or its community. Examples of representing a project or community include
|
41
|
-
address, posting via an official social media account, or acting as
|
42
|
-
event. Representation of a project may be
|
43
|
+
This Code of Conduct applies both within project spaces and in public spaces when an individual is
|
44
|
+
representing the project or its community. Examples of representing a project or community include
|
45
|
+
using an official project e-mail address, posting via an official social media account, or acting as
|
46
|
+
an appointed representative at an online or offline event. Representation of a project may be
|
47
|
+
further defined and clarified by project maintainers.
|
43
48
|
|
44
49
|
## Enforcement
|
45
50
|
|
46
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
|
47
|
-
[<%= config.dig :author, :
|
48
|
-
investigated and will result in a response that is deemed
|
49
|
-
|
50
|
-
|
51
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting
|
52
|
+
the project team at [<%= config.dig :author, :name %>](mailto:<%= config.dig :author, :email %>).
|
53
|
+
All complaints will be reviewed and investigated and will result in a response that is deemed
|
54
|
+
necessary and appropriate to the circumstances. The project team is obligated to maintain
|
55
|
+
confidentiality with regard to the reporter of an incident. Further details of specific enforcement
|
56
|
+
policies may be posted separately.
|
51
57
|
|
52
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
|
53
|
-
repercussions as determined by other members of the project's leadership.
|
58
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face
|
59
|
+
temporary or permanent repercussions as determined by other members of the project's leadership.
|
54
60
|
|
55
61
|
## Attribution
|
56
62
|
|
57
63
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
58
|
-
available at
|
64
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
59
65
|
|
60
|
-
[homepage]:
|
61
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
66
|
+
[homepage]: https://www.contributor-covenant.org
|
@@ -32,36 +32,43 @@ RSpec.describe <%= config.dig(:gem, :class) %>::CLI do
|
|
32
32
|
|
33
33
|
describe "--config" do
|
34
34
|
let(:command) { "--config" }
|
35
|
+
|
35
36
|
it_behaves_like "a config command"
|
36
37
|
end
|
37
38
|
|
38
39
|
describe "-c" do
|
39
40
|
let(:command) { "-c" }
|
41
|
+
|
40
42
|
it_behaves_like "a config command"
|
41
43
|
end
|
42
44
|
|
43
45
|
describe "--version" do
|
44
46
|
let(:command) { "--version" }
|
47
|
+
|
45
48
|
it_behaves_like "a version command"
|
46
49
|
end
|
47
50
|
|
48
51
|
describe "-v" do
|
49
52
|
let(:command) { "-v" }
|
53
|
+
|
50
54
|
it_behaves_like "a version command"
|
51
55
|
end
|
52
56
|
|
53
57
|
describe "--help" do
|
54
58
|
let(:command) { "--help" }
|
59
|
+
|
55
60
|
it_behaves_like "a help command"
|
56
61
|
end
|
57
62
|
|
58
63
|
describe "-h" do
|
59
64
|
let(:command) { "-h" }
|
65
|
+
|
60
66
|
it_behaves_like "a help command"
|
61
67
|
end
|
62
68
|
|
63
69
|
context "with no command" do
|
64
70
|
let(:command) { nil }
|
71
|
+
|
65
72
|
it_behaves_like "a help command"
|
66
73
|
end
|
67
74
|
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: 12.
|
4
|
+
version: 12.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
4Zrsxi713z6sndd9JBAm4G7mJiV93MsuCM5N4ZDY7XaxIhvctNSNhX/Yn8LLdtGI
|
30
30
|
b4jw5t40FKyNUvLPPXYAvQALBtk=
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2018-
|
32
|
+
date: 2018-11-18 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: bundler
|
@@ -93,14 +93,14 @@ dependencies:
|
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0.
|
96
|
+
version: '0.60'
|
97
97
|
type: :runtime
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0.
|
103
|
+
version: '0.60'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: runcom
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
@@ -339,6 +339,20 @@ dependencies:
|
|
339
339
|
- - "~>"
|
340
340
|
- !ruby/object:Gem::Version
|
341
341
|
version: '3.8'
|
342
|
+
- !ruby/object:Gem::Dependency
|
343
|
+
name: rubocop-rspec
|
344
|
+
requirement: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - "~>"
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '1.30'
|
349
|
+
type: :development
|
350
|
+
prerelease: false
|
351
|
+
version_requirements: !ruby/object:Gem::Requirement
|
352
|
+
requirements:
|
353
|
+
- - "~>"
|
354
|
+
- !ruby/object:Gem::Version
|
355
|
+
version: '1.30'
|
342
356
|
- !ruby/object:Gem::Dependency
|
343
357
|
name: wirb
|
344
358
|
requirement: !ruby/object:Gem::Requirement
|
@@ -460,7 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
460
474
|
version: '0'
|
461
475
|
requirements: []
|
462
476
|
rubyforge_project:
|
463
|
-
rubygems_version: 2.7.
|
477
|
+
rubygems_version: 2.7.8
|
464
478
|
signing_key:
|
465
479
|
specification_version: 4
|
466
480
|
summary: A command line interface for smithing new Ruby gems.
|
metadata.gz.sig
CHANGED
Binary file
|