djinni 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/djinni.rb +18 -4
- data/lib/djinni_wish.rb +6 -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: 6b1341fff2b9dd3479fb8b3afadad006838a1015
|
4
|
+
data.tar.gz: 4af280ccacdfb71cbbb1f512c126ec96614fde37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9d81c0316e853e3424e531dfa1876e2b497c125fe9e9e36c066d5584513f1c77033cfeb40bc37e8d1569287217e5749a90e6ed9030fb88f5f03c9c8391b187c
|
7
|
+
data.tar.gz: fc60962b1c36d8b5ebe09a19b5c052f55bda9d00d094afdb03b5a7ac4cf29166584d28a85bcb54e8d7b7c045f7d06f0750b80d6893e18125236ace99fd22f87e
|
data/lib/djinni.rb
CHANGED
@@ -55,7 +55,7 @@ class Djinni
|
|
55
55
|
name, args = input.split(" ", 2)
|
56
56
|
|
57
57
|
if ((name == "help") || (name == "?"))
|
58
|
-
print_help
|
58
|
+
print_help(args)
|
59
59
|
return ""
|
60
60
|
end
|
61
61
|
|
@@ -159,9 +159,23 @@ class Djinni
|
|
159
159
|
@loaded_from.push(dir)
|
160
160
|
end
|
161
161
|
|
162
|
-
def print_help
|
163
|
-
|
164
|
-
|
162
|
+
def print_help(name = nil)
|
163
|
+
if (name.nil?)
|
164
|
+
@wishes.sort.map do |aliaz, wish|
|
165
|
+
puts "#{aliaz}\t#{wish.description}"
|
166
|
+
end
|
167
|
+
elsif (name.split(" ").length > 1)
|
168
|
+
puts "help [wish]"
|
169
|
+
puts "\tPrint usage for specified wish. If no wish is"
|
170
|
+
puts "\tspecified, print description of all wishes."
|
171
|
+
else
|
172
|
+
@wishes.sort.map do |aliaz, wish|
|
173
|
+
if (aliaz == name)
|
174
|
+
wish.usage
|
175
|
+
return
|
176
|
+
end
|
177
|
+
end
|
178
|
+
puts "Wish #{name} not found!"
|
165
179
|
end
|
166
180
|
end
|
167
181
|
|
data/lib/djinni_wish.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: djinni
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Whittaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|