wikidata_position_history 1.3.4 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +14 -0
- data/CHANGELOG.md +33 -0
- data/Rakefile +1 -1
- data/lib/query_service.rb +16 -6
- data/lib/sparql/bio_data.rb +56 -0
- data/lib/sparql/mandates.rb +11 -2
- data/lib/wikidata_position_history.rb +16 -14
- data/lib/wikidata_position_history/checks.rb +5 -5
- data/lib/wikidata_position_history/report.rb +45 -76
- data/lib/wikidata_position_history/template.rb +38 -0
- data/lib/wikidata_position_history/version.rb +1 -1
- data/wikidata_position_history.gemspec +6 -4
- metadata +38 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cc474575654a299ceef536c692402288d072d7caf3d9bd62de17d9027bcd287
|
4
|
+
data.tar.gz: 2e6324cc0e272b5b747d65eab1aaa32f1c621a6e672487312f616afd9449d374
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 709a0916f16fd2a890df7ae3e2873968a23f0640945cf756785eb59bf8d7589b578fb2bd51e6263b36de729e20ea2a200cfcd9731ee6957a2e539169cacb0cbf
|
7
|
+
data.tar.gz: 3dbe5d81f0fe77f6487ce0109b91205d3b4361e13c70b48f93464ea4a323d06f3c07b70ea263e4817592cedf1b632e10b10be832dd03a92114f59505b53dae5a
|
data/.rubocop.yml
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rspec
|
4
|
+
|
1
5
|
AllCops:
|
2
6
|
Exclude:
|
3
7
|
- 'Vagrantfile'
|
@@ -29,6 +33,13 @@ Lint/AssignmentInCondition:
|
|
29
33
|
Naming/ClassAndModuleCamelCase:
|
30
34
|
Enabled: false
|
31
35
|
|
36
|
+
RSpec/DescribedClass:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
# TODO: remove this?
|
40
|
+
RSpec/MultipleExpectations:
|
41
|
+
Max: 2
|
42
|
+
|
32
43
|
Style/CollectionMethods:
|
33
44
|
Enabled: true
|
34
45
|
|
@@ -52,3 +63,6 @@ Style/TrailingCommaInHashLiteral:
|
|
52
63
|
|
53
64
|
Style/TrailingCommaInArrayLiteral:
|
54
65
|
EnforcedStyleForMultiline: no_comma
|
66
|
+
|
67
|
+
Layout/ClassStructure:
|
68
|
+
Enabled: true
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,38 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
# [1.5.0] 2020-09-06
|
4
|
+
|
5
|
+
## Enhancements
|
6
|
+
|
7
|
+
* When showing the results for a position from long long ago (such as
|
8
|
+
the High Kings of Ireland), display the dates as "862 – 879" not as
|
9
|
+
"862 – 879"
|
10
|
+
* If we only know that someone took (or left) office sometime in a given
|
11
|
+
decade (i.e. at date precision 8), display that as (say) "1930s"
|
12
|
+
|
13
|
+
## Fixes
|
14
|
+
|
15
|
+
* No longer blows up when a P39 has a start date, but no end date
|
16
|
+
|
17
|
+
# [1.4.2] 2020-09-05
|
18
|
+
|
19
|
+
## Fixes
|
20
|
+
|
21
|
+
* Bring back the warnings when start or end dates are missing.
|
22
|
+
|
23
|
+
# [1.4.1] 2020-09-04
|
24
|
+
|
25
|
+
## Fixes
|
26
|
+
|
27
|
+
* Work around template deployment issue.
|
28
|
+
|
29
|
+
# [1.4.0] 2020-09-04
|
30
|
+
|
31
|
+
## Enhancements
|
32
|
+
|
33
|
+
* Add an image column.
|
34
|
+
* Improve the warning for inconsistent successor/predecessor values.
|
35
|
+
|
3
36
|
# [1.3.4] - 2020-09-01
|
4
37
|
|
5
38
|
## Fixes
|
data/Rakefile
CHANGED
data/lib/query_service.rb
CHANGED
@@ -54,6 +54,8 @@ module QueryService
|
|
54
54
|
class WikidataDate
|
55
55
|
include Comparable
|
56
56
|
|
57
|
+
DATELEN = { '11' => 10, '10' => 7, '9' => 4, '8' => 4 }.freeze
|
58
|
+
|
57
59
|
def initialize(str, precision)
|
58
60
|
@str = str
|
59
61
|
@raw_precision = precision.to_s
|
@@ -66,12 +68,7 @@ module QueryService
|
|
66
68
|
end
|
67
69
|
|
68
70
|
def to_s
|
69
|
-
|
70
|
-
return str[0..6] if precision == '10'
|
71
|
-
return str[0..3] if precision == '9'
|
72
|
-
|
73
|
-
warn "Cannot handle precision #{precision} for #{str}"
|
74
|
-
str
|
71
|
+
precisioned_string.delete_prefix('0')
|
75
72
|
end
|
76
73
|
|
77
74
|
def empty?
|
@@ -99,5 +96,18 @@ module QueryService
|
|
99
96
|
def parts
|
100
97
|
to_s.split('-')
|
101
98
|
end
|
99
|
+
|
100
|
+
def truncated_string
|
101
|
+
return str[0...DATELEN[precision]] if DATELEN.key?(precision)
|
102
|
+
|
103
|
+
warn "Cannot handle precision #{precision} for #{str}"
|
104
|
+
str
|
105
|
+
end
|
106
|
+
|
107
|
+
def precisioned_string
|
108
|
+
return "#{truncated_string}s" if precision == '8'
|
109
|
+
|
110
|
+
truncated_string
|
111
|
+
end
|
102
112
|
end
|
103
113
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WikidataPositionHistory
|
4
|
+
module SPARQL
|
5
|
+
# SPARQL for fetching biographical about all holders of a position
|
6
|
+
#
|
7
|
+
# This is distinct from the mandate query itself to avoid complex
|
8
|
+
# GROUP BY scenarios where people have multiple values for
|
9
|
+
# biographical properties.
|
10
|
+
class BioData < ItemQuery
|
11
|
+
def raw_sparql
|
12
|
+
<<~SPARQL
|
13
|
+
# holder-biodata
|
14
|
+
|
15
|
+
SELECT DISTINCT ?item ?image
|
16
|
+
WHERE {
|
17
|
+
?item wdt:P31 wd:Q5 ; p:P39/ps:P39 wd:%s .
|
18
|
+
OPTIONAL { ?item wdt:P18 ?image }
|
19
|
+
}
|
20
|
+
ORDER BY ?item
|
21
|
+
SPARQL
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Represents a single row returned from the Position query
|
27
|
+
class BioData
|
28
|
+
def initialize(row)
|
29
|
+
@row = row
|
30
|
+
end
|
31
|
+
|
32
|
+
def person
|
33
|
+
QueryService::WikidataItem.new(row.dig(:item, :value))
|
34
|
+
end
|
35
|
+
|
36
|
+
def image_title
|
37
|
+
return if image_url.to_s.empty?
|
38
|
+
|
39
|
+
image_url.split('/').last
|
40
|
+
end
|
41
|
+
|
42
|
+
def image_link(size = 75)
|
43
|
+
return '' unless image_title
|
44
|
+
|
45
|
+
"[[File:#{image_title}|#{size}px]]"
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
attr_reader :row
|
51
|
+
|
52
|
+
def image_url
|
53
|
+
row.dig(:image, :value)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
data/lib/sparql/mandates.rb
CHANGED
@@ -7,6 +7,7 @@ module WikidataPositionHistory
|
|
7
7
|
def raw_sparql
|
8
8
|
<<~SPARQL
|
9
9
|
# position-mandates
|
10
|
+
|
10
11
|
SELECT DISTINCT ?ordinal ?item ?start_date ?start_precision ?end_date ?end_precision ?prev ?next ?nature
|
11
12
|
WHERE {
|
12
13
|
?item wdt:P31 wd:Q5 ; p:P39 ?posn .
|
@@ -19,7 +20,6 @@ module WikidataPositionHistory
|
|
19
20
|
OPTIONAL { ?posn pq:P1366|pq:P156 ?next }
|
20
21
|
OPTIONAL { ?posn pq:P1545 ?ordinal }
|
21
22
|
OPTIONAL { ?posn pq:P5102 ?nature }
|
22
|
-
OPTIONAL { ?posn pq:P5102 ?nature }
|
23
23
|
}
|
24
24
|
ORDER BY DESC(?start_date)
|
25
25
|
SPARQL
|
@@ -37,8 +37,13 @@ module WikidataPositionHistory
|
|
37
37
|
row.dig(:ordinal, :value)
|
38
38
|
end
|
39
39
|
|
40
|
+
def officeholder
|
41
|
+
QueryService::WikidataItem.new(row.dig(:item, :value))
|
42
|
+
end
|
43
|
+
|
44
|
+
# TODO: rename or remove. 'item' is meaningless/ambiguous
|
40
45
|
def item
|
41
|
-
|
46
|
+
officeholder.qlink
|
42
47
|
end
|
43
48
|
|
44
49
|
def prev
|
@@ -58,10 +63,14 @@ module WikidataPositionHistory
|
|
58
63
|
end
|
59
64
|
|
60
65
|
def start_date
|
66
|
+
return if start_date_raw.empty?
|
67
|
+
|
61
68
|
QueryService::WikidataDate.new(start_date_raw, start_date_precision)
|
62
69
|
end
|
63
70
|
|
64
71
|
def end_date
|
72
|
+
return if end_date_raw.empty?
|
73
|
+
|
65
74
|
QueryService::WikidataDate.new(end_date_raw, end_date_precision)
|
66
75
|
end
|
67
76
|
|
@@ -3,8 +3,10 @@
|
|
3
3
|
require 'query_service'
|
4
4
|
require 'sparql/item_query'
|
5
5
|
require 'sparql/position_data'
|
6
|
+
require 'sparql/bio_data'
|
6
7
|
require 'sparql/mandates'
|
7
8
|
require 'wikidata_position_history/checks'
|
9
|
+
require 'wikidata_position_history/template'
|
8
10
|
require 'wikidata_position_history/report'
|
9
11
|
require 'wikidata_position_history/version'
|
10
12
|
|
@@ -20,6 +22,19 @@ module WikidataPositionHistory
|
|
20
22
|
WIKI_USERNAME = ENV['WIKI_USERNAME']
|
21
23
|
WIKI_PASSWORD = ENV['WIKI_PASSWORD']
|
22
24
|
|
25
|
+
NO_ID_ERROR = <<~WIKITEXT
|
26
|
+
'''#{WIKI_TEMPLATE_NAME} Error''': You must pass the <code>id</code>
|
27
|
+
parameter to the <code>#{WIKI_TEMPLATE_NAME}</code> template; e.g.
|
28
|
+
<nowiki>{{#{WIKI_TEMPLATE_NAME}|id=Q14211}}</nowiki>
|
29
|
+
WIKITEXT
|
30
|
+
|
31
|
+
MALFORMED_ID_ERROR = <<~WIKITEXT
|
32
|
+
'''#{WIKI_TEMPLATE_NAME} Error''': The <code>id</code> parameter was
|
33
|
+
malformed; it should be Q followed by a number of digits, e.g. as in:
|
34
|
+
|
35
|
+
<nowiki>{{#{WIKI_TEMPLATE_NAME}|id=Q14211}}</nowiki>
|
36
|
+
WIKITEXT
|
37
|
+
|
23
38
|
def initialize(mediawiki_site:, page_title:)
|
24
39
|
@mediawiki_site = mediawiki_site
|
25
40
|
@page_title = page_title.tr('_', ' ')
|
@@ -31,7 +46,7 @@ module WikidataPositionHistory
|
|
31
46
|
|
32
47
|
def new_content
|
33
48
|
return [NO_ID_ERROR, 'The id parameter was missing'] if position_id.empty?
|
34
|
-
return [MALFORMED_ID_ERROR, 'The id parameter was malformed'] unless position_id
|
49
|
+
return [MALFORMED_ID_ERROR, 'The id parameter was malformed'] unless position_id[/^Q\d+$/]
|
35
50
|
|
36
51
|
[WikidataPositionHistory::Report.new(position_id).wikitext, "Successfully updated holders of #{position_id}"]
|
37
52
|
end
|
@@ -40,19 +55,6 @@ module WikidataPositionHistory
|
|
40
55
|
|
41
56
|
attr_reader :mediawiki_site, :page_title
|
42
57
|
|
43
|
-
NO_ID_ERROR = <<~EOERROR
|
44
|
-
'''#{WIKI_TEMPLATE_NAME} Error''': You must pass the <code>id</code>
|
45
|
-
parameter to the <code>#{WIKI_TEMPLATE_NAME}</code> template; e.g.
|
46
|
-
<nowiki>{{#{WIKI_TEMPLATE_NAME}|id=Q14211}}</nowiki>
|
47
|
-
EOERROR
|
48
|
-
|
49
|
-
MALFORMED_ID_ERROR = <<~EOERROR
|
50
|
-
'''#{WIKI_TEMPLATE_NAME} Error''': The <code>id</code> parameter was
|
51
|
-
malformed; it should be Q followed by a number of digits, e.g. as in:
|
52
|
-
|
53
|
-
<nowiki>{{#{WIKI_TEMPLATE_NAME}|id=Q14211}}</nowiki>
|
54
|
-
EOERROR
|
55
|
-
|
56
58
|
def position_id
|
57
59
|
return id_param unless id_param.empty?
|
58
60
|
|
@@ -100,7 +100,7 @@ module WikidataPositionHistory
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def possible_explanation
|
103
|
-
"#{current.item} has a {{P|1365}} of #{predecessor},
|
103
|
+
"#{current.item} has a {{P|1365}} of #{predecessor}, but follows #{earlier.item} here"
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
@@ -115,7 +115,7 @@ module WikidataPositionHistory
|
|
115
115
|
end
|
116
116
|
|
117
117
|
def possible_explanation
|
118
|
-
"#{current.item} has a {{P|1366}} of #{successor},
|
118
|
+
"#{current.item} has a {{P|1366}} of #{successor}, but is followed by #{later.item} here"
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
@@ -124,10 +124,10 @@ module WikidataPositionHistory
|
|
124
124
|
def problem?
|
125
125
|
return false unless later
|
126
126
|
|
127
|
-
|
128
|
-
return false
|
127
|
+
next_starts = later.start_date or return false
|
128
|
+
ends = current.end_date or return false
|
129
129
|
|
130
|
-
ends >
|
130
|
+
ends > next_starts
|
131
131
|
rescue ArgumentError
|
132
132
|
true
|
133
133
|
end
|
@@ -1,95 +1,62 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module WikidataPositionHistory
|
4
|
-
#
|
5
|
-
class
|
4
|
+
# Date for a single mandate row, to be passed to the report template
|
5
|
+
class MandateData
|
6
|
+
CHECKS = [Check::MissingFields, Check::WrongPredecessor, Check::WrongSuccessor, Check::Overlap].freeze
|
7
|
+
|
6
8
|
def initialize(later, current, earlier)
|
7
9
|
@later = later
|
8
10
|
@current = current
|
9
11
|
@earlier = earlier
|
10
12
|
end
|
11
13
|
|
12
|
-
def output
|
13
|
-
[row_start, ordinal_cell, member_cell, warnings_cell].join("\n")
|
14
|
-
end
|
15
|
-
|
16
|
-
private
|
17
|
-
|
18
|
-
CHECKS = [Check::MissingFields, Check::WrongPredecessor, Check::WrongSuccessor, Check::Overlap].freeze
|
19
|
-
|
20
|
-
WARNING_LAYOUT = [
|
21
|
-
'<span style="display: block">[[File:Pictogram voting comment.svg|15px|link=]] ',
|
22
|
-
'<span style="color: #d33; font-weight: bold; vertical-align: middle;">%s</span> ',
|
23
|
-
'<ref>%s</ref></span>'
|
24
|
-
].join
|
25
|
-
|
26
|
-
attr_reader :later, :current, :earlier
|
27
|
-
|
28
|
-
def row_start
|
29
|
-
'|-'
|
30
|
-
end
|
31
|
-
|
32
|
-
def ordinal_cell
|
33
|
-
%(| style="padding:0.5em 2em" | #{ordinal_string})
|
34
|
-
end
|
35
|
-
|
36
14
|
def ordinal_string
|
37
15
|
ordinal = current.ordinal or return ''
|
38
|
-
ordinal.
|
16
|
+
"#{ordinal}."
|
39
17
|
end
|
40
18
|
|
41
|
-
def
|
42
|
-
|
43
|
-
|
44
|
-
'font-size: 1.5em; display: block;'
|
19
|
+
def person
|
20
|
+
current.item
|
45
21
|
end
|
46
22
|
|
47
|
-
def
|
48
|
-
|
49
|
-
|
50
|
-
end
|
23
|
+
def dates
|
24
|
+
dates = [current.start_date, current.end_date]
|
25
|
+
return '' if dates.compact.empty?
|
51
26
|
|
52
|
-
|
53
|
-
format('| style="padding:0.5em 2em 0.5em 1em; border: none; background: #fff; text-align: left;" | %s',
|
54
|
-
combined_warnings)
|
27
|
+
dates.join(' – ')
|
55
28
|
end
|
56
29
|
|
57
|
-
def
|
58
|
-
|
59
|
-
check = check_class.new(later, current, earlier)
|
60
|
-
format(WARNING_LAYOUT, check.headline, check.explanation) if check.problem?
|
61
|
-
end.join
|
30
|
+
def acting?
|
31
|
+
current.acting?
|
62
32
|
end
|
63
33
|
|
64
|
-
def
|
65
|
-
current.
|
34
|
+
def warnings
|
35
|
+
CHECKS.map { |klass| klass.new(later, current, earlier) }.select(&:problem?)
|
66
36
|
end
|
67
37
|
|
68
|
-
|
69
|
-
dates = [current.start_date, current.end_date]
|
70
|
-
# compact doesn't work here, even if we add #nil? to WikidataDate
|
71
|
-
return '' if dates.reject(&:empty?).empty?
|
38
|
+
private
|
72
39
|
|
73
|
-
|
74
|
-
end
|
40
|
+
attr_reader :later, :current, :earlier
|
75
41
|
end
|
76
42
|
|
77
43
|
# The entire wikitext generated for this report
|
78
44
|
class Report
|
79
|
-
def initialize(
|
80
|
-
@
|
45
|
+
def initialize(position_id, template_class = ReportTemplate)
|
46
|
+
@position_id = position_id
|
47
|
+
@template_class = template_class
|
81
48
|
end
|
82
49
|
|
83
|
-
attr_reader :
|
50
|
+
attr_reader :position_id, :template_class
|
84
51
|
|
85
52
|
def wikitext
|
86
53
|
return no_items_output if mandates.empty?
|
87
54
|
|
88
|
-
|
55
|
+
output
|
89
56
|
end
|
90
57
|
|
91
58
|
def header
|
92
|
-
"== {{Q|#{
|
59
|
+
"== {{Q|#{position_id}}} officeholders #{position_dates} =="
|
93
60
|
end
|
94
61
|
|
95
62
|
def position_dates
|
@@ -108,7 +75,15 @@ module WikidataPositionHistory
|
|
108
75
|
def metadata
|
109
76
|
# TODO: we might get more than one response, if a position has
|
110
77
|
# multiple dates
|
111
|
-
@metadata ||= SPARQL::PositionData.new(
|
78
|
+
@metadata ||= SPARQL::PositionData.new(position_id).results_as(PositionData).first
|
79
|
+
end
|
80
|
+
|
81
|
+
def biodata
|
82
|
+
@biodata ||= SPARQL::BioData.new(position_id).results_as(BioData)
|
83
|
+
end
|
84
|
+
|
85
|
+
def biodata_for(officeholder)
|
86
|
+
biodata.select { |bio| bio.person.id == officeholder.id }
|
112
87
|
end
|
113
88
|
|
114
89
|
def padded_mandates
|
@@ -116,7 +91,7 @@ module WikidataPositionHistory
|
|
116
91
|
end
|
117
92
|
|
118
93
|
def sparql
|
119
|
-
@sparql ||= SPARQL::Mandates.new(
|
94
|
+
@sparql ||= SPARQL::Mandates.new(position_id)
|
120
95
|
end
|
121
96
|
|
122
97
|
def mandates
|
@@ -124,32 +99,26 @@ module WikidataPositionHistory
|
|
124
99
|
end
|
125
100
|
|
126
101
|
def no_items_output
|
127
|
-
"\n{{PositionHolderHistory/error_no_holders|id=#{
|
102
|
+
"\n{{PositionHolderHistory/error_no_holders|id=#{position_id}}}\n"
|
128
103
|
end
|
129
104
|
|
130
|
-
def
|
131
|
-
|
132
|
-
end
|
133
|
-
|
134
|
-
def table_footer
|
135
|
-
"|}\n"
|
136
|
-
end
|
137
|
-
|
138
|
-
def wdqs_section
|
139
|
-
wdqs_div % sparql.wdqs_url
|
105
|
+
def output
|
106
|
+
template_class.new(template_params).output
|
140
107
|
end
|
141
108
|
|
142
|
-
def
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
HTML
|
109
|
+
def template_params
|
110
|
+
{
|
111
|
+
table_rows: table_rows,
|
112
|
+
sparql_url: sparql.wdqs_url,
|
113
|
+
}
|
148
114
|
end
|
149
115
|
|
150
116
|
def table_rows
|
151
117
|
padded_mandates.each_cons(3).map do |later, current, earlier|
|
152
|
-
|
118
|
+
{
|
119
|
+
mandate: MandateData.new(later, current, earlier),
|
120
|
+
bio: biodata_for(current.officeholder),
|
121
|
+
}
|
153
122
|
end
|
154
123
|
end
|
155
124
|
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module WikidataPositionHistory
|
4
|
+
# Interface to the ERB Template for the output
|
5
|
+
class ReportTemplate
|
6
|
+
def initialize(data)
|
7
|
+
@data = data
|
8
|
+
end
|
9
|
+
|
10
|
+
def output
|
11
|
+
template.result_with_hash(data)
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
attr_reader :data
|
17
|
+
|
18
|
+
def template
|
19
|
+
@template ||= ERB.new(template_text)
|
20
|
+
end
|
21
|
+
|
22
|
+
def template_text
|
23
|
+
<<~ERB
|
24
|
+
{| class="wikitable" style="text-align: center; border: none;"
|
25
|
+
<% table_rows.map(&:values).each do |mandate, bio| %>|-
|
26
|
+
| style="padding:0.5em 2em" | <%= mandate.ordinal_string %>
|
27
|
+
| style="padding:0.5em 2em" | <%= bio.map(&:image_link).first %>
|
28
|
+
| style="padding:0.5em 2em" | <span style="font-size: <%= mandate.acting? ? '1.25em; font-style: italic;' : '1.5em' %>; display: block;"><%= mandate.person %></span> <%= mandate.dates %>
|
29
|
+
| style="padding:0.5em 2em 0.5em 1em; border: none; background: #fff; text-align: left;" | <% mandate.warnings.each do |warning| %><span style="display: block">[[File:Pictogram voting comment.svg|15px|link=]] <span style="color: #d33; font-weight: bold; vertical-align: middle;"><%= warning.headline %></span> <ref><%= warning.explanation %></ref></span><% end %>
|
30
|
+
<% end %>|}
|
31
|
+
|
32
|
+
<div style="margin-bottom:5px; border-bottom:3px solid #2f74d0; font-size:8pt">
|
33
|
+
<div style="float:right">[<%= sparql_url %> WDQS]</div>
|
34
|
+
</div>
|
35
|
+
ERB
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -11,8 +11,8 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.authors = ['Tony Bowden', 'Mark Longair']
|
12
12
|
spec.email = ['tony@tmtm.com']
|
13
13
|
|
14
|
-
spec.summary = 'Generates a
|
15
|
-
spec.homepage = 'https://github.com/
|
14
|
+
spec.summary = 'Generates a table of historic holders of a Wikidata position'
|
15
|
+
spec.homepage = 'https://github.com/tmtmtmtm/wikidata-position-history/'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
18
18
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
|
-
spec.add_runtime_dependency 'mediawiki-replaceable-content', '0.2.
|
27
|
+
spec.add_runtime_dependency 'mediawiki-replaceable-content', '0.2.2'
|
28
28
|
spec.add_runtime_dependency 'rest-client', '~> 2.0'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 2.1'
|
@@ -33,6 +33,8 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.add_development_dependency 'rake', '~> 13.0'
|
34
34
|
spec.add_development_dependency 'reek', '~> 6.0'
|
35
35
|
spec.add_development_dependency 'rubocop', '~> 0.89'
|
36
|
+
spec.add_development_dependency 'rubocop-performance', '~> 1.8.0'
|
37
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 1.43.2'
|
36
38
|
spec.add_development_dependency 'warning', '~> 1.1'
|
37
|
-
spec.add_development_dependency 'webmock', '~> 3.
|
39
|
+
spec.add_development_dependency 'webmock', '~> 3.8.3'
|
38
40
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wikidata_position_history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Bowden
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-09-
|
12
|
+
date: 2020-09-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mediawiki-replaceable-content
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.2.
|
20
|
+
version: 0.2.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.2.
|
27
|
+
version: 0.2.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rest-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -123,6 +123,34 @@ dependencies:
|
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0.89'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rubocop-performance
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - "~>"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 1.8.0
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - "~>"
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: 1.8.0
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: rubocop-rspec
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - "~>"
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: 1.43.2
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - "~>"
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 1.43.2
|
126
154
|
- !ruby/object:Gem::Dependency
|
127
155
|
name: warning
|
128
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,14 +171,14 @@ dependencies:
|
|
143
171
|
requirements:
|
144
172
|
- - "~>"
|
145
173
|
- !ruby/object:Gem::Version
|
146
|
-
version: 3.
|
174
|
+
version: 3.8.3
|
147
175
|
type: :development
|
148
176
|
prerelease: false
|
149
177
|
version_requirements: !ruby/object:Gem::Requirement
|
150
178
|
requirements:
|
151
179
|
- - "~>"
|
152
180
|
- !ruby/object:Gem::Version
|
153
|
-
version: 3.
|
181
|
+
version: 3.8.3
|
154
182
|
description:
|
155
183
|
email:
|
156
184
|
- tony@tmtm.com
|
@@ -176,15 +204,17 @@ files:
|
|
176
204
|
- exe/position-history-for-item
|
177
205
|
- exe/update_wikidata_page
|
178
206
|
- lib/query_service.rb
|
207
|
+
- lib/sparql/bio_data.rb
|
179
208
|
- lib/sparql/item_query.rb
|
180
209
|
- lib/sparql/mandates.rb
|
181
210
|
- lib/sparql/position_data.rb
|
182
211
|
- lib/wikidata_position_history.rb
|
183
212
|
- lib/wikidata_position_history/checks.rb
|
184
213
|
- lib/wikidata_position_history/report.rb
|
214
|
+
- lib/wikidata_position_history/template.rb
|
185
215
|
- lib/wikidata_position_history/version.rb
|
186
216
|
- wikidata_position_history.gemspec
|
187
|
-
homepage: https://github.com/
|
217
|
+
homepage: https://github.com/tmtmtmtm/wikidata-position-history/
|
188
218
|
licenses:
|
189
219
|
- MIT
|
190
220
|
metadata:
|
@@ -208,5 +238,5 @@ rubyforge_project:
|
|
208
238
|
rubygems_version: 2.7.6.2
|
209
239
|
signing_key:
|
210
240
|
specification_version: 4
|
211
|
-
summary: Generates a
|
241
|
+
summary: Generates a table of historic holders of a Wikidata position
|
212
242
|
test_files: []
|