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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 574675906a5563a0fd58d1afd7c4e9d28aa72ca2689bdf8802ad11212f7b9d18
4
- data.tar.gz: 3950f3c40baef9b16aa3a11115c153f148af09f5b7c0e673a8d1b985571b089f
3
+ metadata.gz: 0f3f82e913410a8c4634a7bb8bd528096b4b2cc7d3f0c1878d5f12a3871e9d12
4
+ data.tar.gz: a75775c0bd04e65c98fdbccb2d5520a37c6d232904c6cceec3de02026fd42f75
5
5
  SHA512:
6
- metadata.gz: ad3011b0a62b11ede64d8272d8b990e6441afb860e778d07ed9aa8a7885574d700e5efce1e59cfdb359069ac500ce9a640c55a8e927a3eebabcf1233d42247b6
7
- data.tar.gz: 56ce4cb3011d19e6740bfc7b2a16c007bc37641d112d087c4ff3930ec422f74986dc785ad271a09e9fe389d1ea5fc49e2416c64d5569524156c6b73348b8ebc8
6
+ metadata.gz: 333ec0c578e5ee278278060d6c6965a9bd70a4a8b57e1644377d73a0d2aa0b6d9986d8ca194aca3f720fb469c3af91faf652f6131c9b0668179716cf52a2f1ce
7
+ data.tar.gz: 75292573d8cc56e232a39fe936a55e4ecf8fba0b083ea5b45263ca6e8f24b1dbee2010d9d71c11309138d3e7d4163cf5cffad9502218139bfcea1a89969640a1
@@ -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.
@@ -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
@@ -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
@@ -32,7 +32,7 @@ module CliTemplate
32
32
  end
33
33
 
34
34
  def bundle_install
35
- Bundler.with_clean_env do
35
+ Bundler.with_unbundled_env do
36
36
  system("BUNDLE_IGNORE_CONFIG=1 bundle install")
37
37
  end
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module CliTemplate
2
- VERSION = "4.0.1"
2
+ VERSION = "4.0.2"
3
3
  end
@@ -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
 
@@ -14,3 +14,4 @@ spec/reports
14
14
  test/tmp
15
15
  test/version_tmp
16
16
  tmp
17
+ Gemfile.lock
@@ -1,10 +1,10 @@
1
1
  # <%= project_class_name %>
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/GEMNAME.png)](http://badge.fury.io/rb/GEMNAME)
4
- [![CircleCI](https://circleci.com/gh/USER/REPO.svg?style=svg)](https://circleci.com/gh/USER/REPO)
5
- [![Dependency Status](https://gemnasium.com/USER/REPO.png)](https://gemnasium.com/USER/REPO)
6
- [![Coverage Status](https://coveralls.io/repos/USER/REPO/badge.png)](https://coveralls.io/r/USER/REPO)
7
- [![Join the chat at https://gitter.im/USER/REPO](https://badges.gitter.im/USER/REPO.svg)](https://gitter.im/USER/REPO?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
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("completion")
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("completion_script")
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
@@ -1,4 +1,4 @@
1
- ENV["TEST"] = "1"
1
+ ENV["<%= project_name.gsub('-','_').upcase %>_TEST"] = "1"
2
2
 
3
3
  # CodeClimate test coverage: https://docs.codeclimate.com/docs/configuring-test-coverage
4
4
  # require 'simplecov'
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.1
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: 2019-11-17 00:00:00.000000000 Z
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/lib/cli_spec.rb.tt
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.0.6
260
+ rubygems_version: 3.1.2
261
261
  signing_key:
262
262
  specification_version: 4
263
263
  summary: Generate a CLI tool quickly