wpm 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/wpm.rb +7 -7
- data/lib/wpm/quotes.yml +6 -3
- data/lib/wpm/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 158a929f6f3f743e3cc9c9076051602f01c9f21f26d735b211c0f284ab3b73d8
|
4
|
+
data.tar.gz: ead5d4376702e5c97d1a0692aab75e77e1d82937b11998cf0c4e9b457a7a39cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c93099c3bbb63f542d900915ca112942be120f0b354e47d2b5ef9cb5550fee5916abd023e07ed17a9878c2131f6fb40dcebdfdc2a5ed28724242d58c94247a3
|
7
|
+
data.tar.gz: 317d4a8c2296efa8b6056d43231eff1487da0ca0883047cc0ec1c301d0543495c19dbd0f7b38aee3a0f43abc9891b195236ddfcb96567c1e2bdff7d3e42bbb5c
|
data/Gemfile.lock
CHANGED
data/lib/wpm.rb
CHANGED
@@ -52,13 +52,13 @@ module WPM
|
|
52
52
|
|
53
53
|
def help
|
54
54
|
puts <<~eof
|
55
|
-
Usage: wpm
|
55
|
+
Usage: wpm [options]
|
56
56
|
|
57
57
|
Options:
|
58
|
-
-h
|
59
|
-
-s
|
60
|
-
-l
|
61
|
-
-q
|
58
|
+
-h show this message
|
59
|
+
-s print stats
|
60
|
+
-l [length] maximum string length
|
61
|
+
-q print quotes.yml path
|
62
62
|
eof
|
63
63
|
exit
|
64
64
|
end
|
@@ -89,8 +89,8 @@ module WPM
|
|
89
89
|
def stats
|
90
90
|
str=File.open(wpm_file).read
|
91
91
|
scores=str.split(" ").map(&:to_i).select.with_index{|e,i| i.odd?}
|
92
|
-
|
93
|
-
|
92
|
+
printf "%-20s %s", "Number of races:", "#{str.count("\n")}\n"
|
93
|
+
printf "%-20s %s", "Average speed (WPM):", "#{scores.average}\n"
|
94
94
|
end
|
95
95
|
|
96
96
|
def time
|
data/lib/wpm/quotes.yml
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
-
- "Do nothing out of selfish ambition or vain conceit, but in humility consider others better than yourselves
|
2
|
-
- "It's a funny thing, but people mostly have it backward. They think they live by what they want. But really, what guides them is what they're afraid of. What they don't want
|
3
|
-
- "
|
1
|
+
- "Do nothing out of selfish ambition or vain conceit, but in humility consider others better than yourselves"
|
2
|
+
- "It's a funny thing, but people mostly have it backward. They think they live by what they want. But really, what guides them is what they're afraid of. What they don't want"
|
3
|
+
- "Roses are red, violets are blue"
|
4
|
+
- "The best way to learn programming is by reading open source code"
|
5
|
+
- "Emacs is a nice operating system, but I prefer UNIX"
|
6
|
+
- "Real programmers can write assembly code in any language"
|
data/lib/wpm/version.rb
CHANGED