thor_template 2.0.2 → 2.1.0
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 +1 -1
- data/{bin → exe}/thor_template +0 -0
- data/lib/starter_project/README.md +1 -1
- data/lib/starter_project/{bin → exe}/thor_template +0 -0
- data/lib/starter_project/lib/thor_template.rb +1 -0
- data/lib/starter_project/lib/thor_template/cli.rb +2 -6
- data/lib/starter_project/lib/thor_template/help.rb +9 -0
- data/lib/starter_project/lib/thor_template/help/hello.md +3 -0
- data/lib/starter_project/spec/lib/cli_spec.rb +1 -1
- data/lib/starter_project/spec/spec_helper.rb +2 -2
- data/lib/starter_project/thor_template.gemspec +2 -1
- data/lib/thor_template.rb +2 -1
- data/lib/thor_template/cli.rb +1 -6
- data/lib/thor_template/help.rb +9 -0
- data/lib/thor_template/help/new.md +5 -0
- data/lib/thor_template/renamer.rb +1 -1
- data/lib/thor_template/version.rb +1 -1
- data/spec/lib/cli_spec.rb +4 -4
- data/spec/spec_helper.rb +2 -2
- data/thor_template.gemspec +2 -1
- metadata +9 -7
- data/lib/starter_project/lib/thor_template/cli/help.rb +0 -13
- data/lib/thor_template/cli/help.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1761a5aa4a73d962066765feeb7949f606440d04
|
4
|
+
data.tar.gz: c001211c5758678b4a382b4381358d87fac1a127
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64b2a7d826cea332c687535c79d7739a5f2456594f7608fe5b91e6c989d55435e881ce7ca8f86a87bc0784e75d965734d6c3fcfd53a5676a601cf48117acb574
|
7
|
+
data.tar.gz: f74a3bc2cafeae3d4317233c699657852c1be5002c9ce1857c2fc57a809577ada22feb2f0b880d1108ad19ab02324623ae8004ae1eeaf8b5d09048995bb59124
|
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
|
+
## [2.1.0]
|
7
|
+
|
8
|
+
- improve help class
|
9
|
+
- comment out SimpleCov
|
10
|
+
- reanme bin folder to exe
|
11
|
+
|
6
12
|
## [2.0.1]
|
7
13
|
|
8
14
|
- fix gem name that gets build for the starter project
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ gem install thor_template
|
|
18
18
|
```sh
|
19
19
|
thor_template new mycli
|
20
20
|
cd mycli
|
21
|
-
|
21
|
+
exe/mycli hello world
|
22
22
|
```
|
23
23
|
|
24
24
|
The above generated a starter CLI project called mycli with a working hello command. The generated project also has starter specs for you 😁
|
data/{bin → exe}/thor_template
RENAMED
File without changes
|
File without changes
|
@@ -1,16 +1,12 @@
|
|
1
|
-
require "thor"
|
2
|
-
require "thor_template/cli/help"
|
3
|
-
|
4
1
|
module ThorTemplate
|
5
|
-
|
6
2
|
class CLI < Command
|
7
3
|
class_option :verbose, type: :boolean
|
8
4
|
class_option :noop, type: :boolean
|
9
5
|
|
10
6
|
desc "hello NAME", "say hello to NAME"
|
11
|
-
long_desc Help.hello
|
7
|
+
long_desc Help.text(:hello)
|
12
8
|
option :from, desc: "from person"
|
13
|
-
def hello(name)
|
9
|
+
def hello(name="you")
|
14
10
|
puts "from: #{options[:from]}" if options[:from]
|
15
11
|
puts "Hello #{name}"
|
16
12
|
end
|
@@ -12,7 +12,7 @@ describe ThorTemplate::CLI do
|
|
12
12
|
|
13
13
|
describe "USER_PROVIDED_NAME" do
|
14
14
|
it "should hello world" do
|
15
|
-
out = execute("
|
15
|
+
out = execute("exe/USER_PROVIDED_NAME hello world #{@args}")
|
16
16
|
expect(out).to include("from: Tung\nHello world")
|
17
17
|
end
|
18
18
|
end
|
@@ -14,7 +14,8 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
data/lib/thor_template.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
$:.unshift(File.expand_path("../", __FILE__))
|
2
2
|
require "thor/vcr" if ENV['VCR'] == '1'
|
3
|
-
require "thor_template/
|
3
|
+
require "thor_template/version"
|
4
4
|
|
5
5
|
module ThorTemplate
|
6
|
+
autoload :Help, 'thor_template/help'
|
6
7
|
autoload :Command, 'thor_template/command'
|
7
8
|
autoload :Version, 'thor_template/version'
|
8
9
|
autoload :Generator, 'thor_template/generator'
|
data/lib/thor_template/cli.rb
CHANGED
@@ -1,17 +1,12 @@
|
|
1
|
-
require 'thor'
|
2
|
-
require 'thor_template/command'
|
3
|
-
require 'thor_template/cli/help'
|
4
|
-
|
5
1
|
module ThorTemplate
|
6
|
-
|
7
2
|
class CLI < Command
|
8
3
|
class_option :verbose, :type => :boolean
|
9
4
|
class_option :noop, :type => :boolean
|
10
5
|
|
11
6
|
desc "new NAME", "generates project based on thor template"
|
7
|
+
long_desc Help.text(:new)
|
12
8
|
def new(name)
|
13
9
|
Generator.new(options.merge(name: name)).run
|
14
10
|
end
|
15
|
-
|
16
11
|
end
|
17
12
|
end
|
data/spec/lib/cli_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe ThorTemplate::CLI do
|
|
13
13
|
describe "new" do
|
14
14
|
context("simple single name") do
|
15
15
|
it "should generate" do
|
16
|
-
out = execute("cd tmp && ../
|
16
|
+
out = execute("cd tmp && ../exe/thor_template new hello #{@args}")
|
17
17
|
expect(out).to include("Created hello project!")
|
18
18
|
out = execute("cd tmp/hello && rake")
|
19
19
|
expect(out).to include("0 failures")
|
@@ -22,7 +22,7 @@ describe ThorTemplate::CLI do
|
|
22
22
|
|
23
23
|
context("underscored name") do
|
24
24
|
it "should generate" do
|
25
|
-
out = execute("cd tmp && ../
|
25
|
+
out = execute("cd tmp && ../exe/thor_template new my_cli #{@args}")
|
26
26
|
expect(out).to include("Created my_cli project!")
|
27
27
|
out = execute("cd tmp/my_cli && rake")
|
28
28
|
expect(out).to include("0 failures")
|
@@ -31,7 +31,7 @@ describe ThorTemplate::CLI do
|
|
31
31
|
|
32
32
|
context("dasherized name") do
|
33
33
|
it "should generate" do
|
34
|
-
out = execute("cd tmp && ../
|
34
|
+
out = execute("cd tmp && ../exe/thor_template new my-cli #{@args}")
|
35
35
|
expect(out).to include("Created my-cli project!")
|
36
36
|
out = execute("cd tmp/my-cli && rake")
|
37
37
|
expect(out).to include("0 failures")
|
@@ -41,7 +41,7 @@ describe ThorTemplate::CLI do
|
|
41
41
|
# CamelCase is ugly :(
|
42
42
|
context("simple CamelCase name") do
|
43
43
|
it "should generate" do
|
44
|
-
out = execute("cd tmp && ../
|
44
|
+
out = execute("cd tmp && ../exe/thor_template new MyCli #{@args}")
|
45
45
|
expect(out).to include("Created MyCli project!")
|
46
46
|
out = execute("cd tmp/MyCli && rake")
|
47
47
|
expect(out).to include("0 failures")
|
data/spec/spec_helper.rb
CHANGED
data/thor_template.gemspec
CHANGED
@@ -14,7 +14,8 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
|
-
spec.
|
17
|
+
spec.bindir = "exe"
|
18
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
20
|
spec.require_paths = ["lib"]
|
20
21
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -179,7 +179,7 @@ files:
|
|
179
179
|
- LICENSE.txt
|
180
180
|
- README.md
|
181
181
|
- Rakefile
|
182
|
-
-
|
182
|
+
- exe/thor_template
|
183
183
|
- lib/starter_project/.gitignore
|
184
184
|
- lib/starter_project/.rspec
|
185
185
|
- lib/starter_project/Gemfile
|
@@ -187,20 +187,22 @@ files:
|
|
187
187
|
- lib/starter_project/LICENSE.txt
|
188
188
|
- lib/starter_project/README.md
|
189
189
|
- lib/starter_project/Rakefile
|
190
|
-
- lib/starter_project/
|
190
|
+
- lib/starter_project/exe/thor_template
|
191
191
|
- lib/starter_project/lib/thor_template.rb
|
192
192
|
- lib/starter_project/lib/thor_template/cli.rb
|
193
|
-
- lib/starter_project/lib/thor_template/cli/help.rb
|
194
193
|
- lib/starter_project/lib/thor_template/command.rb
|
194
|
+
- lib/starter_project/lib/thor_template/help.rb
|
195
|
+
- lib/starter_project/lib/thor_template/help/hello.md
|
195
196
|
- lib/starter_project/lib/thor_template/version.rb
|
196
197
|
- lib/starter_project/spec/lib/cli_spec.rb
|
197
198
|
- lib/starter_project/spec/spec_helper.rb
|
198
199
|
- lib/starter_project/thor_template.gemspec
|
199
200
|
- lib/thor_template.rb
|
200
201
|
- lib/thor_template/cli.rb
|
201
|
-
- lib/thor_template/cli/help.rb
|
202
202
|
- lib/thor_template/command.rb
|
203
203
|
- lib/thor_template/generator.rb
|
204
|
+
- lib/thor_template/help.rb
|
205
|
+
- lib/thor_template/help/new.md
|
204
206
|
- lib/thor_template/renamer.rb
|
205
207
|
- lib/thor_template/version.rb
|
206
208
|
- spec/lib/cli_spec.rb
|