sickle 0.1.1 → 0.2.0

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: c06036c890b687b9b31db7c53c1257557f3b17ac
4
- data.tar.gz: 54b6d5568832346a90feef14ee5503123ed8a7a2
3
+ metadata.gz: 9d6d7d2d6dfd2681a01e6779dcdbe4852c61a686
4
+ data.tar.gz: 9d83e74583c8cab836c632ad26770da8479e1850
5
5
  SHA512:
6
- metadata.gz: bf0531a520789a8092b9a7d191fd0599addef42b488504c38a2767223559d3d9078239176206bf62c906bfdd427a247d425de8e7f82f2c6104708129d3fbb9f5
7
- data.tar.gz: c0e54de12d2a377ea44122a568afc7d7256fa73caa6c85631c3648758572313a2cd6fbed88b69f39d08449f6e48335e55788d3278e3435e69f66b5d7c3e2216e
6
+ metadata.gz: f6366d4ec7476621c4b293c6002bf7f961ab4ef797512ef4e4da8375f25788777b8927cec56827f1f79513fedbc11644b0e4fb422e111f1a9d6c501c3940af69
7
+ data.tar.gz: b03c524c935117688ebcd826dbe3196218598658736ba075bc9cdfe8a0e730471b546289a02cb70fe48c84a4f95931c7173375f29ca52fd58c7ee84d38bad8d4
@@ -1,3 +1,3 @@
1
1
  module Sickle
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/sickle.rb CHANGED
@@ -101,14 +101,20 @@ module Sickle
101
101
  end
102
102
 
103
103
  module Help
104
- def help(command = nil)
105
- if command
106
- __display_help_for_command(command)
107
- else
108
- __display_help
104
+ def self.included(base)
105
+ base.class_eval do
106
+ desc "Display help"
107
+ def help(command = nil)
108
+ if command
109
+ __display_help_for_command(command)
110
+ else
111
+ __display_help
112
+ end
113
+ end
109
114
  end
110
115
  end
111
116
 
117
+
112
118
  def __display_help_for_command(name)
113
119
  if cmd = self.class.__commands[name]
114
120
  puts "USAGE:"
@@ -247,7 +253,9 @@ module Sickle
247
253
 
248
254
  def method_added(a)
249
255
  meth = instance_method(a)
250
- __commands[a.to_s] = Command.new(meth, a, Sickle.pop_desc, Sickle.pop_options)
256
+ if desc = Sickle.pop_desc
257
+ __commands[a.to_s] = Command.new(meth, a, desc, Sickle.pop_options)
258
+ end
251
259
  end
252
260
  end
253
261
  end
data/spec/test_app.rb CHANGED
@@ -8,6 +8,7 @@ module Sub
8
8
  p ["sub1"]
9
9
  end
10
10
 
11
+ desc "Will make conflict!"
11
12
  def conflict
12
13
  p ["sub1:conflict"]
13
14
  end
@@ -21,6 +22,7 @@ module Other
21
22
  p ["other1", blah]
22
23
  end
23
24
 
25
+ desc "Will make conflict!"
24
26
  def conflict
25
27
  p ["other1:conflict"]
26
28
  end
@@ -34,6 +36,7 @@ module NoSub
34
36
  p ["nosub"]
35
37
  end
36
38
 
39
+ desc "Will make conflict!"
37
40
  def conflict
38
41
  p ["nosub:conflict"]
39
42
  end
@@ -59,15 +62,20 @@ class App
59
62
  p ["task2", options[:number], options[:fast], options[:slow], options[:verbose], options[:debug]]
60
63
  end
61
64
 
65
+ desc "Will make conflict!"
62
66
  def conflict
63
67
  p ["app:conflict"]
64
68
  end
65
69
 
66
70
  option :null, :default => nil
71
+ desc "Test"
67
72
  def test_option
68
73
  p ["test_option", options[:null]]
69
74
  end
70
75
 
76
+ def private_task
77
+ end
78
+
71
79
 
72
80
  include_modules :sub => Sub,
73
81
  :other => Other
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sickle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tymon Tobolski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-13 00:00:00.000000000 Z
11
+ date: 2013-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler