cmdr 0.4.1 → 0.4.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/cmdr.rb +11 -5
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91aeb5ecb528814ed1c1f8b154d41fd1d4387191
|
4
|
+
data.tar.gz: 9f469020f47db5ba33253627d7881f4fbe9ed1ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '095fef013837823dc91e1f556832bdb74eb5eb1b7a3ccd9d9dbd1fe89b2e1f5a005cddc4c715bd67564c0c9c8fb2aaf96546a802a73d5e3a856653e9131828d9'
|
7
|
+
data.tar.gz: 7baa77e22f677e417eaf7ecdf9fa16973260d522850a0a0fd4ec4ef078f5ce69ff299350ee177b025e01b8337c03e091e17ba366d5ec272e7f0d47c79a63ab53
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/cmdr.rb
CHANGED
@@ -9,17 +9,16 @@ class Cmdr
|
|
9
9
|
|
10
10
|
@linebuffer = ''
|
11
11
|
@history = []
|
12
|
-
@out = []
|
13
12
|
|
14
13
|
end
|
15
14
|
|
16
|
-
def input(c, enter: "\r", backspace: "\u007F", arrowup: :arrow_up)
|
15
|
+
def input(c, enter: "\r", backspace: "\u007F", arrowup: :arrow_up, arrowdown: :arrow_down)
|
17
16
|
|
18
17
|
key = c
|
19
|
-
|
18
|
+
#return 'var r="e";'
|
20
19
|
reveal(c)
|
21
20
|
|
22
|
-
|
21
|
+
case key
|
23
22
|
when enter
|
24
23
|
|
25
24
|
command = @linebuffer
|
@@ -30,13 +29,16 @@ class Cmdr
|
|
30
29
|
return clear_cli()
|
31
30
|
end
|
32
31
|
|
33
|
-
result = yield(@linebuffer)
|
34
32
|
|
33
|
+
result = yield(@linebuffer.sub(/^\:/,''))
|
34
|
+
|
35
35
|
if result then
|
36
36
|
display_output("\n" + result)
|
37
37
|
else
|
38
38
|
display_output "\n" + 'command not found >> ' + @linebuffer.inspect
|
39
39
|
end
|
40
|
+
|
41
|
+
result = false
|
40
42
|
|
41
43
|
@linebuffer = ''
|
42
44
|
clear_cli()
|
@@ -48,6 +50,8 @@ class Cmdr
|
|
48
50
|
old_command = @history.last
|
49
51
|
@linebuffer = old_command
|
50
52
|
cli_update old_command
|
53
|
+
when arrowdown
|
54
|
+
#puts 'arrowdown'
|
51
55
|
else
|
52
56
|
|
53
57
|
if key.length < 2 then
|
@@ -59,6 +63,8 @@ class Cmdr
|
|
59
63
|
end
|
60
64
|
|
61
65
|
end
|
66
|
+
|
67
|
+
|
62
68
|
|
63
69
|
# display the cli banner upon initialisation
|
64
70
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmdr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
aQuuxN6Drf3pdfalETmFyPgJ7gU+AcENcNa4wGuZKF786/ki4mt++AhKIiQI+Tbn
|
32
32
|
fduXC3tBaNX+gQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-
|
34
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
metadata.gz.sig
CHANGED
Binary file
|