vedeu 0.6.66 → 0.6.67
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/input/read.rb +34 -3
- data/lib/vedeu/version.rb +1 -1
- 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: f0621e21742d8ad220683b0170dde12c52244fe6
|
4
|
+
data.tar.gz: f66881ddd805fd68c13877553422736c74ac482c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2414b55833736a3e19e7f779bbe833721666bce2888d4280d9ef2c4a6161214dfae722525186e59ac0e0e0022907893b7014fc1945cc3819906323102e594a26
|
7
|
+
data.tar.gz: 174b57ce52b732d279e9c5f9fdbf20a031c2574b2ea01f5a9852e5cc9f872c9a829f9b4b0cb6f06ec8f97e0f5618c8714dac868f3eeee23ccb473bbf065c1b3e
|
data/lib/vedeu/input/read.rb
CHANGED
@@ -35,9 +35,12 @@ module Vedeu
|
|
35
35
|
if cooked?
|
36
36
|
Vedeu.trigger(:_command_, input)
|
37
37
|
|
38
|
-
|
38
|
+
elsif raw?
|
39
39
|
Vedeu.trigger(:_keypress_, input)
|
40
40
|
|
41
|
+
elsif fake?
|
42
|
+
input
|
43
|
+
|
41
44
|
end
|
42
45
|
|
43
46
|
input
|
@@ -68,6 +71,21 @@ module Vedeu
|
|
68
71
|
}
|
69
72
|
end
|
70
73
|
|
74
|
+
# @return [Boolean]
|
75
|
+
def fake?
|
76
|
+
mode == :fake
|
77
|
+
end
|
78
|
+
|
79
|
+
# @return [String]
|
80
|
+
def mouse_off
|
81
|
+
Vedeu::EscapeSequences::Esc.string('mouse_x10_off')
|
82
|
+
end
|
83
|
+
|
84
|
+
# @return [String]
|
85
|
+
def show_cursor
|
86
|
+
Vedeu::EscapeSequences::Esc.string('show_cursor')
|
87
|
+
end
|
88
|
+
|
71
89
|
# @return [String]
|
72
90
|
def input
|
73
91
|
@_input ||= if input?
|
@@ -76,11 +94,18 @@ module Vedeu
|
|
76
94
|
elsif cooked?
|
77
95
|
console.gets.chomp
|
78
96
|
|
79
|
-
|
97
|
+
elsif raw?
|
80
98
|
keys = Vedeu::Input::Raw.read
|
81
99
|
|
82
100
|
Vedeu::Input::Translator.translate(keys)
|
83
101
|
|
102
|
+
elsif fake?
|
103
|
+
console.cooked do
|
104
|
+
Vedeu::Terminal.output(mouse_off + show_cursor)
|
105
|
+
|
106
|
+
console.gets.chomp
|
107
|
+
end
|
108
|
+
|
84
109
|
end
|
85
110
|
end
|
86
111
|
|
@@ -92,7 +117,7 @@ module Vedeu
|
|
92
117
|
# @return [Symbol]
|
93
118
|
def mode
|
94
119
|
fail Vedeu::Error::InvalidSyntax,
|
95
|
-
'mode
|
120
|
+
':mode must be `:raw`, `:fake` or `:cooked`.' unless valid_mode?
|
96
121
|
|
97
122
|
options[:mode]
|
98
123
|
end
|
@@ -101,6 +126,7 @@ module Vedeu
|
|
101
126
|
def modes
|
102
127
|
[
|
103
128
|
:cooked,
|
129
|
+
:fake,
|
104
130
|
:raw,
|
105
131
|
]
|
106
132
|
end
|
@@ -110,6 +136,11 @@ module Vedeu
|
|
110
136
|
defaults.merge!(@options)
|
111
137
|
end
|
112
138
|
|
139
|
+
# @return [Boolean]
|
140
|
+
def raw?
|
141
|
+
mode == :raw
|
142
|
+
end
|
143
|
+
|
113
144
|
# @return [Boolean]
|
114
145
|
def valid_mode?
|
115
146
|
modes.include?(options[:mode])
|
data/lib/vedeu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vedeu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Laking
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|