relaton-w3c 1.5.0 → 1.7.2

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: da93038fdc3d0a5448818ddb7b32173f99e6552a54f2d19b7a88edbe20ac14d0
4
- data.tar.gz: f9a0ccbbe5172ed6618a7d570f032feb8b8d16b915dc19b1533215134a18e66f
3
+ metadata.gz: 17f1426ebddbbdef5ead1fc40aa991c0bb849a09e4c0a0e59b717c5b96cc8c79
4
+ data.tar.gz: 3e3609d8557a1798be22ace1b9ad1cb72b0ec06165651ad5b18e244e6163f412
5
5
  SHA512:
6
- metadata.gz: 806960b3a8ada23fa2015fb88c9d4e9095c790ada8a0ed758d58cf7d99f974c2c25b2e0453ecf3f9e10a518f1b5ed4bdc2a829e33821ef7f86ddb3ad2ef894cf
7
- data.tar.gz: d546bf3674eef23bfc90484471dd9130cc849b74557145ae674cf5eba5b1a127938db7f65321846eb669e45e68dc1b921a2c0716a4f8a1f8ee7666a5d945fc62
6
+ metadata.gz: 66f0bb2a3905cd8eacccebc4369cf820d1990901cd0430120a03bfcd47011d5759225cd416e410fb2c89fb8836c752c4d3e4c52fa0d1b3c980d74e7b34acf493
7
+ data.tar.gz: 1e91d858454e8ebd059798bb1f87b1b35e66d37af7fc1912bccaa12e8f6078ce8c5b28fd3a42bac2fdab23f653b5c8e5dc99e3e42ae1ab4144c6eda51cf7c214
@@ -0,0 +1,46 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
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
+ steps:
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
36
+
37
+ # https://github.com/ruby-debug/debase/issues/89#issuecomment-686827382
38
+ - if: matrix.os == 'macos-latest' && matrix.ruby == '2.5'
39
+ run: echo BUNDLE_BUILD__DEBASE="--with-cflags=\"-Wno-error=implicit-function-declaration\"" >> $GITHUB_ENV
40
+
41
+ - uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: ${{ matrix.ruby }}
44
+ bundler-cache: true
45
+
46
+ - run: bundle exec rake
@@ -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
@@ -17,7 +17,7 @@ module RelatonW3c
17
17
  }.freeze
18
18
  DOMAIN = "https://www.w3.org"
19
19
  DATADIR = File.expand_path(".relaton/w3c", Dir.home).freeze
20
- DATAFILE = File.expand_path("bibliograhy.yml", DATADIR).freeze
20
+ DATAFILE = File.expand_path("bibliography.yml", DATADIR).freeze
21
21
 
22
22
  # @param ref [String] reference to search
23
23
  def initialize(ref)
@@ -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
@@ -49,7 +49,9 @@ module RelatonW3c
49
49
  titles = []
50
50
  if doc
51
51
  title = doc.at("//*[contains(@id, 'title')]")&.text
52
- titles << { content: title, type: "main" } if title && !title.empty?
52
+ if title && !title.empty?
53
+ titles << { content: title.gsub(/\n/, " "), type: "main" }
54
+ end
53
55
  subtitle = doc.at(
54
56
  "//h2[@id='subtitle']|//p[contains(@class, 'subline')]"
55
57
  )&.text
@@ -71,7 +73,8 @@ module RelatonW3c
71
73
  def fetch_abstract(doc)
72
74
  return [] unless doc
73
75
 
74
- content = doc.at("//h2[.='Abstract']/following-sibling::p").text
76
+ content = doc.at("//h2[.='Abstract']/following-sibling::p",
77
+ "//div[@class='abstract']/p").text
75
78
  [RelatonBib::FormattedString.new(content: content, language: "en",
76
79
  script: "Latn")]
77
80
  end
@@ -140,7 +143,7 @@ module RelatonW3c
140
143
  end
141
144
  mem
142
145
  end
143
- contribs.map { |c| contrib_info c }
146
+ contribs.map { |c| contrib_info **c }
144
147
  else
145
148
  hit["editor"].map do |ed|
146
149
  contrib_info name: ed, role: [{ type: "editor" }]
@@ -184,7 +187,7 @@ module RelatonW3c
184
187
  name = RelatonBib::FullName.new completename: completename
185
188
  af = []
186
189
  if args[:org]
187
- org = RelatonBib::Organization.new args[:org]
190
+ org = RelatonBib::Organization.new **args[:org]
188
191
  af << RelatonBib::Affiliation.new(organization: org)
189
192
  end
190
193
  en = RelatonBib::Person.new name: name, url: args[:url], affiliation: af
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.5.0".freeze
2
+ VERSION = "1.7.2".freeze
3
3
  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
@@ -31,13 +31,13 @@ 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"
34
+ # spec.add_development_dependency "debase"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
36
- spec.add_development_dependency "ruby-debug-ide"
36
+ # spec.add_development_dependency "ruby-debug-ide"
37
37
  spec.add_development_dependency "ruby-jing"
38
38
  spec.add_development_dependency "simplecov"
39
39
  spec.add_development_dependency "vcr"
40
40
  spec.add_development_dependency "webmock"
41
41
 
42
- spec.add_dependency "relaton-bib", ">= 1.5.0"
42
+ spec.add_dependency "relaton-bib", ">= 1.7.0"
43
43
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-w3c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-09 00:00:00.000000000 Z
11
+ date: 2021-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: debase
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: equivalent-xml
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +24,6 @@ dependencies:
38
24
  - - "~>"
39
25
  - !ruby/object:Gem::Version
40
26
  version: '0.6'
41
- - !ruby/object:Gem::Dependency
42
- name: ruby-debug-ide
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
27
  - !ruby/object:Gem::Dependency
56
28
  name: ruby-jing
57
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +86,14 @@ dependencies:
114
86
  requirements:
115
87
  - - ">="
116
88
  - !ruby/object:Gem::Version
117
- version: 1.5.0
89
+ version: 1.7.0
118
90
  type: :runtime
119
91
  prerelease: false
120
92
  version_requirements: !ruby/object:Gem::Requirement
121
93
  requirements:
122
94
  - - ">="
123
95
  - !ruby/object:Gem::Version
124
- version: 1.5.0
96
+ version: 1.7.0
125
97
  description: 'RelatonIso: retrieve W3C Standards for bibliographic using the IsoBibliographicItem
126
98
  model'
127
99
  email:
@@ -130,9 +102,7 @@ executables: []
130
102
  extensions: []
131
103
  extra_rdoc_files: []
132
104
  files:
133
- - ".github/workflows/macos.yml"
134
- - ".github/workflows/ubuntu.yml"
135
- - ".github/workflows/windows.yml"
105
+ - ".github/workflows/rake.yml"
136
106
  - ".gitignore"
137
107
  - ".hound.yml"
138
108
  - ".rspec"
@@ -1,38 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: macos
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- branches: [ '**' ]
10
-
11
- jobs:
12
- test-macos:
13
- name: Test on Ruby ${{ matrix.ruby }} macOS
14
- runs-on: macos-latest
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby: [ '2.6', '2.5', '2.4' ]
19
- steps:
20
- - uses: actions/checkout@master
21
- - name: Checkout submodules
22
- shell: bash
23
- run: |
24
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
- git submodule sync --recursive
26
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
- - name: Use Ruby
28
- uses: actions/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- architecture: 'x64'
32
- - name: Update gems
33
- run: |
34
- sudo gem install bundler --force
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- bundle exec rake
@@ -1,39 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: ubuntu
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- branches: [ '**' ]
10
-
11
- jobs:
12
- test-linux:
13
- name: Test on Ruby ${{ matrix.ruby }} Ubuntu
14
- runs-on: ubuntu-latest
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby: [ '2.6', '2.5', '2.4' ]
19
- steps:
20
- - uses: actions/checkout@master
21
- - name: Checkout submodules
22
- shell: bash
23
- run: |
24
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
- git submodule sync --recursive
26
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
- - name: Use Ruby
28
- uses: actions/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- architecture: 'x64'
32
- - name: Update gems
33
- run: |
34
- gem install bundler
35
- bundle install --jobs 4 --retry 3
36
- - name: Run specs
37
- run: |
38
- unset JAVA_TOOL_OPTIONS
39
- bundle exec rake
@@ -1,41 +0,0 @@
1
- # Auto-generated by Cimas: Do not edit it manually!
2
- # See https://github.com/metanorma/cimas
3
- name: windows
4
-
5
- on:
6
- push:
7
- branches: [ master ]
8
- pull_request:
9
- branches: [ '**' ]
10
-
11
- jobs:
12
- test-windows:
13
- name: Test on Ruby ${{ matrix.ruby }} Windows
14
- runs-on: windows-latest
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby: [ '2.6', '2.5', '2.4' ]
19
- steps:
20
- - uses: actions/checkout@master
21
- - name: Checkout submodules
22
- shell: bash
23
- run: |
24
- auth_header="$(git config --local --get http.https://github.com/.extraheader)"
25
- git submodule sync --recursive
26
- git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
27
- - name: Use Ruby
28
- uses: actions/setup-ruby@v1
29
- with:
30
- ruby-version: ${{ matrix.ruby }}
31
- architecture: 'x64'
32
- - name: Update gems
33
- shell: pwsh
34
- run: |
35
- gem install bundler
36
- bundle config --local path vendor/bundle
37
- bundle update
38
- bundle install --jobs 4 --retry 3
39
- - name: Run specs
40
- run: |
41
- bundle exec rake