gemsmith 2.4.0 → 3.0.0
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.md +33 -19
- data/lib/gemsmith/cli.rb +3 -1
- data/lib/gemsmith/cli_options.rb +14 -2
- data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +52 -32
- data/lib/gemsmith/templates/%gem_name%/README.md.tt +12 -1
- data/lib/gemsmith/templates/%gem_name%/spec/spec_helper.rb.tt +20 -5
- data/lib/gemsmith/version.rb +1 -1
- metadata +6 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84a491143e9618a2c16fe353a1f10289e4c7a3b1
|
4
|
+
data.tar.gz: 4b780c701602dcff1ff14657beb8745c1790e28d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ca5bc323bb417612a1ff81b37340a2897a12de76343122208902f7cff99d555dcdd8bee57c5c53c49a77aad476b5856d074a4ee8567247df9f9bc6dca0a52a5
|
7
|
+
data.tar.gz: e8d4c75dbfe4cb4a84e1189fff4101c150affd13ba47560f58c158d582f334d4b8fccf75b1023340cc37514ed07edb53ae88e95852107e9d2182521cda516155
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/gemsmith.png)](http://badge.fury.io/rb/gemsmith)
|
4
4
|
[![Code Climate GPA](https://codeclimate.com/github/bkuhlmann/gemsmith.png)](https://codeclimate.com/github/bkuhlmann/gemsmith)
|
5
|
+
[![Gemnasium Status](https://gemnasium.com/bkuhlmann/gemsmith.png)](https://gemnasium.com/bkuhlmann/gemsmith)
|
5
6
|
[![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/gemsmith.png)](http://travis-ci.org/bkuhlmann/gemsmith)
|
7
|
+
[![Coverage Status](https://coveralls.io/repos/bkuhlmann/gemsmith/badge.png)](https://coveralls.io/r/bkuhlmann/gemsmith)
|
6
8
|
|
7
9
|
Gemsmith allows you to easily craft new gems via the command line with custom settings (if desired). If you are
|
8
10
|
a fan of [Bundler](https://github.com/carlhuda/bundler), then you'll appreciate the additional capabilities of this
|
@@ -12,15 +14,18 @@ gem. Gemsmith is essentially an enhanced version of Bundler's gem building capab
|
|
12
14
|
|
13
15
|
* Builds a gem skeleton with Bundler functionality in mind.
|
14
16
|
* Supports common settings that can be applied to new gem creations.
|
15
|
-
* Supports
|
17
|
+
* Supports [Thor](https://github.com/wycats/thor) command line functionality.
|
16
18
|
* Supports [Ruby on Rails](http://rubyonrails.org).
|
17
19
|
* Supports [RSpec](http://rspec.info).
|
18
20
|
* Supports [Pry](http://pryrepl.org).
|
19
21
|
* Supports [Guard](https://github.com/guard/guard).
|
20
22
|
* Supports [Code Climate](https://codeclimate.com).
|
21
|
-
* Supports [
|
22
|
-
*
|
23
|
-
*
|
23
|
+
* Supports [Gemnasium](https://gemnasium.com).
|
24
|
+
* Supports [Travis CI](http://travis-ci.org).
|
25
|
+
* Supports [Coveralls](https://coveralls.io).
|
26
|
+
* Provides the ability to open the source code of any gem within your favorite editor.
|
27
|
+
* Provides the ability to read the documentation of any gem within your default browser.
|
28
|
+
* Adds commonly needed README, CHANGELOG, CONTRIBUTING, LICENSE, etc. template files.
|
24
29
|
|
25
30
|
# Requirements
|
26
31
|
|
@@ -37,7 +42,7 @@ gem. Gemsmith is essentially an enhanced version of Bundler's gem building capab
|
|
37
42
|
For a secure install, type the following from the command line (recommended):
|
38
43
|
|
39
44
|
gem cert --add <(curl -Ls http://www.redalchemist.com/gem-public.pem)
|
40
|
-
gem install gemsmith -
|
45
|
+
gem install gemsmith --trust-policy HighSecurity
|
41
46
|
|
42
47
|
...or, for an insecure install, type the following (not recommended):
|
43
48
|
|
@@ -58,6 +63,8 @@ You can configure common settings for future gem builds by creating the followin
|
|
58
63
|
If no options are configured, then the defaults are as follows:
|
59
64
|
|
60
65
|
gem_platform: Gem::Platform::RUBY
|
66
|
+
gem_private_key: ~/.ssh/gem-private.pem
|
67
|
+
gem_public_key: ~/.ssh/gem-public.pem
|
61
68
|
author_name: <git name>
|
62
69
|
author_email: <git email>
|
63
70
|
author_url: https://www.unknown.com
|
@@ -68,7 +75,7 @@ If no options are configured, then the defaults are as follows:
|
|
68
75
|
year: <current year>
|
69
76
|
ruby_version: 2.0.0
|
70
77
|
ruby_patch: p0
|
71
|
-
rails_version:
|
78
|
+
rails_version: 4.0
|
72
79
|
|
73
80
|
# Usage
|
74
81
|
|
@@ -83,18 +90,22 @@ From the command line, type: gemsmith help
|
|
83
90
|
|
84
91
|
For more gem creation options, type: gemsmith help create
|
85
92
|
|
86
|
-
-b, [--bin]
|
87
|
-
-r, [--rails]
|
88
|
-
-p, [--pry]
|
89
|
-
|
90
|
-
-g, [--guard]
|
91
|
-
|
92
|
-
-s, [--rspec]
|
93
|
-
|
94
|
-
-
|
95
|
-
|
96
|
-
-
|
97
|
-
|
93
|
+
-b, [--bin], [--no-bin] # Add binary support.
|
94
|
+
-r, [--rails], [--no-rails] # Add Rails support.
|
95
|
+
-p, [--pry], [--no-pry] # Add Pry support.
|
96
|
+
# Default: true
|
97
|
+
-g, [--guard], [--no-guard] # Add Guard support.
|
98
|
+
# Default: true
|
99
|
+
-s, [--rspec], [--no-rspec] # Add RSpec support.
|
100
|
+
# Default: true
|
101
|
+
-c, [--code-climate], [--no-code-climate] # Add Code Climate support.
|
102
|
+
# Default: true
|
103
|
+
-G, [--gemnasium], [--no-gemnasium] # Add Gemnasium support.
|
104
|
+
# Default: true
|
105
|
+
-t, [--travis], [--no-travis] # Add Travis CI support.
|
106
|
+
# Default: true
|
107
|
+
-C, [--coveralls], [--no-coveralls] # Add Coveralls support.
|
108
|
+
# Default: true
|
98
109
|
|
99
110
|
Once a gem skeleton has been created, the following tasks are available within the project via Bundler (i.e. rake -T):
|
100
111
|
|
@@ -112,12 +123,15 @@ To test, do the following:
|
|
112
123
|
|
113
124
|
# Security
|
114
125
|
|
115
|
-
To
|
126
|
+
To create a certificate for your gems, run the following:
|
116
127
|
|
117
128
|
cd ~/.ssh
|
118
129
|
gem cert --build you@example.com
|
119
130
|
chmod 600 gem-*.pem
|
120
131
|
|
132
|
+
The resulting *.pem keys can be referenced via the *gem_private_key* and *gem_public_key* settings mentioned in the
|
133
|
+
Setup documentation.
|
134
|
+
|
121
135
|
To learn more about gem certificates, read the following:
|
122
136
|
|
123
137
|
* [Ruby Gems](http://guides.rubygems.org/security/#building_gems)
|
data/lib/gemsmith/cli.rb
CHANGED
@@ -40,8 +40,10 @@ module Gemsmith
|
|
40
40
|
method_option :pry, aliases: "-p", desc: "Add Pry support.", type: :boolean, default: true
|
41
41
|
method_option :guard, aliases: "-g", desc: "Add Guard support.", type: :boolean, default: true
|
42
42
|
method_option :rspec, aliases: "-s", desc: "Add RSpec support.", type: :boolean, default: true
|
43
|
-
method_option :travis, aliases: "-t", desc: "Add Travis CI support.", type: :boolean, default: true
|
44
43
|
method_option :code_climate, aliases: "-c", desc: "Add Code Climate support.", type: :boolean, default: true
|
44
|
+
method_option :gemnasium, aliases: "-G", desc: "Add Gemnasium support.", type: :boolean, default: true
|
45
|
+
method_option :travis, aliases: "-t", desc: "Add Travis CI support.", type: :boolean, default: true
|
46
|
+
method_option :coveralls, aliases: "-C", desc: "Add Coveralls support.", type: :boolean, default: true
|
45
47
|
def create name
|
46
48
|
say
|
47
49
|
info "Creating gem..."
|
data/lib/gemsmith/cli_options.rb
CHANGED
@@ -18,6 +18,8 @@ module Gemsmith
|
|
18
18
|
gem_class: gem_class,
|
19
19
|
gem_platform: gem_platform,
|
20
20
|
gem_url: gem_url,
|
21
|
+
gem_private_key: gem_private_key,
|
22
|
+
gem_public_key: gem_public_key,
|
21
23
|
author_name: author_name,
|
22
24
|
author_email: author_email,
|
23
25
|
author_url: author_url,
|
@@ -34,8 +36,10 @@ module Gemsmith
|
|
34
36
|
pry: default_boolean(:pry, true),
|
35
37
|
guard: default_boolean(:guard, true),
|
36
38
|
rspec: default_boolean(:rspec, true),
|
39
|
+
code_climate: default_boolean(:code_climate, true),
|
40
|
+
gemnasium: default_boolean(:gemnasium, true),
|
37
41
|
travis: default_boolean(:travis, true),
|
38
|
-
|
42
|
+
coveralls: default_boolean(:coveralls, true)
|
39
43
|
}
|
40
44
|
end
|
41
45
|
|
@@ -47,6 +51,14 @@ module Gemsmith
|
|
47
51
|
@settings[:gem_url] || author_url
|
48
52
|
end
|
49
53
|
|
54
|
+
def gem_private_key
|
55
|
+
@settings.fetch :gem_private_key, "~/.ssh/gem-private.pem"
|
56
|
+
end
|
57
|
+
|
58
|
+
def gem_public_key
|
59
|
+
@settings.fetch :gem_public_key, "~/.ssh/gem-public.pem"
|
60
|
+
end
|
61
|
+
|
50
62
|
def author_name
|
51
63
|
@settings[:author_name] || Gemsmith::Kit.git_config_value("user.name") || "TODO: Add full name here."
|
52
64
|
end
|
@@ -84,7 +96,7 @@ module Gemsmith
|
|
84
96
|
end
|
85
97
|
|
86
98
|
def rails_version
|
87
|
-
@settings[:rails_version] || "
|
99
|
+
@settings[:rails_version] || "4.0"
|
88
100
|
end
|
89
101
|
|
90
102
|
def default_boolean key, value = false
|
@@ -1,62 +1,82 @@
|
|
1
1
|
$:.push File.expand_path("../lib", __FILE__)
|
2
2
|
require "<%=config[:gem_name]%>/version"
|
3
3
|
|
4
|
+
def add_security_key specification, method, files
|
5
|
+
file = files.is_a?(Array) ? files.first : files
|
6
|
+
if File.exists? file
|
7
|
+
specification.send "#{method}=", files
|
8
|
+
else
|
9
|
+
puts "WARNING: Security key not found for #{specification.name} gem specification: #{file}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
4
13
|
Gem::Specification.new do |s|
|
5
|
-
s.name
|
6
|
-
s.version
|
7
|
-
s.platform
|
8
|
-
s.author
|
9
|
-
s.email
|
10
|
-
s.homepage
|
11
|
-
s.summary
|
12
|
-
s.description
|
13
|
-
|
14
|
+
s.name = "<%= config[:gem_name] %>"
|
15
|
+
s.version = <%= config[:gem_class] %>::VERSION
|
16
|
+
s.platform = <%= config[:gem_platform] %>
|
17
|
+
s.author = "<%= config[:author_name] %>"
|
18
|
+
s.email = "<%= config[:author_email] %>"
|
19
|
+
s.homepage = "<%= config[:gem_url] %>"
|
20
|
+
s.summary = "TODO: Add gem summary here."
|
21
|
+
s.description = "TODO: Add gem description here."
|
22
|
+
s.license = "MIT"
|
14
23
|
<%- if config[:post_install_message] -%>
|
15
|
-
|
16
|
-
|
24
|
+
s.post_install_message = "<%= config[:post_install_message] %>"
|
25
|
+
<%- end -%>
|
17
26
|
|
18
|
-
|
19
|
-
|
20
|
-
|
27
|
+
add_security_key s, "signing_key", File.expand_path("<%= config[:gem_private_key] %>")
|
28
|
+
add_security_key s, "cert_chain", [File.expand_path("<%= config[:gem_public_key] %>")]
|
29
|
+
|
30
|
+
<%- if config[:pry] -%>
|
31
|
+
case Gem.ruby_engine
|
32
|
+
when "ruby"
|
33
|
+
s.add_development_dependency "pry-byebug"
|
34
|
+
s.add_development_dependency "pry-stack_explorer"
|
35
|
+
when "jruby"
|
36
|
+
s.add_development_dependency "pry-nav"
|
37
|
+
when "rbx"
|
38
|
+
s.add_development_dependency "pry-nav"
|
39
|
+
s.add_development_dependency "pry-stack_explorer"
|
40
|
+
else
|
41
|
+
raise RuntimeError.new("Unsupported Ruby Engine!")
|
21
42
|
end
|
43
|
+
<%- end -%>
|
22
44
|
|
23
|
-
|
45
|
+
s.required_ruby_version = "~> <%= config[:ruby_version] %>"
|
24
46
|
<%- if config[:bin] -%>
|
25
|
-
|
26
|
-
|
27
|
-
|
47
|
+
s.add_dependency "thor"
|
48
|
+
s.add_dependency "thor_plus"
|
49
|
+
<%- end -%>
|
28
50
|
<%- if config[:rails] -%>
|
29
|
-
|
30
|
-
|
51
|
+
s.add_dependency "rails", "~> <%= config[:rails_version] %>"
|
52
|
+
<%- end -%>
|
31
53
|
<%- if config[:travis] -%>
|
32
54
|
s.add_development_dependency "rake"
|
33
|
-
|
55
|
+
<%- end -%>
|
34
56
|
<%- if config[:pry] -%>
|
35
57
|
s.add_development_dependency "pry"
|
36
|
-
s.add_development_dependency "pry-byebug"
|
37
58
|
s.add_development_dependency "pry-remote"
|
38
59
|
s.add_development_dependency "pry-rescue"
|
39
|
-
s.add_development_dependency "pry-stack_explorer"
|
40
|
-
s.add_development_dependency "pry-vterm_aliases"
|
41
|
-
s.add_development_dependency "pry-git"
|
42
|
-
s.add_development_dependency "pry-doc"
|
43
60
|
<%- end -%>
|
44
61
|
<%- if config[:rspec] -%>
|
45
62
|
<%- rspec_gem = config[:rails] ? "rspec-rails" : "rspec" -%>
|
46
63
|
s.add_development_dependency "<%= rspec_gem %>"
|
47
|
-
|
64
|
+
<%- end -%>
|
48
65
|
<%- if config[:bin] -%>
|
49
66
|
s.add_development_dependency "aruba"
|
50
67
|
<%- end -%>
|
51
68
|
<%- if config[:guard] -%>
|
52
69
|
s.add_development_dependency "rb-fsevent" # Guard file events for OSX.
|
53
70
|
s.add_development_dependency "guard-rspec"
|
54
|
-
|
71
|
+
<%- end -%>
|
72
|
+
<%- if config[:coveralls] -%>
|
73
|
+
s.add_development_dependency "coveralls"
|
74
|
+
<%- end -%>
|
55
75
|
|
56
|
-
s.files
|
76
|
+
s.files = Dir["lib/**/*", "vendor/**/*"]
|
57
77
|
s.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
58
78
|
<%- if config[:bin] -%>
|
59
|
-
|
60
|
-
|
61
|
-
s.require_paths
|
79
|
+
s.executables << "<%= config[:gem_name] %>"
|
80
|
+
<%- end -%>
|
81
|
+
s.require_paths = ["lib"]
|
62
82
|
end
|
@@ -4,9 +4,15 @@
|
|
4
4
|
<%- if config[:code_climate] -%>
|
5
5
|
[![Code Climate GPA](https://codeclimate.com/github/<%= config[:github_user] %>/<%= config[:gem_name] %>.png)](https://codeclimate.com/github/<%= config[:github_user] %>/<%= config[:gem_name] %>)
|
6
6
|
<%- end -%>
|
7
|
+
<%- if config[:gemnasium] -%>
|
8
|
+
[![Gemnasium Status](https://gemnasium.com/<%= config[:github_user] %>/<%= config[:gem_name] %>.png)](https://gemnasium.com/<%= config[:github_user] %>/<%= config[:gem_name] %>)
|
9
|
+
<%- end -%>
|
7
10
|
<%- if config[:travis] -%>
|
8
11
|
[![Travis CI Status](https://secure.travis-ci.org/<%= config[:github_user] %>/<%= config[:gem_name] %>.png)](http://travis-ci.org/<%= config[:github_user] %>/<%= config[:gem_name] %>)
|
9
12
|
<%- end -%>
|
13
|
+
<%- if config[:coveralls] -%>
|
14
|
+
[![Coveralls Status](https://coveralls.io/repos/<%= config[:github_user] %>/<%= config[:gem_name] %>/badge.png)](https://coveralls.io/r/<%= config[:github_user] %>/<%= config[:gem_name] %>)
|
15
|
+
<%- end -%>
|
10
16
|
|
11
17
|
# Features
|
12
18
|
|
@@ -18,7 +24,12 @@
|
|
18
24
|
|
19
25
|
# Setup
|
20
26
|
|
21
|
-
|
27
|
+
For a secure install, type the following from the command line (recommended):
|
28
|
+
|
29
|
+
gem cert --add <(curl -Ls http://www.my-website.com/gem-public.pem)
|
30
|
+
gem install <%= config[:gem_name] %> --trust-policy HighSecurity
|
31
|
+
|
32
|
+
...or, for an insecure install, type the following (not recommended):
|
22
33
|
|
23
34
|
gem install <%= config[:gem_name] %>
|
24
35
|
|
@@ -2,13 +2,28 @@ require "bundler/setup"
|
|
2
2
|
require "<%= config[:gem_name] %>"
|
3
3
|
<%- if config[:pry] -%>
|
4
4
|
require "pry"
|
5
|
-
require "pry-byebug"
|
6
5
|
require "pry-remote"
|
7
6
|
require "pry-rescue"
|
8
|
-
|
9
|
-
|
10
|
-
require "
|
11
|
-
|
7
|
+
<%- end -%>
|
8
|
+
<%- if config[:coveralls] -%>
|
9
|
+
require "coveralls"
|
10
|
+
<%- end -%>
|
11
|
+
|
12
|
+
<%- if config[:pry] -%>
|
13
|
+
case Gem.ruby_engine
|
14
|
+
when "ruby"
|
15
|
+
require "pry-byebug"
|
16
|
+
require "pry-stack_explorer"
|
17
|
+
when "jruby"
|
18
|
+
require "pry-nav"
|
19
|
+
when "rbx"
|
20
|
+
require "pry-nav"
|
21
|
+
require "pry-stack_explorer"
|
22
|
+
end
|
23
|
+
<%- end -%>
|
24
|
+
|
25
|
+
<%- if config[:coveralls] -%>
|
26
|
+
Coveralls.wear!
|
12
27
|
<%- end -%>
|
13
28
|
|
14
29
|
RSpec.configure do |config|
|
data/lib/gemsmith/version.rb
CHANGED
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: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
SJpzzzZ8gO6BKn4fhd+ENNQ333Qy3nuNk07TVIaNnlgeHhowUDuD9T7Z8Lka0pt3
|
31
31
|
4PteiTppsf0SSVAM9zSO5IuFngXMRwWgvjOfXE70f43RDuUVTCSyylc=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-
|
33
|
+
date: 2014-03-25 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: pry-byebug
|
@@ -145,7 +145,7 @@ dependencies:
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
148
|
+
name: rspec
|
149
149
|
requirement: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - ">="
|
@@ -159,7 +159,7 @@ dependencies:
|
|
159
159
|
- !ruby/object:Gem::Version
|
160
160
|
version: '0'
|
161
161
|
- !ruby/object:Gem::Dependency
|
162
|
-
name:
|
162
|
+
name: rb-fsevent
|
163
163
|
requirement: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
165
|
- - ">="
|
@@ -173,7 +173,7 @@ dependencies:
|
|
173
173
|
- !ruby/object:Gem::Version
|
174
174
|
version: '0'
|
175
175
|
- !ruby/object:Gem::Dependency
|
176
|
-
name:
|
176
|
+
name: guard-rspec
|
177
177
|
requirement: !ruby/object:Gem::Requirement
|
178
178
|
requirements:
|
179
179
|
- - ">="
|
@@ -187,7 +187,7 @@ dependencies:
|
|
187
187
|
- !ruby/object:Gem::Version
|
188
188
|
version: '0'
|
189
189
|
- !ruby/object:Gem::Dependency
|
190
|
-
name:
|
190
|
+
name: coveralls
|
191
191
|
requirement: !ruby/object:Gem::Requirement
|
192
192
|
requirements:
|
193
193
|
- - ">="
|
metadata.gz.sig
CHANGED
Binary file
|