rwpm 1.0.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 +7 -0
- data/bin/rwpm +31 -0
- data/bin/rwpmt +39 -0
- data/lib/rwpm.rb +30 -0
- data/lib/rwpmt.rb +38 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9563e60f0d6a9fa6980316fe4bff85cc2b49b5ed308598b15a5ee17c048edb56
|
4
|
+
data.tar.gz: 704fa61a91ff3afb265adf1cc38091c841f280f460472b662bd2baac02e70148
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4028a82387e1dedec306c27e6adbdcbcb855f45b1f7bb056e903b1f85d7f12eee6cbd08c89e84dfbeb7fa9f323d00d96bad4f46517bcb0651e3244500ab4b601
|
7
|
+
data.tar.gz: c8aea306115ff0b1eb53512b2656af73b4dc3538936d0b2fd69108493828939cbc2ef31d4a4de1364e466cd90134bada8c75902247a80db5de696adc82356b6a
|
data/bin/rwpm
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "colorize"
|
3
|
+
|
4
|
+
|
5
|
+
class App
|
6
|
+
def self.init
|
7
|
+
list = ["abandon","ability", "accompany", "accomplish", "account", "authority", "available", "atmosphere", "awareness", "background", "battery", "beginning"]
|
8
|
+
correct = 0
|
9
|
+
|
10
|
+
loop do
|
11
|
+
word = list[rand(12)]
|
12
|
+
puts "Type the word: #{word}".colorize(:green)
|
13
|
+
answer = gets.chomp
|
14
|
+
if answer == word
|
15
|
+
correct = correct + 1
|
16
|
+
end
|
17
|
+
if answer != word
|
18
|
+
puts "Fail!".colorize(:red)
|
19
|
+
end
|
20
|
+
puts "#{correct} Words Right".colorize(:blue)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
def self.start
|
24
|
+
|
25
|
+
puts "Welcome to Ruby Word Per Minute! type anything to start! (if you wanna use a timer please run rwpmt in another terminal)".colorize(:green)
|
26
|
+
placeholder = gets.chomp
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
App.start
|
31
|
+
App.init
|
data/bin/rwpmt
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "colorize"
|
3
|
+
|
4
|
+
class Timer
|
5
|
+
def self.start
|
6
|
+
time = 60
|
7
|
+
puts "60s, 120s, 180s, 360s, 420s, 500s".colorize(:green)
|
8
|
+
res = gets.chomp
|
9
|
+
if res == "60s"
|
10
|
+
time = 60
|
11
|
+
end
|
12
|
+
if res == "120s"
|
13
|
+
time = 60
|
14
|
+
end
|
15
|
+
if res == "180s"
|
16
|
+
time = 60
|
17
|
+
end
|
18
|
+
if res == "360s"
|
19
|
+
time = 60
|
20
|
+
end
|
21
|
+
if res == "420s"
|
22
|
+
time = 60
|
23
|
+
end
|
24
|
+
if res == "500s"
|
25
|
+
time = 60
|
26
|
+
end
|
27
|
+
loop do
|
28
|
+
if time == 0
|
29
|
+
puts "The timer is over!".colorize(:red)
|
30
|
+
exit
|
31
|
+
end
|
32
|
+
time = time - 1
|
33
|
+
puts "#{time}".colorize(:green)
|
34
|
+
sleep(1)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
Timer.start
|
data/lib/rwpm.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require "colorize"
|
2
|
+
|
3
|
+
|
4
|
+
class App
|
5
|
+
def self.init
|
6
|
+
list = ["abandon","ability", "accompany", "accomplish", "account", "authority", "available", "atmosphere", "awareness", "background", "battery", "beginning"]
|
7
|
+
correct = 0
|
8
|
+
|
9
|
+
loop do
|
10
|
+
word = list[rand(12)]
|
11
|
+
puts "Type the word: #{word}".colorize(:green)
|
12
|
+
answer = gets.chomp
|
13
|
+
if answer == word
|
14
|
+
correct = correct + 1
|
15
|
+
end
|
16
|
+
if answer != word
|
17
|
+
puts "Fail!".colorize(:red)
|
18
|
+
end
|
19
|
+
puts "#{correct} Words Right".colorize(:blue)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
def self.start
|
23
|
+
|
24
|
+
puts "Welcome to Ruby Word Per Minute! type anything to start! (if you wanna use a timer please run rwpmt in another terminal)".colorize(:green)
|
25
|
+
placeholder = gets.chomp
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
App.start
|
30
|
+
App.init
|
data/lib/rwpmt.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "colorize"
|
2
|
+
|
3
|
+
class Timer
|
4
|
+
def self.start
|
5
|
+
time = 60
|
6
|
+
puts "60s, 120s, 180s, 360s, 420s, 500s".colorize(:green)
|
7
|
+
res = gets.chomp
|
8
|
+
if res == "60s"
|
9
|
+
time = 60
|
10
|
+
end
|
11
|
+
if res == "120s"
|
12
|
+
time = 60
|
13
|
+
end
|
14
|
+
if res == "180s"
|
15
|
+
time = 60
|
16
|
+
end
|
17
|
+
if res == "360s"
|
18
|
+
time = 60
|
19
|
+
end
|
20
|
+
if res == "420s"
|
21
|
+
time = 60
|
22
|
+
end
|
23
|
+
if res == "500s"
|
24
|
+
time = 60
|
25
|
+
end
|
26
|
+
loop do
|
27
|
+
if time == 0
|
28
|
+
puts "The timer is over!".colorize(:red)
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
time = time - 1
|
32
|
+
puts "#{time}".colorize(:green)
|
33
|
+
sleep(1)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
Timer.start
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rwpm
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Iago Dórea
|
8
|
+
autorequire:
|
9
|
+
bindir: bin/
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-03-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: colorize
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Ruby Word Per Minute is a game/tool that show your WPM rate!.
|
28
|
+
email: iagodorea@proton.me
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files: []
|
32
|
+
files:
|
33
|
+
- bin/rwpm
|
34
|
+
- bin/rwpmt
|
35
|
+
- lib/rwpm.rb
|
36
|
+
- lib/rwpmt.rb
|
37
|
+
homepage: https://github.com/southernclaim/rwpm
|
38
|
+
licenses:
|
39
|
+
- MIT
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubygems_version: 3.4.20
|
57
|
+
signing_key:
|
58
|
+
specification_version: 4
|
59
|
+
summary: Test your Words Per Minute skill!.
|
60
|
+
test_files: []
|