timequiz 1.3 → 1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b091415dfe525da2e52aac9047c44ab09b4d4a3aba68091be2e537a409610d4
4
- data.tar.gz: 10ce3ea7d1e5eb27ac3a25ff51dd787696c826859b12861b4a3caf3c71702e14
3
+ metadata.gz: 5e948f6d1620c67a90d6ab3ababb36b60f3d1f3b72d08143fd0b52151c3c91c6
4
+ data.tar.gz: 1550aaa1b619b8518098f0bf985b859f13a34b1e3edb8ba50d156e6d3de5a0f5
5
5
  SHA512:
6
- metadata.gz: a7779e38b0ddcd686b1c08ccbff7fca8625eb49bccbefb6ee917ff3cce064deed65d5efd1fb12f01a0f38cc953b537e0eeb2a353825b3069d6051fda1cd53855
7
- data.tar.gz: 67fe251eb42dd86133ab690b0512a6cbe77312a919fdf76bfba05257eccebe1fb4c35da661089227feda88c874e8a35f22c35a281d5b7eb9e1087054b08ff5f0
6
+ metadata.gz: 911b0a8d718d210b06c44c7e0e59aea19d0e80d35c98dfcbdb7e75a417e639b2cd12a144b14e6c81a5402253f6fd4637571692015e9a5d14c3fafd5a47bfb26b
7
+ data.tar.gz: 0b53734c06f47146692c1a1bb2f40dc302113993496ace128360b3e722fc149e10618154988a648926b2c49a8b8edb0a7023c8b08cab01ce6bd609196d09e960
data/changes.txt CHANGED
@@ -1,3 +1,10 @@
1
+ V 1.4
2
+ -) Provided, the manpages gem is installed, man timequiz
3
+ will open the man page for timequiz. Initially
4
+ execute
5
+ gem manpages --update-all
6
+ to be sure.
7
+
1
8
  V 1.3
2
9
  -) When the game ends, either after the maximum number
3
10
  of events have been handled or because there are no
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
3
  <head>
4
- <meta name="generator" content="vim - Vi Improved, a programmer's editor; HTML Tidy for Linux version 5.8.0
4
+ <meta name="generator" content="vim - Vi Improved, a programmer's editor; HTML Tidy for Linux version 5.9.20
5
5
  "/>
6
6
  <meta charset="utf-8" />
7
7
  <link rel="preload" as="font" crossorigin="" href=
@@ -22,9 +22,6 @@
22
22
  "width=device-width, initial-scale=1" />
23
23
  <title>Timequiz</title>
24
24
  <link rel="stylesheet" href="timequiz.css" type="text/css" />
25
- <link rel="stylesheet" href="fonts.css" type="text/css" />
26
- <link rel="stylesheet" href="https://www.uplawski.eu/ups.css"
27
- type="text/css" />
28
25
  </head>
29
26
  <body>
30
27
  <main id="timequiz">
@@ -287,11 +284,40 @@
287
284
  "mailto:michael.uplawski@uplawski.eu">michael.uplawski@uplawski.eu</a>&gt;</p>
288
285
  </dd>
289
286
  </dl>
287
+
288
+ <section id="this-document">
289
+ <h3>This document</h3>
290
+
291
+ <blockquote>
292
+ <p>©Michael Uplawski &lt;<a class="reference external"
293
+ href=
294
+ "mailto:michael.uplawski@uplawski.eu">michael.uplawski@uplawski.eu</a>&gt;</p>
295
+
296
+ <p>License: <a class="reference external" href=
297
+ "https://creativecommons.org/licenses/by-nd/4.0/">CC
298
+ BY-ND 4.0</a></p>
299
+
300
+ <p>Date: 2026-09-22</p>
301
+ </blockquote>
302
+
303
+ <p>The man page can be accessed in the ordinary way, by
304
+ executing <em>man</em> timequiz, <strong>if</strong> the
305
+ <a class="reference external" href=
306
+ "https://rubygems.org/gems/manpages">manpages</a> gem is
307
+ installed. Initially, executing <em>gem manpages
308
+ --update-all</em> will ensure that the man pages for all
309
+ packages which provide such documentation are copied to the
310
+ default locations for man pages.</p>
311
+ </section>
290
312
  </section>
291
313
 
292
314
  <section id="section-1">
293
315
  <h2>Ω</h2>
294
316
  </section>
295
317
  </main>
318
+
319
+ <div id='page_dt'>
320
+ 2026-09-22
321
+ </div>
296
322
  </body>
297
323
  </html>
Binary file
data/doc/pdf/timequiz.pdf CHANGED
Binary file
data/doc/rst/timequiz.rst CHANGED
@@ -5,6 +5,11 @@
5
5
  Play a history-quiz game
6
6
  ----------------------------------------
7
7
 
8
+ .. _manpages: https://rubygems.org/gems/manpages
9
+ .. _CC By-ND 4.0: https://creativecommons.org/licenses/by-nd/4.0/
10
+ .. |date| date::
11
+
12
+
8
13
  SYNOPSIS
9
14
  =======================
10
15
  timequiz [options]
@@ -147,5 +152,19 @@ License
147
152
  Author
148
153
  Developed by Michael Uplawski <michael.uplawski@uplawski.eu>
149
154
 
155
+ This document
156
+ -------------
157
+ ©Michael Uplawski <michael.uplawski@uplawski.eu>
158
+
159
+ License: `CC BY-ND 4.0`_
160
+
161
+ Date: |date|
162
+
163
+ The man page can be accessed in the ordinary way, by executing *man*
164
+ timequiz, **if** the `manpages`_ gem is installed. Initially, executing *gem
165
+ manpages --update-all* will ensure that the man pages for all packages which
166
+ provide such documentation are copied to the default locations for man pages.
167
+
168
+
150
169
  Ω
151
170
  ============
data/lib/console.rb CHANGED
@@ -40,7 +40,7 @@ module Console
40
40
  @@fail_sequence = %w":-|\ :-|\ :-[\ :-[\ :-(\ :-(\ 8-(\ 8-(\ 8-(\ 8-(\ 8-(\ 8-(\ 8-(\ 8-(\ .... |... lo.. Los. LOso LOSe LOSE lOSE loSE lose"
41
41
  @@points = 0
42
42
  # start with some arbitrary events
43
- def start_game
43
+ def play_game
44
44
  available = $events
45
45
  clear
46
46
  puts bold("\nPut the following events into the correct chronological order (e.g.: 2 3 1).")
data/lib/events.rb CHANGED
@@ -15,6 +15,8 @@
15
15
  =end
16
16
 
17
17
  # All events known.
18
+ $events << ['Coronation Of Frederick II as Holy Roman Emperor', 1220, 'Five years after having been coronated as German king and only after negociations with two popes, Frederick was crowned as emperor in Rome on 20 November 1220. His court became one of the leading intellectual centers of the 13th century (Wikipedia).']
19
+ $events << ['Construction of Hadrian\'s Wall across the north of England', 122, 'The Wall served as frontier between the Roman territories in Britain and the unconquered Caledonia in the north. In times of unrest and rebellion in numerous Roma provinces, the wall was also a symbol of the Roman emperor\'s determination to keep the empire intact.']
18
20
  $events << ['The Liberation of Dachau Concentration Camp', 1945, 'The 42nd and 45th Infantry Divisions, as well as the 20th Armored Division of the US Army liberate approximately 32,000 prisoners at Dachau on April 29, 1945. Unprepared for the situation, the smell of decaying bodies and human excrement and the sight of naked, emaciated bodies induced vomiting, crying, disbelief, and rage in the advancing troops. Some of the SS-men who were in charge of the camp were killed by US soldiers after having surrendered, which is considered a war crime. But any charges against the men involved in the killings were dismissed by General George S. Patton.']
19
21
  $events << ['The Massacre of Béziers', 1209, 'At the beginning of the Albigensian Crusade against the Cathar movement in the Longuedoc (France), Béziers was the first town that was besieged and conquered by the Crusader army, commanded by the papal legate Arnaud Almaric on 22 July 1209. Almarics own receit of the siege and massacre includes this passage: "Our men spared no one, irrespective of rank, sex or age, and put to the sword almost 20,000 people. After this great slaughter the whole city was despoiled and burnt, as divine vengeance miraculously raged against it."']
20
22
  $events << ['Ibn Battuta visits the sultanate of Mali', 1352, 'Ibn Battuta, the great Morrocan voyager, in his journal described many of the territories under Muslim domination and became, thus, the only eyewitness of West-African societies and their political organization at that time. His writings contrast with that of later authors who – often in a colonial context – deny the existence of developped societies in this part of the world and, thus, imposed that “Africa has had no history”.']
data/lib/timequiz.rb CHANGED
@@ -27,7 +27,7 @@ require_relative 'basic_logging'
27
27
  require 'date'
28
28
 
29
29
  # Main program class. All action is within the initialize() method, or, more
30
- # precisely in the start_game() method which has to be defined by an
30
+ # precisely in the play_game() method which has to be defined by an
31
31
  # interface-module.
32
32
  class Timequiz
33
33
  include BasicLogging
@@ -140,7 +140,7 @@ class Timequiz
140
140
 
141
141
  # start the chosen interface
142
142
  if(game_ok)
143
- start_game
143
+ play_game
144
144
  else
145
145
  error("Cannot play with the events in " << options.file)
146
146
  error("PSE verify that there are at least 3 events defined!")
data/lib/version.rb CHANGED
@@ -16,7 +16,7 @@
16
16
  =end
17
17
 
18
18
  APPNAME = 'Timequiz'
19
- VERSION = '1.3'
19
+ VERSION = '1.4'
20
20
  SUMMARY = 'Play a history game'
21
21
  AUTHOR = 'Michael Uplawski'
22
22
  AUTHOR_MAIL = '<michael.uplawski@uplawski.eu>'
data/man/timequiz.6 ADDED
@@ -0,0 +1,199 @@
1
+ '\" t
2
+ .\" Man page generated from reStructuredText
3
+ .\" by the Docutils 0.23 manpage writer.
4
+ .
5
+ .
6
+ .nr rst2man-indent-level 0
7
+ .
8
+ .de1 rstReportMargin
9
+ \\$1 \\n[an-margin]
10
+ level \\n[rst2man-indent-level]
11
+ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
12
+ -
13
+ \\n[rst2man-indent0]
14
+ \\n[rst2man-indent1]
15
+ \\n[rst2man-indent2]
16
+ ..
17
+ .de1 INDENT
18
+ .\" .rstReportMargin pre:
19
+ . RS \\$1
20
+ . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
21
+ . nr rst2man-indent-level +1
22
+ .\" .rstReportMargin post:
23
+ ..
24
+ .de UNINDENT
25
+ . RE
26
+ .\" indent \\n[an-margin]
27
+ .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
28
+ .nr rst2man-indent-level -1
29
+ .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
30
+ .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
31
+ ..
32
+ .TH timequiz "6" "Tue 22 Sep 2026" "3" "Games Manual"
33
+ .SH Name
34
+ TIMEQUIZ \- Play a history-quiz game
35
+ .SH SYNOPSIS
36
+ .sp
37
+ timequiz [options]
38
+ .sp
39
+ Run timequiz without any options to begin a quiz using the default set of
40
+ historical events—the provided collection is modest in size.
41
+ .SH DESCRIPTION
42
+ .sp
43
+ The game presents a limited number of historical events (currently three) in
44
+ random order. Your task is to correctly arrange them chronologically. In each
45
+ subsequent round, a single new event appears—you must place it in the correct
46
+ position relative to the previously ordered events (either before one of the
47
+ listed events or later).
48
+ .sp
49
+ After every round—including the first—your performance is assessed. You may
50
+ then choose to proceed with another event or review the brief description of
51
+ any event already in the sequence.
52
+ .sp
53
+ The game continues until you press q to quit or until the maximum of 15 events
54
+ have been played.
55
+ .SS YOU DON’T NEED TO KNOW EVERY DATE
56
+ .sp
57
+ Winning often does not require exact historical knowledge. Instead, logical
58
+ reasoning or educated guesses—eliminating events that are clearly too early or
59
+ too late—usually suffices. Reading the event descriptions may also help you
60
+ situate other events in historical context later on.
61
+ .SH OPTIONS (not needed to play)
62
+ .sp
63
+ \fB\-a, \-\-add\fP Add a new event to the game
64
+ .sp
65
+ \fB\-e, \-\-event\fP [EVENT] Provide a name of the new event
66
+ .sp
67
+ \fB\-y, \-\-year\fP [YEAR] Specify the year of the new event
68
+ .sp
69
+ \fB\-b, \-\-background\fP [INFO] Supply background information for the new event
70
+ .sp
71
+ \fB\-f, \-\-file\fP [FILE] Specify the file for reading/writing events
72
+ .sp
73
+ \fB\-d, \-\-debug\fP Enable verbose debug output
74
+ .sp
75
+ \fB\-v, \-\-version\fP Display program version
76
+ .sp
77
+ \fB\-h, \-\-help\fP Show help message
78
+ .SS The Options in detail:
79
+ .INDENT 0.0
80
+ .TP
81
+ .B \-a \-\-add
82
+ Requires \-e, \-y, and \-f. This redundancy may be removed in future versions.
83
+ .TP
84
+ .B \-e \-\-event [EVENT]
85
+ The name of the event to add. Requires \-\-add, \-\-year, and \-\-file. Use quotes
86
+ for multi\-word events, e.g., \-\-event \(dqSome Guy Was Born and Something Broke\(dq.
87
+ .TP
88
+ .B \-y \-\-year [YEAR]
89
+ The year of the event, e.g., \-y 1244.
90
+ .TP
91
+ .B \-b \-\-background [INFO]
92
+ Optional context to help with the quiz—use sparingly. For example: \-b \(dqThe
93
+ phenomenon was of no significance whatsoever\(dq.
94
+ .TP
95
+ .B \-f \-\-file [FILE]
96
+ Path to the events file used for quizzes or for adding new events. If the file
97
+ does not exist, it is created with some sample events. It must be readable for
98
+ quizzes and writable for additions.
99
+ .TP
100
+ .B \-d \-\-debug
101
+ Enables verbose debugging output. Mainly useful for developers.
102
+ .TP
103
+ .B \-v \-\-version
104
+ Display the current version of the program.
105
+ .TP
106
+ .B \-h \-\-help
107
+ Show this list of options and usage instructions.
108
+ .UNINDENT
109
+ .SH GAME EXAMPLE
110
+ .sp
111
+ Launching timequiz with no options displays three random historical events,
112
+ prompting:
113
+ .TS
114
+ box center;
115
+ l.
116
+ T{
117
+ Put the following events into the right chronological order (e.g.: 2 3 1).
118
+ .INDENT 0.0
119
+ .IP 1. 3
120
+ The Roman emperor Diocletian devides the empire in two
121
+ .IP 2. 3
122
+ End of the \(dqWar of the mercenaries\(dq
123
+ .IP 3. 3
124
+ Destruction of Nimrod and Ninive by the Medians and Neo\-Babylonians
125
+ .UNINDENT
126
+ .sp
127
+ Available: 1, 2, 3)
128
+ T}
129
+ .TE
130
+ .sp
131
+ Enter your sequence (e.g., 321) without needing to press Enter after each
132
+ number. The game then shows the correct order with years and evaluates your
133
+ input. You’ll be asked if you wish to continue with a new event or view more
134
+ info on the listed events.
135
+ .TS
136
+ box center;
137
+ l.
138
+ T{
139
+ Enter number for more information about an event, \(aqa\(aq to play with one new, random event, \(aqq\(aq to quit.
140
+ T}
141
+ .TE
142
+ .sp
143
+ To continue:
144
+ .sp
145
+ Press a number to view an event’s details,
146
+ .sp
147
+ \fBa\fP to add a new random event, or
148
+ .sp
149
+ \fBq\fP to quit.
150
+ .sp
151
+ If you choose \fBa\fP, here’s how the next prompt may appear:
152
+ .TS
153
+ box center;
154
+ l.
155
+ T{
156
+ Indicate the event from the previous list, which precedes the following, or \(aq0\(aq (zero) to put it in front:
157
+ .sp
158
+ The Italian painter Lorenzo Lotto dies.
159
+ T}
160
+ .TE
161
+ .sp
162
+ You must then enter the corresponding number or 0 if you believe that the event
163
+ occurred before all listed events (which, in this case, would be historically
164
+ inaccurate). Press Enter to submit your answer.
165
+ .SH ADDITIONAL INFORMATION
166
+ .INDENT 0.0
167
+ .TP
168
+ .B Development & Source Code
169
+ timequiz is written in Ruby. As it\(aqs interpreted, the executable is
170
+ essentially the source code—you can open it in any text editor. If installed
171
+ from a Ruby gem, you can extract it using \fBtar \-x\fP, then \fBtar \-xzf\fP\&.
172
+ .TP
173
+ .B Known Bug
174
+ At times, the list of events may wrap incorrectly in the display.
175
+ .TP
176
+ .B License
177
+ Timequiz is distributed under the WTFPL\-2.0 or later License.
178
+ For more details, visit \%<http://\:www\:.wtfpl\:.net/\:txt/\:copying/>
179
+ .TP
180
+ .B Author
181
+ Developed by Michael Uplawski <\%<michael\:.uplawski@\:uplawski\:.eu>>
182
+ .UNINDENT
183
+ .SS This document
184
+ .INDENT 0.0
185
+ .INDENT 3.5
186
+ ©Michael Uplawski <\%<michael\:.uplawski@\:uplawski\:.eu>>
187
+ .sp
188
+ License: CC BY\-ND 4.0 \%<https://\:creativecommons\:.org/\:licenses/\:by-nd/\:4\:.0/>
189
+ .sp
190
+ Date: 2026\-09\-22
191
+ .UNINDENT
192
+ .UNINDENT
193
+ .sp
194
+ The man page can be accessed in the ordinary way, by executing \fIman\fP
195
+ timequiz, \fBif\fP the manpages \%<https://\:rubygems\:.org/\:gems/\:manpages> gem is installed. Initially, executing \fIgem
196
+ manpages \-\-update\-all\fP will ensure that the man pages for all packages which
197
+ provide such documentation are copied to the default locations for man pages.
198
+ .SH Ω
199
+ .\" End of generated man page.
data/timequiz.gemspec CHANGED
@@ -9,14 +9,15 @@ Gem::Specification.new do |s|
9
9
  s.description = "A game that makes you put historical events in chronological order."
10
10
  s.authors = ["Michael Uplawski"]
11
11
  s.email = 'michael.uplawski@uplawski.eu'
12
- s.files = %w~timequiz~.collect{|f| 'bin/' << f} + %w~basic_logging.rb version.rb adder.rb argparser.rb busy_indicator.rb color_output.rb console.rb constants.rb event.rb events.rb extstring.rb user_input.rb timequiz.rb~.collect{|f| 'lib/' << f} + %w~timequiz.gemspec changes.txt README.md~.collect{|f|f} + %w~man/timequiz.6.gz html/timequiz.html pdf/timequiz.pdf rst/timequiz.rst license.txt~.collect{|f| 'doc/' << f}
12
+ s.homepage = 'https://www.uplawski.eu/software/timequiz/'
13
+ s.files = %w~timequiz~.collect{|f| 'bin/' << f} + %w~basic_logging.rb version.rb adder.rb argparser.rb busy_indicator.rb color_output.rb console.rb constants.rb event.rb events.rb extstring.rb user_input.rb timequiz.rb~.collect{|f| 'lib/' << f} + %w~timequiz.gemspec changes.txt README.md man/timequiz.6~.collect{|f|f} + %w~man/timequiz.6.gz html/timequiz.html pdf/timequiz.pdf rst/timequiz.rst license.txt~.collect{|f| 'doc/' << f}
13
14
  #s.requirements = ''
14
15
  #s.add_runtime_dependency ''
15
16
  s.executables = 'timequiz'
16
17
  s.license = 'WTFPL'
17
18
  s.required_ruby_version = '>= 2.7'
18
19
  s.metadata = {
19
- "homepage_uri" => 'https://www.uplawski.eu/software/timequiz/',
20
+ "homepage_uri" => s.homepage,
20
21
  "documentation_uri" => 'https://www.uplawski.eu/software/timequiz/man_timequiz.html',
21
22
  "changelog_uri" => 'https://www.uplawski.eu/software/timequiz/changes.txt'
22
23
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timequiz
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.3'
4
+ version: '1.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Uplawski
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-09-13 00:00:00.000000000 Z
10
+ date: 2026-09-22 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: A game that makes you put historical events in chronological order.
13
13
  email: michael.uplawski@uplawski.eu
@@ -37,7 +37,9 @@ files:
37
37
  - lib/timequiz.rb
38
38
  - lib/user_input.rb
39
39
  - lib/version.rb
40
+ - man/timequiz.6
40
41
  - timequiz.gemspec
42
+ homepage: https://www.uplawski.eu/software/timequiz/
41
43
  licenses:
42
44
  - WTFPL
43
45
  metadata:
@@ -58,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
60
  - !ruby/object:Gem::Version
59
61
  version: '0'
60
62
  requirements: []
61
- rubygems_version: 4.0.18
63
+ rubygems_version: 4.0.20
62
64
  specification_version: 4
63
65
  summary: Play a history game
64
66
  test_files: []