relaton-w3c 1.8.0 → 1.9.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: 3670a87ed6de24ca454f4bc657db1251977eaff97bea51b497f40e9b80a587ac
4
- data.tar.gz: e150c6539b7da99f67ba37d1f51eb7130f8de7d9e0bcc7dc3ca62494bbb8d458
3
+ metadata.gz: 58a4044db1d46717f23268b36efff858fbfdccd7e8c3f2b47d98246831512d42
4
+ data.tar.gz: bf87dbf1f5da70e68dc771f115363c531188b103a23bbf05872c68a8c47131a4
5
5
  SHA512:
6
- metadata.gz: 38f4ee438f65bbe08d497baacfd30e46bf8582488eef93fc454cd60dd3b3cae87b5d0d1c71e5fd5ac8f480e9d2f237b05274f23a7597d1dea03bcc521c70b55b
7
- data.tar.gz: 4df511801c85d5c9da2074a85336ab7b9faaf1c3cd9600733370a11853154e035394af3d0b4a5f0faebb4255ad431c115ea6d432e8bdf16e2e8c4fd0ae6a9520
6
+ metadata.gz: 6b2fae6c6cf119defdf15284f68eac82ccf50766a162889a2f09ca4c3f9e7ffa1705b9f71a2b4b0da20939948f59e424f5a18489bb5ec19d18cfdf742f150aa7
7
+ data.tar.gz: c3ecafb387e50c47a93eeb3fde746420ee801667afe24a2277d0b4812d42a922a67e5374c919d1dff091bd0f02669f156609b0dcb383390f44d9fe6d245023d1
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@v2
34
24
  with:
data/.rubocop.yml CHANGED
@@ -5,6 +5,6 @@
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
7
  AllCops:
8
- TargetRubyVersion: 2.4
8
+ TargetRubyVersion: 2.5
9
9
  Rails:
10
10
  Enabled: false
data/grammars/biblio.rng CHANGED
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -4,7 +4,7 @@ module RelatonW3c
4
4
  # @param item_hash [Hash]
5
5
  # @return [RelatonW3c::W3cBibliographicItem]
6
6
  def bib_item(item_hash)
7
- W3cBibliographicItem.new **item_hash
7
+ W3cBibliographicItem.new(**item_hash)
8
8
  end
9
9
  end
10
10
  end
@@ -22,8 +22,8 @@ module RelatonW3c
22
22
  # @param ref [String] reference to search
23
23
  def initialize(ref)
