ruco 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/ruco +0 -1
- data/lib/ruco/keyboard.rb +6 -2
- data/ruco.gemspec +2 -2
- data/spec/ruco/keyboard_spec.rb +7 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/bin/ruco
CHANGED
data/lib/ruco/keyboard.rb
CHANGED
@@ -5,7 +5,7 @@ class Keyboard
|
|
5
5
|
ENTER = 13
|
6
6
|
ESCAPE = 27
|
7
7
|
IS_18 = RUBY_VERSION =~ /^1\.8/
|
8
|
-
SEQUENCE_TIMEOUT = 0.
|
8
|
+
SEQUENCE_TIMEOUT = 0.005
|
9
9
|
NOTHING = (2**32 - 1) # getch returns this as 'nothing' on 1.8 but nil on 1.9.2
|
10
10
|
A_TO_Z = ('a'..'z').to_a
|
11
11
|
|
@@ -102,7 +102,11 @@ class Keyboard
|
|
102
102
|
def self.fetch_user_input
|
103
103
|
key = @input.call or return
|
104
104
|
key = key.ord if key.is_a?(String) # ruby 1.9 fix
|
105
|
-
|
105
|
+
if key >= NOTHING
|
106
|
+
# nothing happening -> sleep a bit to save cpu
|
107
|
+
sleep SEQUENCE_TIMEOUT
|
108
|
+
return
|
109
|
+
end
|
106
110
|
key
|
107
111
|
end
|
108
112
|
|
data/ruco.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{ruco}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2011-08-
|
12
|
+
s.date = %q{2011-08-05}
|
13
13
|
s.default_executable = %q{ruco}
|
14
14
|
s.email = %q{michael@grosser.it}
|
15
15
|
s.executables = ["ruco"]
|
data/spec/ruco/keyboard_spec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-05 00:00:00 +02:00
|
19
19
|
default_executable: ruco
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|