gemsmith 6.2.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -26
- data/bin/gemsmith +2 -1
- data/lib/gemsmith.rb +2 -0
- data/lib/gemsmith/aids/gem.rb +2 -0
- data/lib/gemsmith/aids/git.rb +2 -0
- data/lib/gemsmith/aids/spec.rb +2 -0
- data/lib/gemsmith/cli.rb +2 -0
- data/lib/gemsmith/cli_helpers.rb +3 -1
- data/lib/gemsmith/configuration.rb +2 -0
- data/lib/gemsmith/identity.rb +3 -1
- data/lib/gemsmith/rake/build.rb +2 -0
- data/lib/gemsmith/rake/release.rb +2 -0
- data/lib/gemsmith/rake/setup.rb +2 -0
- data/lib/gemsmith/rake/tasks.rb +2 -0
- data/lib/gemsmith/skeletons/base_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/bundler_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/cli_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/documentation_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/gem_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/git_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/guard_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/pry_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/rails_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/rake_skeleton.rb +7 -0
- data/lib/gemsmith/skeletons/rspec_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/rubocop_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/ruby_skeleton.rb +2 -0
- data/lib/gemsmith/skeletons/travis_skeleton.rb +2 -0
- data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +23 -21
- data/lib/gemsmith/templates/%gem_name%/.rubocop.yml.tt +1 -1
- data/lib/gemsmith/templates/%gem_name%/.ruby-version.tt +1 -1
- data/lib/gemsmith/templates/%gem_name%/.travis.yml.tt +3 -3
- data/lib/gemsmith/templates/%gem_name%/Guardfile.tt +1 -1
- data/lib/gemsmith/templates/%gem_name%/LICENSE.md.tt +1 -1
- data/lib/gemsmith/templates/%gem_name%/README.md.tt +21 -21
- data/lib/gemsmith/templates/%gem_name%/bin/%gem_name%.tt +7 -6
- data/lib/gemsmith/templates/%gem_name%/gemfiles/rails-%rails_version%.x.gemfile.tt +3 -1
- data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%.rb.tt +5 -3
- data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/cli.rb.tt +9 -7
- data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/engine.rb.tt +4 -2
- data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/identity.rb.tt +6 -4
- data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/USAGE.tt +2 -2
- data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/install_generator.rb.tt +4 -2
- data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/USAGE.tt +2 -2
- data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/upgrade_generator.rb.tt +4 -2
- data/lib/gemsmith/templates/%gem_name%/lib/tasks/console.rake.tt +9 -0
- data/lib/gemsmith/templates/%gem_name%/lib/tasks/rspec.rake.tt +2 -0
- data/lib/gemsmith/templates/%gem_name%/lib/tasks/rubocop.rake.tt +2 -0
- data/lib/gemsmith/templates/%gem_name%/spec/lib/%gem_name%/%gem_name%_spec.rb.tt +3 -1
- data/lib/gemsmith/templates/%gem_name%/spec/spec_helper.rb.tt +5 -3
- data/lib/gemsmith/templates/%gem_name%/spec/support/extensions/pry.rb.tt +2 -0
- data/lib/gemsmith/templates/%gem_name%/spec/support/kit/default_config.rb.tt +3 -0
- data/lib/gemsmith/templates/%gem_name%/spec/support/kit/stderr.rb.tt +2 -0
- data/lib/gemsmith/templates/%gem_name%/spec/support/kit/stdout.rb.tt +2 -0
- data/lib/gemsmith/templates/%gem_name%/spec/support/kit/temp_dir.rb.tt +2 -0
- data/lib/tasks/console.rake +9 -0
- data/lib/tasks/rspec.rake +2 -0
- data/lib/tasks/rubocop.rake +2 -0
- metadata +13 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab2696e4b6581e2708f26c11de7e3f1a95dba183
|
4
|
+
data.tar.gz: 03b6b0c782d42d3cc4dc6a1c700097a78312014d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 737d965a813bae8fee074c18c8c08f95ba89fdbb955a95fd3227c3b8d4c2028c1a1c1f7d5041da53fff9b75f02fdebfe00c028b960e0566c54228634c657bbff
|
7
|
+
data.tar.gz: fde10b25891ab2f93e8bae4cd1ac372a6094d0cb9c54f65d25583130656fda2cb727fe44f5a76cff95e945bd21c611880c474674c3ba48da86654993b7a7cdd8
|
data/README.md
CHANGED
@@ -19,7 +19,6 @@ A command line interface for smithing new Ruby gems.
|
|
19
19
|
- [Usage](#usage)
|
20
20
|
- [Command Line Interface (CLI)](#command-line-interface-cli)
|
21
21
|
- [Rake](#rake)
|
22
|
-
- [Upgrades](#upgrades)
|
23
22
|
- [Tests](#tests)
|
24
23
|
- [Security](#security)
|
25
24
|
- [Git Signing Key](#git-signing-key)
|
@@ -60,7 +59,7 @@ A command line interface for smithing new Ruby gems.
|
|
60
59
|
# Requirements
|
61
60
|
|
62
61
|
0. A UNIX-based system
|
63
|
-
0. [
|
62
|
+
0. [Ruby 2.3.x](https://www.ruby-lang.org)
|
64
63
|
0. [RubyGems](https://rubygems.org)
|
65
64
|
0. [Bundler](https://github.com/bundler/bundler)
|
66
65
|
|
@@ -169,13 +168,15 @@ For more gem creation options, type: `gemsmith --help --create`
|
|
169
168
|
|
170
169
|
Once a gem skeleton has been created, the following tasks are available (i.e. `bundle exec rake -T`):
|
171
170
|
|
172
|
-
rake build # Build gemsmith-
|
173
|
-
rake clean # Clean gem artifacts
|
171
|
+
rake build # Build gemsmith-7.0.0.gem into the pkg directory
|
172
|
+
rake clean # Remove any temporary products / Clean gem artifacts
|
173
|
+
rake clobber # Remove any generated files
|
174
|
+
rake console # Open IRB console for gem development environment
|
174
175
|
rake doc # Update README (table of contents)
|
175
|
-
rake install # Build and install gemsmith-
|
176
|
-
rake install:local # Build and install gemsmith-
|
177
|
-
rake publish # Build, tag
|
178
|
-
rake release
|
176
|
+
rake install # Build and install gemsmith-7.0.0.gem into system gems
|
177
|
+
rake install:local # Build and install gemsmith-7.0.0.gem into system gems without network access
|
178
|
+
rake publish # Build, tag v7.0.0 (signed), and push gemsmith-7.0.0.gem to RubyGems
|
179
|
+
rake release[remote] # Create tag v7.0.0 and build and push gemsmith-7.0.0.gem to Rubygems
|
179
180
|
rake rubocop # Run RuboCop
|
180
181
|
rake rubocop:auto_correct # Auto-correct RuboCop offenses
|
181
182
|
rake spec # Run RSpec code examples
|
@@ -202,20 +203,6 @@ When satified with your gem, builds are green, and ready to publish, run:
|
|
202
203
|
Alternatively, you can run `bundle exec rake release` if you don't wish to sign your gem releases (i.e default Bundler
|
203
204
|
behavior) but the added security that `publish` provides is strongly recommended.
|
204
205
|
|
205
|
-
## Upgrades
|
206
|
-
|
207
|
-
For those upgrading from Gemsmith 5.6.0 please be aware of the following changes:
|
208
|
-
|
209
|
-
- Move your `~/.gemsmith/settings.yml` settings to the new `~/.gemsmithrc` file. Refer to the Setup documentation
|
210
|
-
mentioned above for details.
|
211
|
-
- The `--cli/-c` create option has replaced the `--bin/-b` create option.
|
212
|
-
- The `--code-climate` create option shortcut is now `-C` instead of `-c`.
|
213
|
-
- [Tocer](https://github.com/bkuhlmann/tocer) has replaced [DocToc](https://github.com/thlorenz/doctoc) as a pure Ruby
|
214
|
-
implementation for generating README table of contents and removing the dependency on NPM.
|
215
|
-
- The `rake readme:toc` task has been replaced with `rake doc`.
|
216
|
-
- Using Rake to build, release, or publish a gem will fail if uncommitted Git changes are detected which prevent you
|
217
|
-
from publishing a gem prematurely.
|
218
|
-
|
219
206
|
# Tests
|
220
207
|
|
221
208
|
To test, run:
|
@@ -226,12 +213,12 @@ To test, run:
|
|
226
213
|
|
227
214
|
## Git Signing Key
|
228
215
|
|
229
|
-
To sign your Git tags,
|
216
|
+
To securely sign your Git tags, install and configure [GPG](https://www.gnupg.org):
|
230
217
|
|
231
218
|
brew install gpg
|
232
219
|
gpg --gen-key
|
233
220
|
|
234
|
-
When
|
221
|
+
When creating your GPG key, choose these settings:
|
235
222
|
|
236
223
|
- Key kind: RSA and RSA (default)
|
237
224
|
- Key size: 4096
|
@@ -250,7 +237,7 @@ Add your key to your global Git configuration in the `[user]` section. Example:
|
|
250
237
|
signingkey = <your GPG key>
|
251
238
|
|
252
239
|
Now, when publishing your gems with Gemsmith (i.e. `bundle exec rake publish`), signing of your Git tag will happen
|
253
|
-
automatically.
|
240
|
+
automatically. You will be prompted for the GPG Passphrase each time but that is to be expected.
|
254
241
|
|
255
242
|
## Gem Certificates
|
256
243
|
|
@@ -271,7 +258,7 @@ To learn more about gem certificates, read the following:
|
|
271
258
|
|
272
259
|
# Promotion
|
273
260
|
|
274
|
-
Once your gem is released, you might want to let the world know about your
|
261
|
+
Once your gem is released, you might want to let the world know about your accomplishment:
|
275
262
|
|
276
263
|
- [How to Spread the Word About Your Code](https://hacks.mozilla.org/2013/05/how-to-spread-the-word-about-your-code)
|
277
264
|
- [RubyFlow](http://www.rubyflow.com)
|
data/bin/gemsmith
CHANGED
data/lib/gemsmith.rb
CHANGED
data/lib/gemsmith/aids/gem.rb
CHANGED
data/lib/gemsmith/aids/git.rb
CHANGED
data/lib/gemsmith/aids/spec.rb
CHANGED
data/lib/gemsmith/cli.rb
CHANGED
data/lib/gemsmith/cli_helpers.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gemsmith
|
2
4
|
# Command Line Interface (CLI) helpers for the CLI class.
|
3
5
|
module CLIHelpers
|
@@ -25,7 +27,7 @@ module Gemsmith
|
|
25
27
|
answer = ask "Enter selection:"
|
26
28
|
return if answer == "q"
|
27
29
|
|
28
|
-
if (1..gems.size).
|
30
|
+
if (1..gems.size).cover?(answer.to_i)
|
29
31
|
spec_aid.find name, gems[answer.to_i - 1].version.version
|
30
32
|
else
|
31
33
|
error "Invalid option: #{answer}"
|
data/lib/gemsmith/identity.rb
CHANGED
data/lib/gemsmith/rake/build.rb
CHANGED
data/lib/gemsmith/rake/setup.rb
CHANGED
data/lib/gemsmith/rake/tasks.rb
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Gemsmith
|
2
4
|
module Skeletons
|
3
5
|
# Configures Rake support.
|
4
6
|
class RakeSkeleton < BaseSkeleton
|
7
|
+
def create_console_task
|
8
|
+
cli.template "%gem_name%/lib/tasks/console.rake.tt", configuration.to_h
|
9
|
+
end
|
10
|
+
|
5
11
|
def create
|
12
|
+
create_console_task
|
6
13
|
cli.template "%gem_name%/Rakefile.tt", configuration.to_h
|
7
14
|
configure_rakefile
|
8
15
|
end
|
@@ -1,34 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
2
|
-
require "<%= config.
|
4
|
+
require "<%= config.dig(:gem, :name) %>/identity"
|
3
5
|
|
4
6
|
Gem::Specification.new do |spec|
|
5
|
-
spec.name = <%= config.
|
6
|
-
spec.version = <%= config.
|
7
|
-
spec.platform = <%= config.
|
8
|
-
spec.authors = ["<%= config.
|
9
|
-
spec.email = ["<%= config.
|
10
|
-
spec.homepage = "<%= config.
|
7
|
+
spec.name = <%= config.dig(:gem, :class) %>::Identity.name
|
8
|
+
spec.version = <%= config.dig(:gem, :class) %>::Identity.version
|
9
|
+
spec.platform = <%= config.dig(:gem, :platform) %>
|
10
|
+
spec.authors = ["<%= config.dig(:author, :name) %>"]
|
11
|
+
spec.email = ["<%= config.dig(:author, :email) %>"]
|
12
|
+
spec.homepage = "<%= config.dig(:gem, :home_url) %>"
|
11
13
|
spec.summary = "TODO: Add gem summary here."
|
12
14
|
spec.description = "TODO: Add gem description here."
|
13
15
|
spec.license = "MIT"
|
14
16
|
|
15
|
-
<%- if config.
|
17
|
+
<%- if config.dig(:create, :security) -%>
|
16
18
|
if ENV["RUBY_GEM_SECURITY"] == "enabled"
|
17
|
-
spec.signing_key = File.expand_path("<%= config.
|
18
|
-
spec.cert_chain = [File.expand_path("<%= config.
|
19
|
+
spec.signing_key = File.expand_path("<%= config.dig(:gem, :private_key) %>")
|
20
|
+
spec.cert_chain = [File.expand_path("<%= config.dig(:gem, :public_key) %>")]
|
19
21
|
end
|
20
22
|
<%- end -%>
|
21
23
|
|
22
|
-
<%- if config.
|
24
|
+
<%- if config.dig(:create, :cli) -%>
|
23
25
|
spec.add_dependency "thor"
|
24
26
|
spec.add_dependency "thor_plus"
|
25
27
|
<%- end -%>
|
26
|
-
<%- if config.
|
27
|
-
spec.add_dependency "rails", "~> <%= config.
|
28
|
+
<%- if config.dig(:create, :rails) -%>
|
29
|
+
spec.add_dependency "rails", "~> <%= config.dig(:versions, :rails) %>"
|
28
30
|
<%- end -%>
|
29
31
|
spec.add_development_dependency "rake"
|
30
32
|
spec.add_development_dependency "gemsmith"
|
31
|
-
<%- if config.
|
33
|
+
<%- if config.dig(:create, :pry) -%>
|
32
34
|
spec.add_development_dependency "pry"
|
33
35
|
spec.add_development_dependency "pry-byebug"
|
34
36
|
spec.add_development_dependency "pry-remote"
|
@@ -36,26 +38,26 @@ Gem::Specification.new do |spec|
|
|
36
38
|
spec.add_development_dependency "pry-rescue"
|
37
39
|
spec.add_development_dependency "pry-stack_explorer"
|
38
40
|
<%- end -%>
|
39
|
-
<%- if config.
|
40
|
-
spec.add_development_dependency "<%= config.
|
41
|
+
<%- if config.dig(:create, :rspec) -%>
|
42
|
+
spec.add_development_dependency "<%= config.dig(:create, :rails) ? "rspec-rails" : "rspec" %>"
|
41
43
|
<%- end -%>
|
42
|
-
<%- if config.
|
44
|
+
<%- if config.dig(:create, :guard) -%>
|
43
45
|
spec.add_development_dependency "rb-fsevent" # Guard file events for OSX.
|
44
46
|
spec.add_development_dependency "guard-rspec"
|
45
47
|
spec.add_development_dependency "terminal-notifier"
|
46
48
|
spec.add_development_dependency "terminal-notifier-guard"
|
47
49
|
<%- end -%>
|
48
|
-
<%- if config.
|
50
|
+
<%- if config.dig(:create, :rubocop) -%>
|
49
51
|
spec.add_development_dependency "rubocop"
|
50
52
|
<%- end -%>
|
51
|
-
<%- if config.
|
53
|
+
<%- if config.dig(:create, :code_climate) -%>
|
52
54
|
spec.add_development_dependency "codeclimate-test-reporter"
|
53
55
|
<%- end -%>
|
54
56
|
|
55
57
|
spec.files = Dir["lib/**/*", "vendor/**/*"]
|
56
58
|
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
57
|
-
<%- if config.
|
58
|
-
spec.executables << "<%= config.
|
59
|
+
<%- if config.dig(:create, :cli) -%>
|
60
|
+
spec.executables << "<%= config.dig(:gem, :name) %>"
|
59
61
|
<%- end -%>
|
60
62
|
spec.require_paths = ["lib"]
|
61
63
|
end
|
@@ -1 +1 @@
|
|
1
|
-
<%= config.
|
1
|
+
<%= config.dig(:versions, :ruby) %>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- <%= config.
|
4
|
-
<%- if config.
|
3
|
+
- <%= config.dig(:versions, :ruby) %>
|
4
|
+
<%- if config.dig(:create, :rails) -%>
|
5
5
|
gemfile:
|
6
|
-
- gemfiles/rails-<%= config.
|
6
|
+
- gemfiles/rails-<%= config.dig(:versions, :rails) %>.x.gemfile
|
7
7
|
<%- end -%>
|
8
8
|
script: bundle exec rake
|
9
9
|
notifications:
|
@@ -2,7 +2,7 @@ guard :rspec, cmd: "bundle exec rspec" do
|
|
2
2
|
watch(%r(^spec/.+_spec\.rb$))
|
3
3
|
watch(%r(^lib/(.+)\.rb$)) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
4
4
|
watch("spec/spec_helper.rb") { "spec" }
|
5
|
-
<%- if config.
|
5
|
+
<%- if config.dig(:create, :rails) -%>
|
6
6
|
|
7
7
|
# Rails
|
8
8
|
watch(%r(^app/(.+)\.rb$)) { |m| "spec/#{m[1]}_spec.rb" }
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) <%= config.fetch
|
1
|
+
Copyright (c) <%= config.fetch :year %> [<%= config.dig :organization, :name %>](<%= config.dig :organization, :url %>).
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
4
|
a copy of this software and associated documentation files (the
|
@@ -1,17 +1,17 @@
|
|
1
|
-
# <%= config.
|
1
|
+
# <%= config.dig(:gem, :class) %>
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/<%= config.
|
4
|
-
<%- if config.
|
5
|
-
[![Code Climate GPA](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.
|
6
|
-
[![Code Climate Coverage](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/<%= config.dig(:gem, :name) %>.svg)](http://badge.fury.io/rb/<%= config.dig(:gem, :name) %>)
|
4
|
+
<%- if config.dig(:create, :code_climate) -%>
|
5
|
+
[![Code Climate GPA](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>.svg)](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>)
|
6
|
+
[![Code Climate Coverage](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>/coverage.svg)](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>)
|
7
7
|
<%- end -%>
|
8
|
-
<%- if config.
|
9
|
-
[![Gemnasium Status](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.
|
8
|
+
<%- if config.dig(:create, :gemnasium) -%>
|
9
|
+
[![Gemnasium Status](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>.svg)](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>)
|
10
10
|
<%- end -%>
|
11
|
-
<%- if config.
|
12
|
-
[![Travis CI Status](https://secure.travis-ci.org/<%= config.fetch :github_user %>/<%= config.
|
11
|
+
<%- if config.dig(:create, :travis) -%>
|
12
|
+
[![Travis CI Status](https://secure.travis-ci.org/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>.svg)](https://travis-ci.org/<%= config.fetch :github_user %>/<%= config.dig(:gem, :name) %>)
|
13
13
|
<%- end -%>
|
14
|
-
<%- if config.
|
14
|
+
<%- if config.dig(:create, :patreon) -%>
|
15
15
|
[![Patreon](https://img.shields.io/badge/patreon-donate-brightgreen.svg)](https://www.patreon.com/<%= config.fetch :github_user %>)
|
16
16
|
<%- end -%>
|
17
17
|
|
@@ -22,40 +22,40 @@
|
|
22
22
|
|
23
23
|
# Requirements
|
24
24
|
|
25
|
-
0. [MRI <%= config.
|
26
|
-
<%- if config.
|
25
|
+
0. [MRI <%= config.dig(:versions, :ruby) %>](https://www.ruby-lang.org)
|
26
|
+
<%- if config.dig(:create, :rails) -%>
|
27
27
|
0. [Ruby on Rails](http://rubyonrails.org).
|
28
28
|
<%- end -%>
|
29
29
|
|
30
30
|
# Setup
|
31
31
|
|
32
|
-
<%- if config.
|
32
|
+
<%- if config.dig(:create, :security) -%>
|
33
33
|
For a secure install, type the following (recommended):
|
34
34
|
|
35
35
|
gem cert --add <(curl -Ls https://www.my-website.com/gem-public.pem)
|
36
|
-
gem install <%= config.
|
36
|
+
gem install <%= config.dig(:gem, :name) %> --trust-policy MediumSecurity
|
37
37
|
|
38
38
|
NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while
|
39
39
|
allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
|
40
40
|
|
41
41
|
For an insecure install, type the following (not recommended):
|
42
42
|
|
43
|
-
gem install <%= config.
|
43
|
+
gem install <%= config.dig(:gem, :name) %>
|
44
44
|
<%- else -%>
|
45
45
|
To install, type the following:
|
46
46
|
|
47
|
-
gem install <%= config.
|
47
|
+
gem install <%= config.dig(:gem, :name) %>
|
48
48
|
<%- end -%>
|
49
49
|
|
50
|
-
<%- unless config.
|
50
|
+
<%- unless config.dig(:create, :cli) -%>
|
51
51
|
Add the following to your Gemfile:
|
52
52
|
|
53
|
-
gem "<%= config.
|
53
|
+
gem "<%= config.dig(:gem, :name) %>"
|
54
54
|
<%- end -%>
|
55
55
|
|
56
56
|
# Usage
|
57
57
|
|
58
|
-
<%- if config.
|
58
|
+
<%- if config.dig(:create, :rspec) -%>
|
59
59
|
# Tests
|
60
60
|
|
61
61
|
To test, run:
|
@@ -82,7 +82,7 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for details.
|
|
82
82
|
|
83
83
|
# License
|
84
84
|
|
85
|
-
Copyright (c) <%= config.fetch :year %> [<%= config.
|
85
|
+
Copyright (c) <%= config.fetch :year %> [<%= config.dig :organization, :name %>](<%= config.dig :organization, :url %>).
|
86
86
|
Read the [LICENSE](LICENSE.md) for details.
|
87
87
|
|
88
88
|
# History
|
@@ -92,4 +92,4 @@ Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
|
|
92
92
|
|
93
93
|
# Credits
|
94
94
|
|
95
|
-
Developed by [<%= config.
|
95
|
+
Developed by [<%= config.dig(:author, :name) %>](<%= config.dig :author, :url %>) at [<%= config.dig :organization, :name %>](<%= config.dig :organization, :url %>).
|
@@ -1,8 +1,9 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require "<%= config.
|
4
|
-
require "<%= config.
|
5
|
-
require "<%= config.
|
4
|
+
require "<%= config.dig(:gem, :name) %>"
|
5
|
+
require "<%= config.dig(:gem, :name) %>/cli"
|
6
|
+
require "<%= config.dig(:gem, :name) %>/identity"
|
6
7
|
|
7
|
-
Process.setproctitle <%= config.
|
8
|
-
<%= config.
|
8
|
+
Process.setproctitle <%= config.dig(:gem, :class) %>::Identity.version_label
|
9
|
+
<%= config.dig(:gem, :class) %>::CLI.start
|
@@ -1,4 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require "<%= config.
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "<%= config.dig(:gem, :name) %>/identity"
|
4
|
+
<%- if config.dig(:create, :rails) -%>
|
5
|
+
require "<%= config.dig(:gem, :name) %>/engine"
|
4
6
|
<%- end -%>
|
@@ -1,32 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "yaml"
|
2
4
|
require "thor"
|
3
5
|
require "thor/actions"
|
4
6
|
require "thor_plus/actions"
|
5
7
|
|
6
|
-
module <%= config.
|
8
|
+
module <%= config.dig(:gem, :class) %>
|
7
9
|
# The Command Line Interface (CLI) for the gem.
|
8
10
|
class CLI < Thor
|
9
11
|
include Thor::Actions
|
10
12
|
include ThorPlus::Actions
|
11
13
|
|
12
|
-
package_name <%= config.
|
14
|
+
package_name <%= config.dig(:gem, :class) %>::Identity.version_label
|
13
15
|
|
14
16
|
def initialize args = [], options = {}, config = {}
|
15
17
|
super args, options, config
|
16
18
|
end
|
17
|
-
<%- if config.
|
19
|
+
<%- if config.dig(:create, :cli) -%>
|
18
20
|
|
19
|
-
desc "-e, [--edit]", "Edit #{<%= config.
|
21
|
+
desc "-e, [--edit]", "Edit #{<%= config.dig(:gem, :class) %>::Identity.label} settings in default editor."
|
20
22
|
map %w(-e --edit) => :edit
|
21
23
|
def edit
|
22
|
-
`#{editor} $HOME/#{<%= config.
|
24
|
+
`#{editor} $HOME/#{<%= config.dig(:gem, :class) %>::Identity.file_name}`
|
23
25
|
end
|
24
26
|
<%- end -%>
|
25
27
|
|
26
|
-
desc "-v, [--version]", "Show #{<%= config.
|
28
|
+
desc "-v, [--version]", "Show #{<%= config.dig(:gem, :class) %>::Identity.label} version."
|
27
29
|
map %w(-v --version) => :version
|
28
30
|
def version
|
29
|
-
say <%= config.
|
31
|
+
say <%= config.dig(:gem, :class) %>::Identity.version_label
|
30
32
|
end
|
31
33
|
|
32
34
|
desc "-h, [--help=HELP]", "Show this message or get help for a command."
|
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module <%= config.dig(:gem, :class) %>
|
2
4
|
# Defines and registers the Rails engine.
|
3
5
|
class Engine < ::Rails::Engine
|
4
|
-
isolate_namespace <%= config.
|
6
|
+
isolate_namespace <%= config.dig(:gem, :class) %>
|
5
7
|
end
|
6
8
|
end
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module <%= config.dig(:gem, :class) %>
|
2
4
|
# Gem identity information.
|
3
5
|
module Identity
|
4
6
|
def self.name
|
5
|
-
"<%= config.
|
7
|
+
"<%= config.dig(:gem, :name) %>"
|
6
8
|
end
|
7
9
|
|
8
10
|
def self.label
|
9
|
-
"<%= config.
|
11
|
+
"<%= config.dig(:gem, :class) %>"
|
10
12
|
end
|
11
13
|
|
12
14
|
def self.version
|
@@ -16,7 +18,7 @@ module <%= config.fetch(:gem).fetch(:class) %>
|
|
16
18
|
def self.version_label
|
17
19
|
"#{label} #{version}"
|
18
20
|
end
|
19
|
-
<%- if config.
|
21
|
+
<%- if config.dig(:create, :cli) -%>
|
20
22
|
|
21
23
|
def self.file_name
|
22
24
|
".#{name}rc"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Description:
|
2
|
-
Installs additional <%= config.
|
2
|
+
Installs additional <%= config.dig(:gem, :class) %> resources.
|
3
3
|
|
4
4
|
Example:
|
5
|
-
rails generate <%= config.
|
5
|
+
rails generate <%= config.dig(:gem, :name) %>:install
|
6
6
|
|
7
7
|
This will create:
|
8
8
|
what/will/it/create
|
data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/install_generator.rb.tt
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module <%= config.dig(:gem, :class) %>
|
2
4
|
# Generator for installing new files.
|
3
5
|
class InstallGenerator < Rails::Generators::Base
|
4
6
|
source_root File.join(File.dirname(__FILE__), "..", "templates")
|
5
7
|
|
6
|
-
desc "Installs additional <%= config.
|
8
|
+
desc "Installs additional <%= config.dig(:gem, :class) %> resources."
|
7
9
|
def install
|
8
10
|
# TODO: Add install code.
|
9
11
|
end
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Description:
|
2
|
-
Upgrades previously installed <%= config.
|
2
|
+
Upgrades previously installed <%= config.dig(:gem, :class) %> resources.
|
3
3
|
|
4
4
|
Example:
|
5
|
-
rails generate <%= config.
|
5
|
+
rails generate <%= config.dig(:gem, :name) %>:upgrade
|
6
6
|
|
7
7
|
This will create:
|
8
8
|
what/will/it/create
|
data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/upgrade_generator.rb.tt
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module <%= config.dig(:gem, :class) %>
|
2
4
|
# Generator for updating existing files.
|
3
5
|
class UpgradeGenerator < Rails::Generators::Base
|
4
6
|
source_root File.join(File.dirname(__FILE__), "..", "templates")
|
5
7
|
|
6
|
-
desc "Upgrades previously installed <%= config.
|
8
|
+
desc "Upgrades previously installed <%= config.dig(:gem, :class) %> resources."
|
7
9
|
def upgrade
|
8
10
|
# TODO: Add upgrade code.
|
9
11
|
end
|
@@ -1,19 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "bundler/setup"
|
2
4
|
|
3
|
-
<%- if config.
|
5
|
+
<%- if config.dig(:create, :code_climate) -%>
|
4
6
|
if ENV["CI"]
|
5
7
|
require "codeclimate-test-reporter"
|
6
8
|
CodeClimate::TestReporter.start
|
7
9
|
end
|
8
10
|
|
9
11
|
<%- end -%>
|
10
|
-
<%- if config.
|
12
|
+
<%- if config.dig(:create, :rails) -%>
|
11
13
|
ENV["RAILS_ENV"] ||= "test"
|
12
14
|
require File.expand_path "../dummy/config/environment", __FILE__
|
13
15
|
ENV["RAILS_ROOT"] ||= File.dirname(__FILE__) + "/dummy"
|
14
16
|
|
15
17
|
<%- end -%>
|
16
|
-
require "<%= config.
|
18
|
+
require "<%= config.dig(:gem, :name) %>"
|
17
19
|
|
18
20
|
Dir[File.join(File.dirname(__FILE__), "support/extensions/**/*.rb")].each { |file| require file }
|
19
21
|
Dir[File.join(File.dirname(__FILE__), "support/kit/**/*.rb")].each { |file| require file }
|
@@ -1,6 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
RSpec.configure do |config|
|
2
4
|
config.order = "random"
|
3
5
|
config.filter_run focus: true
|
6
|
+
config.disable_monkey_patching!
|
4
7
|
config.run_all_when_everything_filtered = true
|
5
8
|
config.example_status_persistence_file_path = "./tmp/rspec-status.txt"
|
6
9
|
|
data/lib/tasks/rspec.rake
CHANGED
data/lib/tasks/rubocop.rake
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemsmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,42 +30,42 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '3.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '3.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: tocer
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '2.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '2.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: milestoner
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '2.0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -338,6 +338,7 @@ files:
|
|
338
338
|
- lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/install_generator.rb.tt
|
339
339
|
- lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/USAGE.tt
|
340
340
|
- lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/upgrade_generator.rb.tt
|
341
|
+
- lib/gemsmith/templates/%gem_name%/lib/tasks/console.rake.tt
|
341
342
|
- lib/gemsmith/templates/%gem_name%/lib/tasks/rspec.rake.tt
|
342
343
|
- lib/gemsmith/templates/%gem_name%/lib/tasks/rubocop.rake.tt
|
343
344
|
- lib/gemsmith/templates/%gem_name%/spec/lib/%gem_name%/%gem_name%_spec.rb.tt
|
@@ -347,6 +348,7 @@ files:
|
|
347
348
|
- lib/gemsmith/templates/%gem_name%/spec/support/kit/stderr.rb.tt
|
348
349
|
- lib/gemsmith/templates/%gem_name%/spec/support/kit/stdout.rb.tt
|
349
350
|
- lib/gemsmith/templates/%gem_name%/spec/support/kit/temp_dir.rb.tt
|
351
|
+
- lib/tasks/console.rake
|
350
352
|
- lib/tasks/rspec.rake
|
351
353
|
- lib/tasks/rubocop.rake
|
352
354
|
homepage: https://github.com/bkuhlmann/gemsmith
|
@@ -359,9 +361,9 @@ require_paths:
|
|
359
361
|
- lib
|
360
362
|
required_ruby_version: !ruby/object:Gem::Requirement
|
361
363
|
requirements:
|
362
|
-
- - "
|
364
|
+
- - "~>"
|
363
365
|
- !ruby/object:Gem::Version
|
364
|
-
version: '
|
366
|
+
version: '2.3'
|
365
367
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
366
368
|
requirements:
|
367
369
|
- - ">="
|
@@ -369,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
369
371
|
version: '0'
|
370
372
|
requirements: []
|
371
373
|
rubyforge_project:
|
372
|
-
rubygems_version: 2.5.
|
374
|
+
rubygems_version: 2.5.1
|
373
375
|
signing_key:
|
374
376
|
specification_version: 4
|
375
377
|
summary: A command line interface for smithing new Ruby gems.
|