24
24
  %r{
25
- ^(W3C\s)?
26
- (?<type>(CR|NOTE|PER|PR|REC|RET|WD|Candidate\sRecommendation|
25
+ ^(?:W3C\s)?
26
+ (?<type>(?:CR|NOTE|PER|PR|REC|RET|WD|Candidate\sRecommendation|
27
27
  Group\sNote|Proposed\sEdited\sRecommendation|Proposed\sRecommendation|
28
28
  Recommendation|Retired|Working\sDraft))? # type
29
29
  \s?
@@ -41,7 +41,7 @@ module RelatonW3c
41
41
  # @param title_date [String]
42
42
  # @param type [String]
43
43
  # @return [Array<Hash>]
44
- def from_yaml(title_date, type)
44
+ def from_yaml(title_date, type) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
45
45
  /(?<title>.+)\s(?<date>\d{4}-\d{2}-\d{2})$/ =~ title_date
46
46
  title ||= title_date
47
47
  result = data.select do |hit|
@@ -50,7 +50,7 @@ module RelatonW3c
50
50
  type_date_filter(hit, type, date)
51
51
  end
52
52
  if result.empty?
53
- result = data.select { |h| h["link"].split("/").last.match? /#{title}/ }
53
+ result = data.select { |h| h["link"].split("/").last.match?(/#{title}/) }
54
54
  end
55
55
  result.map { |h| Hit.new(h, self) }
56
56
  end
@@ -109,7 +109,7 @@ module RelatonW3c
109
109
  # @param type [String]
110
110
  # @return [String]
111
111
  def short_type(type)
112
- tp = TYPES.select { |k,v| v == type }.keys
112
+ tp = TYPES.select { |_, v| v == type }.keys
113
113
  tp.first || type
114
114
  end
115
115
 
@@ -137,7 +137,7 @@ module RelatonW3c
137
137
  # fetch data form server and save it to file.
138
138
  #
139
139
  def fetch_data
140
- resp = Net::HTTP.get_response URI.parse(DOMAIN + "/TR/")
140
+ resp = Net::HTTP.get_response URI.parse("#{DOMAIN}/TR/")
141
141
  # return if there aren't any changes since last fetching
142
142
  return unless resp.code == "200"
143
143
 
@@ -153,7 +153,7 @@ module RelatonW3c
153
153
  # @param h_el [Nokogiri::XML::Element]
154
154
  # @param link [Nokogiri::XML::Element]
155
155
  # @param pubdetails [Nokogiri::XML::Element]
156
- def fetch_hit(h_el, link, pubdetails)
156
+ def fetch_hit(h_el, link, pubdetails) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
157
157
  datepub = pubdetails.at("text()").text.match(/\d{4}-\d{2}-\d{2}/).to_s
158
158
  editor = h_el.xpath("ul[@class='editorlist']/li").map { |e| e.text.strip }
159
159
  keyword = h_el.xpath("ul[@class='taglist']/li").map { |e| e.text.strip }
@@ -29,7 +29,7 @@ module RelatonW3c
29
29
  # @return [RelatonIsoBib::CcBibliographicItem]
30
30
  def hash_to_bib(hash)
31
31
  item_hash = ::RelatonW3c::HashConverter.hash_to_bib(hash)
32
- ::RelatonW3c::W3cBibliographicItem.new **item_hash
32
+ ::RelatonW3c::W3cBibliographicItem.new(**item_hash)
33
33
  end
34
34
 
35
35
  # Returns hash of XML grammar
@@ -29,7 +29,7 @@ module RelatonW3c
29
29
  doctype: fetch_doctype(hit, doc),
30
30
  contributor: fetch_contributor(hit, doc),
31
31
  relation: fetch_relation(doc),
32
- keyword: hit["keyword"]
32
+ keyword: hit["keyword"],
33
33
  )
34
34
  end
35
35
 
@@ -53,7 +53,7 @@ module RelatonW3c
53
53
  titles << { content: title.gsub(/\n/, " "), type: "main" }
54
54
  end
55
55
  subtitle = doc.at(
56
- "//h2[@id='subtitle']|//p[contains(@class, 'subline')]"
56
+ "//h2[@id='subtitle']|//p[contains(@class, 'subline')]",
57
57
  )&.text
58
58
  titles << { content: subtitle, tipe: "subtitle" } if subtitle
59
59
  end
@@ -62,7 +62,7 @@ module RelatonW3c
62
62
  end
63
63
  titles.map do |t|
64
64
  title = RelatonBib::FormattedString.new(
65
- content: t[:content], language: "en", script: "Latn"
65
+ content: t[:content], language: "en", script: "Latn",
66
66
  )
67
67
  RelatonBib::TypedTitleString.new(type: t[:type], title: title)
68
68
  end
@@ -88,7 +88,7 @@ module RelatonW3c
88
88
  # @param hit [Hash]
89
89
  # @param doc [Nokogiri::HTML::Document, NilClass]
90
90
  # @return [Array<RelatonBib::BibliographicDate>]
91
- def fetch_date(hit, doc)
91
+ def fetch_date(hit, doc) # rubocop:disable Metrics/CyclomaticComplexity
92
92
  on = hit["datepub"] || doc&.at("//h2/time[@datetime]")&.attr(:datetime)
93
93
  on ||= fetch_date1(doc) || fetch_date2(doc)
94
94
  [RelatonBib::BibliographicDate.new(type: "published", on: on)] if on
@@ -143,7 +143,7 @@ module RelatonW3c
143
143
  end
144
144
  mem
145
145
  end
146
- contribs.map { |c| contrib_info **c }
146
+ contribs.map { |c| contrib_info(**c) }
147
147
  else
148
148
  hit["editor"].map do |ed|
149
149
  contrib_info name: ed, role: [{ type: "editor" }]
@@ -162,7 +162,7 @@ module RelatonW3c
162
162
  # @param element [Nokogiri::XML::Element]
163
163
  # @param type [String]
164
164
  # @return [Hash]
165
- def parse_contrib(element, type)
165
+ def parse_contrib(element, type) # rubocop:disable Metrics/MethodLength
166
166
  p = element.at("a")
167
167
  return unless p
168
168
 
@@ -187,7 +187,7 @@ module RelatonW3c
187
187
  name = RelatonBib::FullName.new completename: completename
188
188
  af = []
189
189
  if args[:org]
190
- org = RelatonBib::Organization.new **args[:org]
190
+ org = RelatonBib::Organization.new(**args[:org])
191
191
  af << RelatonBib::Affiliation.new(organization: org)
192
192
  end
193
193
  en = RelatonBib::Person.new name: name, url: args[:url], affiliation: af
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.8.0".freeze
2
+ VERSION = "1.9.0".freeze
3
3
  end
@@ -10,7 +10,7 @@ module RelatonW3c
10
10
  if args[:doctype] && !TYPES.include?(args[:doctype])
11
11
  warn "[relaton-w3c] invalid document type: #{args[:doctype]}"
12
12
  end
13
- super **args
13
+ super
14
14
  end
15
15
  end
16
16
  end
@@ -18,7 +18,7 @@ module RelatonW3c
18
18
  # @param item_hash [Hash]
19
19
  # @return [RelatonBib::BibliographicItem]
20
20
  def bib_item(item_hash)
21
- W3cBibliographicItem.new **item_hash
21
+ W3cBibliographicItem.new(**item_hash)
22
22
  end
23
23
  end
24
24
  end
data/relaton_w3c.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  "using the IsoBibliographicItem model"
15
15
  spec.homepage = "https://github.com/relaton/relaton-wc3"
16
16
  spec.license = "BSD-2-Clause"
17
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
17
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
18
18
 
19
19
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
20
20
 
@@ -31,13 +31,11 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ["lib"]
33
33
 
34
- # spec.add_development_dependency "debase"
35
34
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
- # spec.add_development_dependency "ruby-debug-ide"
37
35
  spec.add_development_dependency "ruby-jing"
38
36
  spec.add_development_dependency "simplecov"
39
37
  spec.add_development_dependency "vcr"
40
38
  spec.add_development_dependency "webmock"
41
39
 
42
- spec.add_dependency "relaton-bib", ">= 1.8.0"
40
+ spec.add_dependency "relaton-bib", ">= 1.9.0"
43
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-w3c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-17 00:00:00.000000000 Z
11
+ date: 2021-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 1.8.0
89
+ version: 1.9.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 1.8.0
96
+ version: 1.9.0
97
97
  description: 'RelatonIso: retrieve W3C Standards for bibliographic using the IsoBibliographicItem
98
98
  model'
99
99
  email:
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- version: 2.4.0
143
+ version: 2.5.0
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  requirements:
146
146
  - - ">="