menuboy 0.1.2 → 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/README.md +6 -0
- data/lib/menuboy.rb +20 -13
- data/lib/menuboy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ad016a913b449b627ec537c370a4119adc7e40b
|
4
|
+
data.tar.gz: 6df7f349bf5c4327aae837019d1f6de4668460a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7a2773be1db98805b9739f94619ce33314e03b430132ae618a30d6f5d98e32536cc722d6fda44dcc80fce4d53d9b016f8f7ff6304051d3efceb3b20b9a752b
|
7
|
+
data.tar.gz: a8caa9c504ccf4b01d53907a9bdb75add5036c679a8d363251a077df820587a3317e42ab63e96f8cb613b37c0d729124c8028b249bf0249c079366ab5402aad6
|
data/README.md
CHANGED
@@ -10,6 +10,12 @@ menuboy.
|
|
10
10
|
|
11
11
|
---
|
12
12
|
|
13
|
+
### v0.2.0
|
14
|
+
* Add ability to pass input from the command line.
|
15
|
+
e.g. `test/example.rb 2 q 2 1 1` will enter these inputs immediately
|
16
|
+
as though typed by the user, navigating through the menus and
|
17
|
+
selecting options
|
18
|
+
|
13
19
|
### v0.1.1
|
14
20
|
* Fix bug where STDIN would not return to normal under linux
|
15
21
|
|
data/lib/menuboy.rb
CHANGED
@@ -18,21 +18,25 @@ module Menuboy
|
|
18
18
|
Termios::tcsetattr($stdin, Termios::TCSANOW, @termios_normal_attributes)
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
next_menu.print_help
|
29
|
-
else
|
30
|
-
exit # no more menus
|
31
|
-
end
|
21
|
+
def self.keyboard_input k
|
22
|
+
puts k
|
23
|
+
menu = Menuboy.menus.last
|
24
|
+
if k == "q"
|
25
|
+
Menuboy.menus.pop
|
26
|
+
if next_menu = Menuboy.menus.last
|
27
|
+
next_menu.print_help
|
32
28
|
else
|
33
|
-
|
29
|
+
exit # no more menus
|
34
30
|
end
|
35
|
-
|
31
|
+
else
|
32
|
+
menu.handle_input(k)
|
33
|
+
end
|
34
|
+
Menuboy.menus.last.prompt
|
35
|
+
end
|
36
|
+
|
37
|
+
module UnbufferedKeyboardHandler
|
38
|
+
def receive_data(k)
|
39
|
+
Menuboy.keyboard_input(k)
|
36
40
|
end
|
37
41
|
end
|
38
42
|
|
@@ -86,6 +90,9 @@ module Menuboy
|
|
86
90
|
EM.run do
|
87
91
|
Menuboy.raw_terminal
|
88
92
|
EM.open_keyboard(UnbufferedKeyboardHandler)
|
93
|
+
ARGV.each do |input|
|
94
|
+
Menuboy.keyboard_input(input)
|
95
|
+
end
|
89
96
|
end
|
90
97
|
end
|
91
98
|
end
|
data/lib/menuboy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: menuboy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keyvan Fatehi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-termios
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.1.10
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Simple CLI-based menu building DSL
|