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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 221d60d0d8636df9ae470ced04021d78d82d1c5f
4
- data.tar.gz: f305cc2c49805b64c2731cc6624ad8993ce54753
3
+ metadata.gz: 9ad016a913b449b627ec537c370a4119adc7e40b
4
+ data.tar.gz: 6df7f349bf5c4327aae837019d1f6de4668460a8
5
5
  SHA512:
6
- metadata.gz: 02b62c07ab9bb50a7534fac2d1264bb486f024d161fddcd39f168ed6049a5e752b32a7c547ecc76ef0b616f68dbab98ab558a7716ef0c112a7261cd064dd46fd
7
- data.tar.gz: a7f3ece87d22c23aef0a2c12e341b9efc1d405517e3c0270d891da18f0b54e154a53279f45f3d9af66cc50d454ff951ff4cf6e22d60a3095f1f0fff266274cc4
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
 
@@ -18,21 +18,25 @@ module Menuboy
18
18
  Termios::tcsetattr($stdin, Termios::TCSANOW, @termios_normal_attributes)
19
19
  end
20
20
 
21
- module UnbufferedKeyboardHandler
22
- def receive_data(k)
23
- puts k
24
- menu = Menuboy.menus.last
25
- if k == "q"
26
- Menuboy.menus.pop
27
- if next_menu = Menuboy.menus.last
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
- menu.handle_input(k)
29
+ exit # no more menus
34
30
  end
35
- Menuboy.menus.last.prompt
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
@@ -1,3 +1,3 @@
1
1
  module Menuboy
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.2
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-12 00:00:00.000000000 Z
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.0.6
120
+ rubygems_version: 2.1.10
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Simple CLI-based menu building DSL