starx 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/starx +27 -27
- 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: 7d4429a9a304a622e0c6eb4877e0093c01e35dcd
|
4
|
+
data.tar.gz: 0759e56a7b4fdb1bab804d03ab054ded72845b12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f64d22914133461d841b136fe78204dcc7efae2cfdd61cc364e5c02852db3aeda9ccc1c5b29d36cfc8b1577badc766996935d06949a7dbbf56460598a607b564
|
7
|
+
data.tar.gz: 8d2476c806be3e80fdc7e36fe61e11b7d520fb21d033506cf934c139c01065dde0923a92108945d6de21b71c2f2539e38f67a6c67bae4515da6f95731f640d35
|
data/bin/starx
CHANGED
@@ -207,34 +207,30 @@ class Starx
|
|
207
207
|
|
208
208
|
def read_char
|
209
209
|
begin
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
c
|
228
|
-
# TODO: Hide non-blocking io
|
229
|
-
end
|
210
|
+
system 'stty raw -echo'
|
211
|
+
if $stdin.ready?
|
212
|
+
c = $stdin.getc.chr
|
213
|
+
if c == "\e"
|
214
|
+
extra_thread = Thread.new do
|
215
|
+
c += $stdin.getc.chr
|
216
|
+
c += $stdin.getc.chr
|
217
|
+
end
|
218
|
+
extra_thread.join 0.00001
|
219
|
+
extra_thread.kill
|
220
|
+
end
|
221
|
+
end
|
222
|
+
ensure
|
223
|
+
system 'stty -raw echo'
|
224
|
+
end
|
225
|
+
c
|
226
|
+
end
|
230
227
|
|
231
228
|
def read_char_menu
|
232
229
|
begin
|
233
|
-
|
234
|
-
|
235
|
-
c = $stdin.getc.chr if $stdin
|
230
|
+
system 'stty raw -echo'
|
231
|
+
c = $stdin.getc.chr
|
236
232
|
ensure
|
237
|
-
system
|
233
|
+
system 'stty -raw echo'
|
238
234
|
end
|
239
235
|
c
|
240
236
|
end
|
@@ -273,18 +269,22 @@ class Starx
|
|
273
269
|
puts ''
|
274
270
|
keys_menu
|
275
271
|
|
276
|
-
# TODO: Add best scores
|
277
272
|
end
|
278
273
|
|
279
274
|
def play
|
280
275
|
loop do
|
276
|
+
begin
|
281
277
|
tick
|
282
278
|
sleep 0.04
|
283
279
|
system 'clear'
|
284
|
-
|
280
|
+
rescue Interrupt
|
281
|
+
system 'tput cnorm'
|
282
|
+
system 'clear'
|
283
|
+
Process.exit! true
|
284
|
+
end
|
285
|
+
end
|
285
286
|
end
|
286
287
|
#
|
287
|
-
# TODO: score count in hidden file and displayed on screen
|
288
288
|
end
|
289
289
|
|
290
290
|
g = Starx.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justyna Rachowicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: justynarachowicz@gmail.com
|