luban-cli 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/luban/cli/base/commands.rb +17 -0
- data/lib/luban/cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83a10043132409c7e0d1bf93e9543307a4810cbe
|
4
|
+
data.tar.gz: 9d8f68f187e40c65457e8146cfb8b09adf5c1fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e595eb672e72a9668f49dec03a3b92a09e97c214f1d5911bd9c6a0e237796c1b65ce3a5d0321daa51ef5702aa93b058ef0ac8f5bb1aeb0e53d4f3de25360ae4
|
7
|
+
data.tar.gz: 1345813a8edbe2e4168971df568a4a9444f1893dee73e0e0188bda87d15b7952a85ae1479298b98fbd87db01c33ba156edc31af47260bb8bce0010c8b4a07fed
|
data/CHANGELOG.md
CHANGED
@@ -36,6 +36,17 @@ module Luban
|
|
36
36
|
!@commands.empty?
|
37
37
|
end
|
38
38
|
|
39
|
+
def task(cmd, **opts, &blk)
|
40
|
+
command(cmd, **opts, &blk).tap do |t|
|
41
|
+
add_common_task_options(t)
|
42
|
+
if !t.summary.nil? and t.description.empty?
|
43
|
+
t.long_desc "#{t.summary} in #{self.class.name}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
alias_method :undef_task, :undef_command
|
49
|
+
|
39
50
|
protected
|
40
51
|
|
41
52
|
def command_class(cmd, base)
|
@@ -58,6 +69,12 @@ module Luban
|
|
58
69
|
def define_command_class(class_name, base)
|
59
70
|
self.class.send(:define_class, class_name, base: base, namespace: self.class)
|
60
71
|
end
|
72
|
+
|
73
|
+
def add_common_task_options(task)
|
74
|
+
if @parent != self and @parent.respond_to?(__method__, true)
|
75
|
+
@parent.send(__method__, task)
|
76
|
+
end
|
77
|
+
end
|
61
78
|
end
|
62
79
|
end
|
63
80
|
end
|
data/lib/luban/cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luban-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rubyist Chi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|