timequiz 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/console.rb +1 -1
- data/lib/events.rb +1 -0
- data/lib/extstring.rb +1 -1
- data/lib/log.conf +55 -0
- data/lib/timequiz.rb +5 -3
- data/lib/version.rb +27 -0
- data/timequiz.gemspec +19 -0
- metadata +11 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 852dd48cabb9b9869b7aaeddb6bd347d1651b8184ed6014ca588d9990d8b13d4
|
4
|
+
data.tar.gz: 1e20eb7dd0d1f53e604a61e40859cc82d9fde18c53416939ec5efee8f5d0da49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 543e96757c7b6a5cc8a67fd8e27630e099c8fb6ce222a5b3e77027887adba5d0d634a8338cebf0af50d9b3e4d588d6a97c7c14f0d087cf829478c2654f35af2a
|
7
|
+
data.tar.gz: 317c62acacd7f5c404b9727e04a79e49e423c7a3ad30f61108f8439808506083614c9196e97279773c9fadeacfa2e6e51c64e677ad9287434ae1dd7e2aff2aa6
|
data/lib/console.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
=begin
|
4
4
|
/***************************************************************************
|
5
|
-
* Copyright © 2017-
|
5
|
+
* Copyright © 2017-2021, Michael Uplawski <michael.uplawski@uplawski.eu>*
|
6
6
|
* *
|
7
7
|
* This program is free software; you can redistribute it and/or modify *
|
8
8
|
* it under the terms of the GNU General Public License as published by *
|
data/lib/events.rb
CHANGED
@@ -43,3 +43,4 @@ $events << ['Independence of the Republic of Nicaragua', 1821, 'Discovered by Ch
|
|
43
43
|
$events << ['First siege of Vienna (Austria) by Süleyman the Magnificent', 1529, 'Under sultan Süleyman, the Ottoman empire won much territory and prospered in all respects. In October 1529, the Turkish army of 120000 men could though not break the resistance of the citizens of Vienna and finally had to retreat.']
|
44
44
|
$events << ['The Roman empress Galla Placidia dies', 450, 'Born around the year 390 as the daughter of Theodosius I, she was first married to Alaric\'s brother in law, Athaulf, king of the Visigoths, then to the future Constantius III, a general of her brother Honorius who inherited from her the title of "Augustus". After Honorius\' death and at the decision of Theodosius II, grandson of Theodosius I and emperor of the orient, Galla Placida governed the western empire for her six year old son Valentinian (the future Valentinian III).']
|
45
45
|
$events << ['Birth of Kathleen Mansfield', 1888, '(1888 Wellington, New-Zealand). Of vivid sensibility, Katherine Mansfield is the most representative novelist and poet of the era after World War I. Her novels had the biggest success in France. She died in 1923 on tuberculosis.']
|
46
|
+
$events << ['Spanish victory over the last Maya kingdom', 1697, 'The Itza kingdom submitted to Spanish rule, after a force led by Martín de Ursua, governor of Yucatán, had conquered the Itza capital Nojpetén on 13 March 1697' ]
|
data/lib/extstring.rb
CHANGED
@@ -79,7 +79,7 @@ class String
|
|
79
79
|
gsub!("\t", ' ')
|
80
80
|
width = max_width
|
81
81
|
# wrap lines, maybe
|
82
|
-
wrap(width , /^\d
|
82
|
+
wrap(width , /^\d+\)/)
|
83
83
|
# determine the width of the box
|
84
84
|
width = self.split("\n").max {|l1, l2| l1.chomp.length <=> l2.chomp.length}.length
|
85
85
|
width = [width, min_width].max
|
data/lib/log.conf
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#encoding: UTF-8
|
2
|
+
=begin
|
3
|
+
/***************************************************************************
|
4
|
+
* ©2013 - 2021 Michael Uplawski <michael.uplawski@uplawski.eu> *
|
5
|
+
* *
|
6
|
+
* This program is free software; you can redistribute it and/or modify *
|
7
|
+
* it under the terms of the GNU General Public License as published by *
|
8
|
+
* the Free Software Foundation; either version 3 of the License, or *
|
9
|
+
* (at your option) any later version. *
|
10
|
+
* *
|
11
|
+
* This program is distributed in the hope that it will be useful, *
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
14
|
+
* GNU General Public License for more details. *
|
15
|
+
* *
|
16
|
+
* You should have received a copy of the GNU General Public License *
|
17
|
+
* along with this program; if not, write to the *
|
18
|
+
* Free Software Foundation, Inc., *
|
19
|
+
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
20
|
+
***************************************************************************/
|
21
|
+
|
22
|
+
A simplified logger configuration. Set the level for each individual logger
|
23
|
+
below. Choose a different log-device or log-file if you like. Keep the
|
24
|
+
formatting intact. Do not change other sections of this file.
|
25
|
+
=end
|
26
|
+
|
27
|
+
# Do not touch from here ----->
|
28
|
+
require 'logger'
|
29
|
+
|
30
|
+
debug = Logger::DEBUG
|
31
|
+
info = Logger::INFO
|
32
|
+
error = Logger::ERROR
|
33
|
+
fatal = Logger::FATAL
|
34
|
+
warn = Logger::WARN
|
35
|
+
unknown = Logger::UNKNOWN
|
36
|
+
{
|
37
|
+
# <---------------- to here !
|
38
|
+
|
39
|
+
# Enter your settings here, but take into consideration that not all
|
40
|
+
# the named classes will really produce readable output. Well, you can
|
41
|
+
# always try... Either name just the log-level or make the log-level
|
42
|
+
# precede the output-device or output-file like in the examples.
|
43
|
+
|
44
|
+
# Example: naming a log-file
|
45
|
+
#
|
46
|
+
# :HtmlBuilder => [info, 'C:\temp\htmlbuilder.log'],
|
47
|
+
#
|
48
|
+
# :HtmlBuilder => [debug, '/tmp/htmlbuilder.log'],
|
49
|
+
|
50
|
+
:Timequiz => [debug, '/tmp/timequiz.log'],
|
51
|
+
:Console =>
|
52
|
+
|
53
|
+
# And ignore the remainder, too.
|
54
|
+
}
|
55
|
+
#eof
|
data/lib/timequiz.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
=begin
|
5
5
|
/******************************************************************************
|
6
|
-
* Copyright © 2017-
|
6
|
+
* Copyright © 2017-2021, Michael Uplawski <michael.uplawski@uplawski.eu> *
|
7
7
|
* *
|
8
8
|
* This program is free software; you can redistribute it and/or modify *
|
9
9
|
* it under the terms of the GNU General Public License as published by *
|
@@ -38,7 +38,7 @@ require 'date'
|
|
38
38
|
# interface-module.
|
39
39
|
class Timequiz
|
40
40
|
self::extend(Logging)
|
41
|
-
@@log = self::init_logger
|
41
|
+
@@log = self::init_logger()
|
42
42
|
|
43
43
|
# Find out, how the program has been called.
|
44
44
|
# In juin 2017 this can be 'timequiz' or 'timequizGtk'.
|
@@ -184,8 +184,10 @@ class Timequiz
|
|
184
184
|
def good_order(response, event = nil)
|
185
185
|
if(response.respond_to?(:to_ary) )
|
186
186
|
response_years = []
|
187
|
-
response.each_with_index {|r, i| response_years[r-1] = @m_events[i].year}
|
187
|
+
# response.each_with_index {|r, i| response_years[r-1] = @m_events[i].year}
|
188
|
+
response.each_with_index {|r, i| response_years[i] = @m_events[r-1].year}
|
188
189
|
@log.debug('response is ' << response.join(', ') << "\nresponse_years is : " << response_years.join(', ') )
|
190
|
+
puts 'response is ' << response.join(', ') << "\nresponse_years is : " << response_years.join(', ')
|
189
191
|
|
190
192
|
# do not change the displayed index
|
191
193
|
sort_years(false)
|
data/lib/version.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#encoding: UTF-8
|
3
|
+
|
4
|
+
=begin
|
5
|
+
/******************************************************************************
|
6
|
+
* Copyright © 2021-2021, Michael Uplawski <michael.uplawski@uplawski.eu> *
|
7
|
+
* *
|
8
|
+
* This program is free software; you can redistribute it and/or modify *
|
9
|
+
* it under the terms of the GNU General Public License as published by *
|
10
|
+
* the Free Software Foundation; either version 3 of the License, or *
|
11
|
+
* (at your option) any later version. *
|
12
|
+
* *
|
13
|
+
* This program is distributed in the hope that it will be useful, *
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
16
|
+
* GNU General Public License for more details. *
|
17
|
+
* *
|
18
|
+
* You should have received a copy of the GNU General Public License *
|
19
|
+
* along with this program; if not, write to the *
|
20
|
+
* Free Software Foundation, Inc., *
|
21
|
+
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
22
|
+
******************************************************************************/
|
23
|
+
=end
|
24
|
+
|
25
|
+
VERSION = '0.1.4'
|
26
|
+
SUMMARY = 'Bugs fixed: Timeline validation corrected. Line-breaks in console-output, when more than 9 events are listed.'
|
27
|
+
|
data/timequiz.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative "lib/version"
|
2
|
+
require 'date'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.version = VERSION
|
6
|
+
s.name = File.basename(__FILE__, '.gemspec')
|
7
|
+
s.date = Date.today.strftime('%F')
|
8
|
+
s.summary = SUMMARY
|
9
|
+
s.description = "Play a history game"
|
10
|
+
s.authors = ["Michael Uplawski"]
|
11
|
+
s.email = 'michael.uplawski@uplawski.eu'
|
12
|
+
s.files = %w~timequiz~.collect{|f| 'bin/' << f} + %w~log.conf version.rb file_checking.rb logging.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~.collect{|f|f} + %w~man/timequiz.6.gz html/timequiz.html pdf/timequiz.pdf rst/timequiz.rst license.txt~.collect{|f| 'doc/' << f}
|
13
|
+
s.homepage = ''
|
14
|
+
#s.requirements = ''
|
15
|
+
#s.add_runtime_dependency ''
|
16
|
+
s.executables = 'timequiz'
|
17
|
+
s.license = 'GPL-3.0'
|
18
|
+
s.required_ruby_version = '>= 2.7'
|
19
|
+
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: timequiz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Uplawski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Play a history
|
13
|
+
description: Play a history game
|
14
14
|
email: michael.uplawski@uplawski.eu
|
15
15
|
executables:
|
16
16
|
- timequiz
|
@@ -33,10 +33,13 @@ files:
|
|
33
33
|
- lib/events.rb
|
34
34
|
- lib/extstring.rb
|
35
35
|
- lib/file_checking.rb
|
36
|
+
- lib/log.conf
|
36
37
|
- lib/logging.rb
|
37
38
|
- lib/timequiz.rb
|
38
39
|
- lib/user_input.rb
|
39
|
-
|
40
|
+
- lib/version.rb
|
41
|
+
- timequiz.gemspec
|
42
|
+
homepage: ''
|
40
43
|
licenses:
|
41
44
|
- GPL-3.0
|
42
45
|
metadata: {}
|
@@ -48,16 +51,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
51
|
requirements:
|
49
52
|
- - ">="
|
50
53
|
- !ruby/object:Gem::Version
|
51
|
-
version: 2.
|
54
|
+
version: '2.7'
|
52
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
56
|
requirements:
|
54
57
|
- - ">="
|
55
58
|
- !ruby/object:Gem::Version
|
56
59
|
version: '0'
|
57
60
|
requirements: []
|
58
|
-
|
59
|
-
rubygems_version: 2.6.12
|
61
|
+
rubygems_version: 3.2.5
|
60
62
|
signing_key:
|
61
63
|
specification_version: 4
|
62
|
-
summary:
|
64
|
+
summary: 'Bugs fixed: Timeline validation corrected. Line-breaks in console-output,
|
65
|
+
when more than 9 events are listed.'
|
63
66
|
test_files: []
|