thor_template 2.1.1 → 2.2.0

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: beb6675124101ee3b1963142ccdfc3282efa0e0cfc800c735d924f5a4e9596ba
4
- data.tar.gz: 50162e0bcf30aa26256528e92a9c40084b79439dd4fc37f8ea5e0a9975d37fc0
3
+ metadata.gz: '078d747b35ff11c86cc37abbc847c79f0fe848712030d58f9c712f238d877e59'
4
+ data.tar.gz: f84adf8e82050605d8b53c7098bc783a8a5a3ec2c32b037fb098af7bc7e41eb4
5
5
  SHA512:
6
- metadata.gz: 36cbe9617f4ee5c85df9c454f952205cd6fea42d698691965d0f0aa06db25e33a291c428e59a59e422d7ad6eebb4cc259b304c7e03f16af8fef9348e4a44e84b
7
- data.tar.gz: 438dc6c3a7b97d939366c1bafafca4e65fda7aeaadcddec9aa8234b40787d63d4b9f4e1ac3b118f5d18f41a1a7144c974ca00c7897d2fc29057e4b003e5c13fa
6
+ metadata.gz: a61947b603469446762d0b35662ac03a1efd0478c91c6748da634c1372175f97e265bde06fd3a6f0f5891d4652eeb37539ede289de1469288a3f82e7d2d289ec
7
+ data.tar.gz: f3b8604be4244efdd6762ab9e323951bc07358d9fca9e401917c06b884534974fc20f132b4af74f71299dda3fea71b4451f679e34f204ab0dba7a15baa0351fd
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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.2.0]
7
+ - simple help formatting
8
+ - add version command
9
+
6
10
  ## [2.1.1]
7
11
 
8
12
  - starter project use version 0.1.0
@@ -0,0 +1,7 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ This project *tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
+
6
+ ## [0.1.0]
7
+ - Initial release.
@@ -11,5 +11,9 @@ module ThorTemplate
11
11
  puts "Hello #{name}"
12
12
  end
13
13
 
14
+ desc "version", "prints version"
15
+ def version
16
+ puts ThorTemplate::VERSION
17
+ end
14
18
  end
15
19
  end
@@ -1,5 +1,18 @@
1
1
  require "thor"
2
2
 
3
+ # Override thor's long_desc identation behavior
4
+ # https://github.com/erikhuda/thor/issues/398
5
+ class Thor
6
+ module Shell
7
+ class Basic
8
+ def print_wrapped(message, options = {})
9
+ message = "\n#{message}" unless message[0] == "\n"
10
+ stdout.puts message
11
+ end
12
+ end
13
+ end
14
+ end
15
+
3
16
  module ThorTemplate
4
17
  class Command < Thor
5
18
  class << self
@@ -18,6 +31,14 @@ module ThorTemplate
18
31
  args -= help_flags
19
32
  args.insert(-2, "help")
20
33
  end
34
+
35
+ # thor_template version
36
+ # thor_template --version
37
+ version_flags = ["--version"]
38
+ if args.length == 1 && !(args & version_flags).empty?
39
+ args = ["version"]
40
+ end
41
+
21
42
  super
22
43
  end
23
44
  end
@@ -20,13 +20,10 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ["lib"]
21
21
 
22
22
  spec.add_dependency "thor"
23
- spec.add_dependency "hashie"
24
23
  spec.add_dependency "colorize"
25
24
 
26
25
  spec.add_development_dependency "bundler"
27
26
  spec.add_development_dependency "byebug"
28
27
  spec.add_development_dependency "rake"
29
- spec.add_development_dependency "guard"
30
- spec.add_development_dependency "guard-bundler"
31
- spec.add_development_dependency "guard-rspec"
28
+ spec.add_development_dependency "rspec"
32
29
  end
@@ -8,5 +8,10 @@ module ThorTemplate
8
8
  def new(name)
9
9
  Generator.new(options.merge(name: name)).run
10
10
  end
11
+
12
+ desc "version", "prints version"
13
+ def version
14
+ puts ThorTemplate::VERSION
15
+ end
11
16
  end
12
17
  end
@@ -18,6 +18,14 @@ module ThorTemplate
18
18
  args -= help_flags
19
19
  args.insert(-2, "help")
20
20
  end
21
+
22
+ # thor_template version
23
+ # thor_template --version
24
+ version_flags = ["--version"]
25
+ if args.length == 1 && !(args & version_flags).empty?
26
+ args = ["version"]
27
+ end
28
+
21
29
  super
22
30
  end
23
31
  end
@@ -1,3 +1,3 @@
1
1
  module ThorTemplate
2
- VERSION = "2.1.1"
2
+ VERSION = "2.2.0"
3
3
  end
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.1.1
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
11
+ date: 2018-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -182,6 +182,7 @@ files:
182
182
  - exe/thor_template
183
183
  - lib/starter_project/.gitignore
184
184
  - lib/starter_project/.rspec
185
+ - lib/starter_project/CHANGELOG.md
185
186
  - lib/starter_project/Gemfile
186
187
  - lib/starter_project/Guardfile
187
188
  - lib/starter_project/LICENSE.txt