m0rse_c0de 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/m0rse.rb +21 -1
- data/lib/teacher/teacher.rb +2 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c544a57b39e4cbef1a032989e4845aa581c9df3954f3c5d932460e5fdf43e11c
|
4
|
+
data.tar.gz: 4b1ef0d6bef8d9a6408829932ee9e2f4e59e0ceeff0f7a3c549df7e369fab4ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70a8de27362bf28cfa87d2f7b022668b7db881a7faa8e4a665c1b259da1fd7bab2ebc7abbdb3473e4fc45e3a5eafc54c0927b81670be951aead92dc8a3aa785f
|
7
|
+
data.tar.gz: a0a02825019879266e591a03349d8d84c10a57e8c0dd8b532bda3014492515d06bd02a9afdefc181bbe284313bd7858a74e6740ff6f3c44fe5f5001687399a69
|
data/lib/m0rse.rb
CHANGED
@@ -2,7 +2,7 @@ require_relative './hashes/hashes.rb'
|
|
2
2
|
begin
|
3
3
|
require_relative './sound/sound.rb'
|
4
4
|
rescue
|
5
|
-
puts "Morse.play
|
5
|
+
puts "Morse.play and Morse.blink methods won't work for #{RUBY_PLATFORM}"
|
6
6
|
end
|
7
7
|
require_relative './teacher/teacher.rb'
|
8
8
|
|
@@ -69,6 +69,26 @@ module M0rse
|
|
69
69
|
file_.close()
|
70
70
|
File.open("#{filename_}-Morsed", "w").write(result_)
|
71
71
|
end
|
72
|
+
|
73
|
+
def self.blink(text_)
|
74
|
+
morse_ = self.text_to_morse(text_)
|
75
|
+
for sign in morse_.split(//)
|
76
|
+
if sign == '.'
|
77
|
+
system('color 70')
|
78
|
+
sleep(0.01)
|
79
|
+
system('color 07')
|
80
|
+
elsif sign == '-'
|
81
|
+
system('color 70')
|
82
|
+
sleep(0.2)
|
83
|
+
system('color 07')
|
84
|
+
elsif sign == ' '
|
85
|
+
sleep(0.3)
|
86
|
+
elsif sign == '\\'
|
87
|
+
sleep(0.7)
|
88
|
+
end
|
89
|
+
end; "completed"
|
90
|
+
end
|
91
|
+
|
72
92
|
begin
|
73
93
|
def self.play(text_)
|
74
94
|
morse_ = self.text_to_morse(text_)
|
data/lib/teacher/teacher.rb
CHANGED
@@ -18,6 +18,7 @@ module Te4cher
|
|
18
18
|
sleep(2)
|
19
19
|
else
|
20
20
|
puts "Wrong! The correct answer was: #{correct_answer}, moving to the next word..."
|
21
|
+
sleep(2)
|
21
22
|
end
|
22
23
|
end
|
23
24
|
end
|
@@ -32,7 +33,7 @@ module Te4cher
|
|
32
33
|
def self.main
|
33
34
|
greeting = '''
|
34
35
|
|
35
|
-
Welcome to teaching mode! If you want to practice:
|
36
|
+
Welcome to teaching mode! If you want to practice: input PRACTICE,
|
36
37
|
if you want to view the Morse alphabet input ALPHABET.
|
37
38
|
|
38
39
|
'''
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m0rse_c0de
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burzum
|
@@ -58,6 +58,7 @@ rubygems_version: 3.0.3
|
|
58
58
|
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: A gem for translation from hex, binary, text to morse and vice versa; it
|
61
|
-
additionally can teach you Morse, play a text to Morse code
|
62
|
-
|
61
|
+
additionally can teach you Morse, play a text to Morse code, translate a file to
|
62
|
+
Morse and now it can blink in Morse. (playing, blinking morse code is for windows
|
63
|
+
only :( )
|
63
64
|
test_files: []
|