sickle 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sickle/version.rb +1 -1
- data/lib/sickle.rb +14 -6
- data/spec/test_app.rb +8 -0
- 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: 9d6d7d2d6dfd2681a01e6779dcdbe4852c61a686
|
4
|
+
data.tar.gz: 9d83e74583c8cab836c632ad26770da8479e1850
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6366d4ec7476621c4b293c6002bf7f961ab4ef797512ef4e4da8375f25788777b8927cec56827f1f79513fedbc11644b0e4fb422e111f1a9d6c501c3940af69
|
7
|
+
data.tar.gz: b03c524c935117688ebcd826dbe3196218598658736ba075bc9cdfe8a0e730471b546289a02cb70fe48c84a4f95931c7173375f29ca52fd58c7ee84d38bad8d4
|
data/lib/sickle/version.rb
CHANGED
data/lib/sickle.rb
CHANGED
@@ -101,14 +101,20 @@ module Sickle
|
|
101
101
|
end
|
102
102
|
|
103
103
|
module Help
|
104
|
-
def
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
-
|
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.
|
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-
|
11
|
+
date: 2013-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|