cli-template 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -0
- data/lib/cli_template/command.rb +9 -0
- data/lib/cli_template/git.rb +4 -6
- data/lib/cli_template/new.rb +1 -1
- data/lib/cli_template/version.rb +1 -1
- data/lib/templates/default/%project_name%.gemspec.tt +2 -2
- data/lib/templates/default/.gitignore +1 -0
- data/lib/templates/default/README.md.tt +5 -5
- data/lib/templates/default/lib/%underscored_name%/cli.rb.tt +2 -2
- data/lib/templates/default/lib/%underscored_name%/command.rb.tt +7 -0
- data/lib/templates/default/spec/{lib/cli_spec.rb.tt → cli_spec.rb.tt} +0 -0
- data/lib/templates/default/spec/spec_helper.rb.tt +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f3f82e913410a8c4634a7bb8bd528096b4b2cc7d3f0c1878d5f12a3871e9d12
|
4
|
+
data.tar.gz: a75775c0bd04e65c98fdbccb2d5520a37c6d232904c6cceec3de02026fd42f75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 333ec0c578e5ee278278060d6c6965a9bd70a4a8b57e1644377d73a0d2aa0b6d9986d8ca194aca3f720fb469c3af91faf652f6131c9b0668179716cf52a2f1ce
|
7
|
+
data.tar.gz: 75292573d8cc56e232a39fe936a55e4ecf8fba0b083ea5b45263ca6e8f24b1dbee2010d9d71c11309138d3e7d4163cf5cffad9502218139bfcea1a89969640a1
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
|
5
5
|
|
6
|
+
## [4.0.2]
|
7
|
+
- add project name in _TEST env var and define exit_on_failure? to remove deprecation
|
8
|
+
- ignore Gemfile.lock in starter project
|
9
|
+
- remove deprecations: exit_on_failure with_unbundled_env
|
10
|
+
- sh mute option for git commands
|
11
|
+
|
6
12
|
## [4.0.1]
|
7
13
|
- dynamically get git user name and email in starter project
|
8
14
|
- update cli help menus
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
[![CircleCI](https://circleci.com/gh/tongueroo/cli-template.svg?style=svg)](https://circleci.com/gh/tongueroo/cli-template)
|
4
4
|
[![Maintainability](https://api.codeclimate.com/v1/badges/c6c4f26aaafccab10baf/maintainability)](https://codeclimate.com/github/tongueroo/cli-template/maintainability)
|
5
5
|
|
6
|
+
[![BoltOps Badge](https://img.boltops.com/boltops/badges/boltops-badge.png)](https://www.boltops.com)
|
7
|
+
|
6
8
|
`cli-template` is a generator tool that builds a starter CLI project based on [Thor](http://whatisthor.com/). It is the successor tool to [thor_template](https://github.com/tongueroo/thor_template), which is also a tool that generates CLI projects.
|
7
9
|
|
8
10
|
The predecessor tool is covered in this original blog post, [Build Thor CLI Project in Under a Second](https://blog.boltops.com/2017/09/14/build-thor-cli-project-in-under-a-second). It covers usage and also contains a video demo. An updated blog post will eventually be made, for now, refer to the original blog post.
|
data/lib/cli_template/command.rb
CHANGED
@@ -43,5 +43,14 @@ module CliTemplate
|
|
43
43
|
super
|
44
44
|
end
|
45
45
|
end
|
46
|
+
|
47
|
+
# https://github.com/erikhuda/thor/issues/244
|
48
|
+
# Deprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Lono::CLI`
|
49
|
+
# You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
|
50
|
+
no_commands do
|
51
|
+
def exit_on_failure?
|
52
|
+
true
|
53
|
+
end
|
54
|
+
end
|
46
55
|
end
|
47
56
|
end
|
data/lib/cli_template/git.rb
CHANGED
@@ -2,19 +2,17 @@ module CliTemplate
|
|
2
2
|
class Git
|
3
3
|
class << self
|
4
4
|
def user_name
|
5
|
-
sh "git config --get user.name"
|
5
|
+
sh "git config --get user.name", mute: true
|
6
6
|
end
|
7
7
|
|
8
8
|
def user_email
|
9
|
-
sh "git config --get user.email"
|
9
|
+
sh "git config --get user.email", mute: true
|
10
10
|
end
|
11
11
|
|
12
|
-
def sh(command)
|
13
|
-
puts "=> #{command}"
|
12
|
+
def sh(command, mute: false)
|
13
|
+
puts "=> #{command}" unless mute
|
14
14
|
stdout = `#{command}`
|
15
15
|
out = stdout.strip
|
16
|
-
puts "stdout #{stdout.inspect}"
|
17
|
-
puts "out #{out.inspect}"
|
18
16
|
return out if !out&.empty?
|
19
17
|
end
|
20
18
|
end
|
data/lib/cli_template/new.rb
CHANGED
data/lib/cli_template/version.rb
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = <%= project_class_name %>::VERSION
|
9
9
|
spec.authors = ["<%= CliTemplate::Git.user_name %>"]
|
10
10
|
spec.email = ["<%= CliTemplate::Git.user_email %>"]
|
11
|
-
spec.summary = "Generated with cli-template tool. Please write a gem summary"
|
12
|
-
spec.description = "Generated with cli-template tool. Write a longer description or delete this line."
|
11
|
+
spec.summary = "Generated with cli-template tool. Please write a gem summary" # TODO: changeme
|
12
|
+
spec.description = "Generated with cli-template tool. Write a longer description or delete this line." # TODO: changeme
|
13
13
|
spec.homepage = "https://github.com/USERNAME/<%= project_name %>" # TODO: changeme
|
14
14
|
spec.license = ""
|
15
15
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# <%= project_class_name %>
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb
|
4
|
-
[![CircleCI](https://circleci.com/gh/USER
|
5
|
-
[![Dependency Status](https://gemnasium.com/USER
|
6
|
-
[![Coverage Status](https://coveralls.io/
|
7
|
-
[![Join the chat at https://gitter.im/USER
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/<%= project_name %>.png)](http://badge.fury.io/rb/<%= project_name %>)
|
4
|
+
[![CircleCI](https://circleci.com/gh/USER/<%= project_name %>.svg?style=svg)](https://circleci.com/gh/USER/<%= project_name %>)
|
5
|
+
[![Dependency Status](https://gemnasium.com/USER/<%= project_name %>.png)](https://gemnasium.com/USER/<%= project_name %>)
|
6
|
+
[![Coverage Status](https://coveralls.io/<%= project_name %>s/USER/<%= project_name %>/badge.png)](https://coveralls.io/r/USER/<%= project_name %>)
|
7
|
+
[![Join the chat at https://gitter.im/USER/<%= project_name %>](https://badges.gitter.im/USER/<%= project_name %>.svg)](https://gitter.im/USER/<%= project_name %>?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
8
8
|
[![Support](https://img.shields.io/badge/get-support-blue.svg)](https://boltops.com?utm_source=badge&utm_medium=badge&utm_campaign=<%= project_name %>)
|
9
9
|
|
10
10
|
TODO: Write a gem description
|
@@ -17,13 +17,13 @@ module <%= project_class_name %>
|
|
17
17
|
<% end -%>
|
18
18
|
|
19
19
|
desc "completion *PARAMS", "Prints words for auto-completion."
|
20
|
-
long_desc Help.text(
|
20
|
+
long_desc Help.text(:completion)
|
21
21
|
def completion(*params)
|
22
22
|
Completer.new(CLI, *params).run
|
23
23
|
end
|
24
24
|
|
25
25
|
desc "completion_script", "Generates a script that can be eval to setup auto-completion."
|
26
|
-
long_desc Help.text(
|
26
|
+
long_desc Help.text(:completion_script)
|
27
27
|
def completion_script
|
28
28
|
Completer::Script.generate
|
29
29
|
end
|
@@ -77,6 +77,13 @@ module <%= project_class_name %>
|
|
77
77
|
def website
|
78
78
|
""
|
79
79
|
end
|
80
|
+
|
81
|
+
# https://github.com/erikhuda/thor/issues/244
|
82
|
+
# Deprecation warning: Thor exit with status 0 on errors. To keep this behavior, you must define `exit_on_failure?` in `Lono::CLI`
|
83
|
+
# You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
|
84
|
+
def exit_on_failure?
|
85
|
+
true
|
86
|
+
end
|
80
87
|
end
|
81
88
|
end
|
82
89
|
end
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cli-template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -234,7 +234,7 @@ files:
|
|
234
234
|
- lib/templates/default/lib/%underscored_name%/help/sub/goodbye.md.tt
|
235
235
|
- lib/templates/default/lib/%underscored_name%/sub.rb.tt
|
236
236
|
- lib/templates/default/lib/%underscored_name%/version.rb.tt
|
237
|
-
- lib/templates/default/spec/
|
237
|
+
- lib/templates/default/spec/cli_spec.rb.tt
|
238
238
|
- lib/templates/default/spec/spec_helper.rb.tt
|
239
239
|
- spec/lib/cli_spec.rb
|
240
240
|
- spec/spec_helper.rb
|
@@ -257,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
257
257
|
- !ruby/object:Gem::Version
|
258
258
|
version: '0'
|
259
259
|
requirements: []
|
260
|
-
rubygems_version: 3.
|
260
|
+
rubygems_version: 3.1.2
|
261
261
|
signing_key:
|
262
262
|
specification_version: 4
|
263
263
|
summary: Generate a CLI tool quickly
|