luban-cli 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b679ddf44c3d8c2160b781e4cd223b690d73374a
4
- data.tar.gz: 7044ecf37e291aa532d40b555eb0ec914695a220
3
+ metadata.gz: 83a10043132409c7e0d1bf93e9543307a4810cbe
4
+ data.tar.gz: 9d8f68f187e40c65457e8146cfb8b09adf5c1fa6
5
5
  SHA512:
6
- metadata.gz: 9ef5aa5390ba3076de671915c55287f74ce5785e9c7a956ff93fd945197f2e8fe56c389c3c42928c775b3ec33dee60d4b0ee448c2ed5683a74ff0e65b9ef19a2
7
- data.tar.gz: 3856eeab84ad6ba609644d675c81ee11b3e7c5fb34fa3b6587c55b6f6358374dd8020b1bf9bbc36786d2e432e20201914b39209e4271325e766330fe3bd26894
6
+ metadata.gz: 2e595eb672e72a9668f49dec03a3b92a09e97c214f1d5911bd9c6a0e237796c1b65ce3a5d0321daa51ef5702aa93b058ef0ac8f5bb1aeb0e53d4f3de25360ae4
7
+ data.tar.gz: 1345813a8edbe2e4168971df568a4a9444f1893dee73e0e0188bda87d15b7952a85ae1479298b98fbd87db01c33ba156edc31af47260bb8bce0010c8b4a07fed
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change log
2
2
 
3
+ ## Version 0.4.6 (Sept 27, 2016)
4
+
5
+ New features:
6
+ * Added a special command, task, that supports common task options
7
+
3
8
  ## Version 0.4.5 (Sept 07, 2016)
4
9
 
5
10
  Bug fixes:
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Luban
2
2
  module CLI
3
- VERSION = "0.4.5"
3
+ VERSION = "0.4.6"
4
4
  end
5
5
  end
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.5
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-06 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler