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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d3296c4a873190f0059f2603ddce098130fa4ac3
4
- data.tar.gz: 00cdbf96d644568b7eb6d4cd783b82ab315289d3
3
+ metadata.gz: f0621e21742d8ad220683b0170dde12c52244fe6
4
+ data.tar.gz: f66881ddd805fd68c13877553422736c74ac482c
5
5
  SHA512:
6
- metadata.gz: 9aed24c7e9953e07e443f4183302086010241f6c626934ecd178b8e0416ce82c2ace9c645eb2a670d66051104f3e7af6418ca37d072deac44c6f15540ec6392b
7
- data.tar.gz: bc86d7cfad0485d4912fb7a4d04c9e485c34f44e064013a5976b32d6352fa8c751d007030776494e6668eb8e4bbe49f2779c05ac37fcd4876baf13bdd19fd44c
6
+ metadata.gz: 2414b55833736a3e19e7f779bbe833721666bce2888d4280d9ef2c4a6161214dfae722525186e59ac0e0e0022907893b7014fc1945cc3819906323102e594a26
7
+ data.tar.gz: 174b57ce52b732d279e9c5f9fdbf20a031c2574b2ea01f5a9852e5cc9f872c9a829f9b4b0cb6f06ec8f97e0f5618c8714dac868f3eeee23ccb473bbf065c1b3e
@@ -35,9 +35,12 @@ module Vedeu
35
35
  if cooked?
36
36
  Vedeu.trigger(:_command_, input)
37
37
 
38
- else
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
- else
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 option must be `:raw` or `:cooked`.' unless valid_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
@@ -1,6 +1,6 @@
1
1
  module Vedeu
2
2
 
3
3
  # The current version of Vedeu.
4
- VERSION = '0.6.66'.freeze
4
+ VERSION = '0.6.67'.freeze
5
5
 
6
6
  end
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.66
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-23 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard