cw 0.2.2 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/daily.rb DELETED
@@ -1,182 +0,0 @@
1
- # encoding: utf-8
2
-
3
- now = Time.now
4
-
5
- require_relative 'lib/cw'
6
-
7
- speed = 15
8
-
9
- CW.new do
10
- shuffle
11
- wpm speed
12
- ewpm speed - 2
13
- word_count 5
14
- test_letters
15
- end
16
-
17
- CW.new do
18
- shuffle
19
- wpm speed
20
- word_count 15
21
- test_letters
22
- end
23
-
24
- speed += 5
25
-
26
- CW.new do
27
- wpm speed
28
- load_abbreviations
29
- shuffle
30
- repeat_word
31
- end
32
-
33
- CW.new do
34
- wpm speed
35
- load_abbreviations
36
- shuffle
37
- repeat_word
38
- end
39
-
40
- CW.new do
41
- wpm speed
42
- load_most_common_words
43
- word_count 40
44
- shuffle
45
- repeat_word
46
- end
47
-
48
-
49
- CW.new do
50
- wpm speed
51
- load_most_common_words
52
- word_count 40
53
- shuffle
54
- double_words
55
- test_letters
56
- end
57
-
58
-
59
- speed -= 5
60
-
61
- CW.new do
62
- wpm speed
63
- play_book output: :letter, duration: 2
64
- end
65
-
66
- CW.new do
67
- wpm speed
68
- read_rss(:reuters, 2)
69
- end
70
-
71
- speed += 15
72
-
73
- CW.new do
74
- wpm speed
75
- load_alphabet
76
- shuffle
77
- repeat_word
78
- end
79
-
80
- CW.new do
81
- 2.times do
82
- wpm speed
83
- load_numbers
84
- shuffle
85
- repeat_word
86
- end
87
- end
88
-
89
- speed -= 10
90
-
91
- CW.new do
92
- load_words 'data/text/cw_conversation.txt'
93
- wpm speed
94
- print_letters
95
- end
96
-
97
- seconds = (Time.now - now).to_i
98
-
99
- if seconds == 0
100
- puts 'No tests run!'
101
- else
102
- minutes = 0
103
- if seconds >= 60
104
- minutes = (seconds / 60).to_i
105
- seconds = seconds % 60
106
- end
107
- print "Daily run completed in "
108
- print "#{minutes} minute" if minutes > 0
109
- print 's' if minutes > 1
110
- print ', ' if((seconds > 0) && (minutes > 0))
111
- print "#{seconds} second" if seconds > 0
112
- print 's' if seconds > 1
113
- puts '.'
114
- end
115
-
116
- #if seconds >
117
- #puts "Daily run completed in #{().to_i} seconds"
118
- #
119
- #CW.new do
120
- # shuffle
121
- # use_ebook2cw
122
- ## ewpm 18
123
- # wpm 30
124
- # words_no_longer_than 3
125
- # word_count 25
126
- ## words = "ABC"
127
- ## test_words
128
- ## test_letters
129
- ## play_book
130
- # repeat_word
131
- # #print_letters
132
- #end
133
-
134
- #CW.new do
135
- ## shuffle
136
- # wpm 15
137
- # word_count 5
138
- ## test_letters
139
- # #print_letters
140
- #end
141
-
142
- # CW.new do
143
- # shuffle
144
- # wpm 18
145
- # ewpm 15
146
- # word_count 15
147
- # #print_letters
148
- # end
149
- #
150
- # CW.new do
151
- # shuffle
152
- # wpm 18
153
- # ewpm 15
154
- # word_count 15
155
- # #print_letters
156
- # end
157
- #
158
- # CW.new do
159
- # shuffle
160
- # wpm 18
161
- # ewpm 15
162
- # word_count 15
163
- # #print_letters
164
- # end
165
- #
166
- # CW.new do
167
- # shuffle
168
- # wpm 18
169
- # ewpm 15
170
- # word_count 15
171
- # #print_letters
172
- # end
173
- #
174
- # CW.new do
175
- # shuffle
176
- # wpm 18
177
- # ewpm 15
178
- # word_count 15
179
- # #print_letters
180
- # end
181
- #
182
- #
@@ -1 +0,0 @@
1
- 0
@@ -1,50 +0,0 @@
1
- # encoding: utf-8
2
-
3
- module Params
4
-
5
- extend self
6
-
7
- def param_method values, name
8
- value = values.first
9
- value ? self.send("#{name}=", value) : instance_variable_get("@#{name}")
10
- end
11
-
12
- def param_internal name
13
- attr_accessor name
14
- instance_variable_set("@#{name}", nil)
15
- define_method name do | * values|
16
- param_method values, name
17
- end
18
- end
19
-
20
- def param( * names)
21
- names.each do |name|
22
- param_internal name
23
- end
24
- end
25
-
26
- def config( & block)
27
- instance_eval( & block)
28
- end
29
-
30
- def shuffle_str
31
- shuffle ? "Shuffle: #{shuffle ? 'yes' : 'no'}\n" : nil
32
- end
33
-
34
- def word_count_str
35
- word_count ? "Word count: #{word_count}\n" : nil
36
- end
37
-
38
- def wpm_str
39
- "WPM: #{wpm}\n"
40
- end
41
-
42
- def word_size_str
43
- size ? "Word size: #{size}\n" : nil
44
- end
45
-
46
- def delim_str
47
- "#{'=' * Params.name.size}\n"
48
- end
49
-
50
- end