wikidata_position_history 1.10.0 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d45377b5ba871d76f191e7dafe516f308c4f1b17f166b19d0658ee15fff98745
4
- data.tar.gz: ede75c366b3cf99a417ab402f5151880a477b3aa1fc10ff0d4261fb7b7fc0d44
3
+ metadata.gz: 4e59634d8233371767e5a151e60d8bb5f3c8f5703302654c59f5db407faea4a4
4
+ data.tar.gz: 763b5794f41ad395b045fedfb7b132fc6139698e3514df0caf96a47bd5d224d2
5
5
  SHA512:
6
- metadata.gz: 141397d38a5a771e8b2cb159bcd8db327d50f157ba93539b09bb08ff23a64a60e6aa4bdac2bf1a45bdd65dc2f8d343e1a4737a89fc939eafe7ed25e7473562ff
7
- data.tar.gz: 0a3cb133222f05d0ff46dd7810a62a72f3b19ca1f7431bf265752867b916b8ef176f04e11b65a50d2b6ed8d04ba20dc3ecf6fe73cd5fb24caf98737f401b685b
6
+ metadata.gz: 8ad33ca550ad0a5a83ffd42bc03ce8de8df93f77b932ec8ae74d21c528160e8b47d55ff8569641d34801e7f181f0b3b9c856e2d27f5aef91914d73522e5e63de
7
+ data.tar.gz: 7dba23307f13045710a4bc3b7c0869e024fcf206b023e9740c3c8c5366ea7aa260a1dcc342cf7c0875ed1b635c2bc3b96e350720e32c01e35051b1bc1d37e747
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ # [1.11.0] 2020-09-14
4
+
5
+ ## Enhancements
6
+
7
+ * Wikidata now has a new {{QB}} template to link to _both_ an Item and
8
+ its Talk page. As the PositionHolderHistory template for a position
9
+ often lives on its Talk page, any link to a position item now uses
10
+ this template, for easier of access to that. (Requested by Tagishsimon:
11
+ https://twitter.com/Tagishsimon/status/1304363879322079233)
12
+
13
+ * The change to how warnings templates work from the last release (i.e.
14
+ using on-wiki templates, so they can be improved or translated, or used
15
+ to look for problems via backlinks) definitely seems to have been a good
16
+ idea, so now the warnings for having an unexpected number of inception
17
+ or abolition dates have also been adjusted to work the same way.
18
+
3
19
  # [1.10.0] 2020-09-13
4
20
 
5
21
  ## Enhancements
@@ -49,8 +49,16 @@ module QueryService
49
49
  "{{Q|#{id}}}" if id
50
50
  end
51
51
 
52
+ def qblink
53
+ "{{QB|#{id}}}" if id
54
+ end
55
+
52
56
  def qlink_i
53
- "''{{Q|#{id}}}''" if id
57
+ "''#{qlink}''" if qlink
58
+ end
59
+
60
+ def qblink_i
61
+ "''#{qblink}''" if qblink
54
62
  end
55
63
 
56
64
  private
@@ -62,8 +62,8 @@ module WikidataPositionHistory
62
62
 
63
63
  attr_reader :metadata
64
64
 
65
- def qlink
66
- metadata.position.qlink
65
+ def position_id
66
+ metadata.position.id
67
67
  end
68
68
  end
69
69
 
@@ -72,10 +72,9 @@ module WikidataPositionHistory
72
72
  def warnings
73
73
  count = dates.count
74
74
  return [] if count == 1
75
+ return [Warning.new('Missing field', "{{PositionHolderHistory/warning_no_inception_date|item=#{position_id}}}")] if count.zero?
75
76
 
76
- return [Warning.new('Missing field', "#{qlink} is missing {{P|571}}")] if count.zero?
77
-
78
- [Warning.new('Multiple values', "#{qlink} has more than one {{P|571}}")]
77
+ [Warning.new('Multiple values', "{{PositionHolderHistory/warning_multiple_inception_dates|item=#{position_id}}}")]
79
78
  end
80
79
 
81
80
  private
@@ -90,7 +89,7 @@ module WikidataPositionHistory
90
89
  def warnings
91
90
  return [] unless dates.count > 1
92
91
 
93
- [Warning.new('Multiple values', "#{qlink} has more than one {{P|576}}")]
92
+ [Warning.new('Multiple values', "{{PositionHolderHistory/warning_multiple_abolition_dates|item=#{position_id}}}")]
94
93
  end
95
94
 
96
95
  private
@@ -109,7 +108,7 @@ module WikidataPositionHistory
109
108
  def position
110
109
  return if implied_list.empty?
111
110
 
112
- (implied_list.direct.map(&:qlink) + implied_list.indirect_only.map(&:qlink_i)).join(', ')
111
+ (implied_list.direct.map(&:qblink) + implied_list.indirect_only.map(&:qblink_i)).join(', ')
113
112
  end
114
113
 
115
114
  def warnings
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WikidataPositionHistory
4
- VERSION = '1.10.0'
4
+ VERSION = '1.11.0'
5
5
  end
@@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
36
36
  spec.add_development_dependency 'rubocop-performance', '~> 1.8.0'
37
37
  spec.add_development_dependency 'rubocop-rspec', '~> 1.43.2'
38
38
  spec.add_development_dependency 'warning', '~> 1.1'
39
- spec.add_development_dependency 'webmock', '~> 3.8.3'
39
+ spec.add_development_dependency 'webmock', '~> 3.9.1'
40
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.10.0
4
+ version: 1.11.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-13 00:00:00.000000000 Z
12
+ date: 2020-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mediawiki-replaceable-content
@@ -171,14 +171,14 @@ dependencies:
171
171
  requirements:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
- version: 3.8.3
174
+ version: 3.9.1
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: 3.8.3
181
+ version: 3.9.1
182
182
  description:
183
183
  email:
184
184
  - tony@tmtm.com