djinni 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/djinni.rb +18 -4
  3. data/lib/djinni_wish.rb +6 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e031e4ee7414e42f25a08f0077fcc6e960a537be
4
- data.tar.gz: db51f895b4a3cef184852c8ec8519d36d324133c
3
+ metadata.gz: 6b1341fff2b9dd3479fb8b3afadad006838a1015
4
+ data.tar.gz: 4af280ccacdfb71cbbb1f512c126ec96614fde37
5
5
  SHA512:
6
- metadata.gz: 67fb4c595e7aa24c76a83fa001683a062ad66219f0e747596cbd1b871e4967645ebd7e229c066e34d1ad2dbdb341594f60b4edc8370218eb9b9c6b956d81bc26
7
- data.tar.gz: 9a1a9e4aaba67567e5e70ad0e90c2771e8175c14963ac30fcfa0f59628de9af88f343154b6ee0f640a4167aaf49c93129fe9ccbb7537f5ba722b86af6e4d6536
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
- @wishes.sort.map do |aliaz, wish|
164
- puts "#{aliaz}\t#{wish.description}"
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
@@ -25,4 +25,10 @@ class DjinniWish
25
25
  "tab_complete() not implemented!"
26
26
  )
27
27
  end
28
+
29
+ def usage
30
+ raise InterfaceNotImplementedError.new(
31
+ "usage() not implemented!"
32
+ )
33
+ end
28
34
  end
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
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-05 00:00:00.000000000 Z
11
+ date: 2015-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest