relaton-oasis 2.0.0.pre.alpha.3 → 2.1.0
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 +4 -4
- data/CLAUDE.md +4 -0
- data/Gemfile +1 -0
- data/README.adoc +2 -0
- data/Rakefile +22 -0
- data/grammars/biblio.rng +4 -8
- data/lib/relaton/oasis/bibdata.rb +1 -0
- data/lib/relaton/oasis/bibitem.rb +1 -0
- data/lib/relaton/oasis/data_parser_utils.rb +15 -1
- data/lib/relaton/oasis/ext.rb +3 -7
- data/lib/relaton/oasis/version.rb +1 -1
- data/{relaton_oasis.gemspec → relaton-oasis.gemspec} +1 -1
- metadata +9 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd8ef234de017d7010bed3950ba491e675993fb3ae0cc20352e49d895c93e5fc
|
|
4
|
+
data.tar.gz: 4db3c44d28f7e88a2149b2ad001d33369499a707ff8ca0e450fc6750fdb63403
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 620a407b5e44093b1479f2c51e61963b3bfcd3300d1edf9b54d2ba708807d35c70a7f917def803d2c87ab3cd23fad079030360aaca791619ba3dc801ccd4e934
|
|
7
|
+
data.tar.gz: 0c2ccfba218a94ecbf5bc947db23b2f2e0dd474066ea44ff66a40fe604797886ba4861d5fd851e1f3881c5bb5f5f6a93d1773c56c628e0f2625ee6e42e1982fa
|
data/CLAUDE.md
CHANGED
|
@@ -53,3 +53,7 @@ Tests are round-trip based: parse a fixture file, serialize back, and compare ou
|
|
|
53
53
|
## Style
|
|
54
54
|
|
|
55
55
|
RuboCop config inherits from the Ribose OSS style guide. Target Ruby version: 3.4. Rails cops are required but disabled.
|
|
56
|
+
|
|
57
|
+
## Testing
|
|
58
|
+
|
|
59
|
+
- **Index fixture:** `spec/fixtures/index-v1.zip` is pre-loaded into `Relaton::Index` pool in `before(:suite)` (configured in `spec/support/webmock.rb`). Run `rake spec:update_index` to refresh from relaton-data-oasis.
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -143,6 +143,8 @@ RelatonOasis uses the relaton-logger gem for logging. By default, it logs to STD
|
|
|
143
143
|
|
|
144
144
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
145
145
|
|
|
146
|
+
To update the index test fixture (used by tests), run `rake spec:update_index`. This downloads the latest `index-v1.zip` from the https://github.com/relaton/relaton-data-oasis[relaton-data-oasis] repository.
|
|
147
|
+
|
|
146
148
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
147
149
|
|
|
148
150
|
== Contributing
|
data/Rakefile
CHANGED
|
@@ -10,3 +10,25 @@ require "rubocop/rake_task"
|
|
|
10
10
|
RuboCop::RakeTask.new
|
|
11
11
|
|
|
12
12
|
task default: %i[spec]
|
|
13
|
+
|
|
14
|
+
namespace :spec do
|
|
15
|
+
desc "Download latest OASIS index fixture from relaton-data-oasis"
|
|
16
|
+
task :update_index do
|
|
17
|
+
require "net/http"
|
|
18
|
+
require "uri"
|
|
19
|
+
|
|
20
|
+
url = "https://raw.githubusercontent.com/relaton/relaton-data-oasis/data-v2/index-v1.zip"
|
|
21
|
+
dest = File.join(__dir__, "spec", "fixtures", "index-v1.zip")
|
|
22
|
+
|
|
23
|
+
puts "Downloading \#{url} ..."
|
|
24
|
+
uri = URI.parse(url)
|
|
25
|
+
response = Net::HTTP.get_response(uri)
|
|
26
|
+
|
|
27
|
+
if response.is_a?(Net::HTTPSuccess)
|
|
28
|
+
File.binwrite(dest, response.body)
|
|
29
|
+
puts "Updated \#{dest} (\#{response.body.bytesize} bytes)"
|
|
30
|
+
else
|
|
31
|
+
abort "Failed to download: HTTP \#{response.code}"
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
data/grammars/biblio.rng
CHANGED
|
@@ -2015,15 +2015,11 @@ provided that it is not the entire bibliographic item that is so related</a:docu
|
|
|
2015
2015
|
<a:documentation>A version of the bibliographic item (within an edition). Can be used for drafts</a:documentation>
|
|
2016
2016
|
<element name="version">
|
|
2017
2017
|
<optional>
|
|
2018
|
-
<
|
|
2019
|
-
<a:documentation>
|
|
2020
|
-
</
|
|
2021
|
-
</optional>
|
|
2022
|
-
<optional>
|
|
2023
|
-
<ref name="draft">
|
|
2024
|
-
<a:documentation>The identifier for the current draft of the bibliographic item</a:documentation>
|
|
2025
|
-
</ref>
|
|
2018
|
+
<attribute name="type">
|
|
2019
|
+
<a:documentation>Versioning scheme, in case of multiple versioning schemes</a:documentation>
|
|
2020
|
+
</attribute>
|
|
2026
2021
|
</optional>
|
|
2022
|
+
<text/>
|
|
2027
2023
|
</element>
|
|
2028
2024
|
</define>
|
|
2029
2025
|
<define name="vedition">
|
|
@@ -132,7 +132,21 @@ module Relaton
|
|
|
132
132
|
def person_email(email)
|
|
133
133
|
return [] unless email
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
href = email[:href]
|
|
136
|
+
if href.start_with?("mailto:")
|
|
137
|
+
[href.split(":")[1]]
|
|
138
|
+
elsif (cf_email = email.at(".//span[@data-cfemail]"))
|
|
139
|
+
decoded = decode_cf_email(cf_email["data-cfemail"])
|
|
140
|
+
decoded.empty? ? [] : [decoded]
|
|
141
|
+
else
|
|
142
|
+
[]
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
def decode_cf_email(encoded)
|
|
147
|
+
bytes = [encoded].pack("H*").bytes
|
|
148
|
+
key = bytes.first
|
|
149
|
+
bytes[1..].map { |b| (b ^ key).chr }.join
|
|
136
150
|
end
|
|
137
151
|
|
|
138
152
|
def person_affiliation(org)
|
data/lib/relaton/oasis/ext.rb
CHANGED
|
@@ -3,7 +3,6 @@ require_relative "doctype"
|
|
|
3
3
|
module Relaton
|
|
4
4
|
module Oasis
|
|
5
5
|
class Ext < Bib::Ext
|
|
6
|
-
attribute :schema_version, method: :get_schema_version
|
|
7
6
|
attribute :doctype, Doctype
|
|
8
7
|
attribute :technology_area, :string, collection: true, values: %w[
|
|
9
8
|
Cloud Content-Technologies Cybersecurity e-Business eGov/Legal Emergency-Management
|
|
@@ -11,13 +10,10 @@ module Relaton
|
|
|
11
10
|
Privacy/Identity Security SOA Web-Services Software-Development Virtualization
|
|
12
11
|
]
|
|
13
12
|
|
|
14
|
-
xml
|
|
15
|
-
|
|
16
|
-
end
|
|
13
|
+
xml { map_element "technology-area", to: :technology_area }
|
|
14
|
+
key_value { map "technology_area", to: :technology_area }
|
|
17
15
|
|
|
18
|
-
def get_schema_version
|
|
19
|
-
Relaton.schema_versions["relaton-model-oasis"]
|
|
20
|
-
end
|
|
16
|
+
def get_schema_version = Relaton.schema_versions["relaton-model-oasis"]
|
|
21
17
|
end
|
|
22
18
|
end
|
|
23
19
|
end
|
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
|
|
34
34
|
spec.add_dependency "mechanize", "~> 2.10"
|
|
35
35
|
spec.add_dependency "multi_json", "~> 1.15.0"
|
|
36
|
-
spec.add_dependency "relaton-bib", "~> 2.
|
|
36
|
+
spec.add_dependency "relaton-bib", "~> 2.1.0"
|
|
37
37
|
spec.add_dependency "relaton-core", "~> 0.0.13"
|
|
38
38
|
spec.add_dependency "relaton-index", "~> 0.2.0"
|
|
39
39
|
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-oasis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-05-04 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: mechanize
|
|
@@ -43,14 +44,14 @@ dependencies:
|
|
|
43
44
|
requirements:
|
|
44
45
|
- - "~>"
|
|
45
46
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 2.
|
|
47
|
+
version: 2.1.0
|
|
47
48
|
type: :runtime
|
|
48
49
|
prerelease: false
|
|
49
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
51
|
requirements:
|
|
51
52
|
- - "~>"
|
|
52
53
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 2.
|
|
54
|
+
version: 2.1.0
|
|
54
55
|
- !ruby/object:Gem::Dependency
|
|
55
56
|
name: relaton-core
|
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -120,13 +121,14 @@ files:
|
|
|
120
121
|
- lib/relaton/oasis/processor.rb
|
|
121
122
|
- lib/relaton/oasis/util.rb
|
|
122
123
|
- lib/relaton/oasis/version.rb
|
|
123
|
-
-
|
|
124
|
+
- relaton-oasis.gemspec
|
|
124
125
|
homepage: https://github.com/metanorma/relaton-oasis
|
|
125
126
|
licenses:
|
|
126
127
|
- BSD-2-Clause
|
|
127
128
|
metadata:
|
|
128
129
|
homepage_uri: https://github.com/metanorma/relaton-oasis
|
|
129
130
|
source_code_uri: https://github.com/metanorma/relaton-oasis
|
|
131
|
+
post_install_message:
|
|
130
132
|
rdoc_options: []
|
|
131
133
|
require_paths:
|
|
132
134
|
- lib
|
|
@@ -141,7 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
141
143
|
- !ruby/object:Gem::Version
|
|
142
144
|
version: '0'
|
|
143
145
|
requirements: []
|
|
144
|
-
rubygems_version: 3.
|
|
146
|
+
rubygems_version: 3.5.22
|
|
147
|
+
signing_key:
|
|
145
148
|
specification_version: 4
|
|
146
149
|
summary: 'Relaton::Oasis: retrieve OASIS Standards for bibliographic use using the
|
|
147
150
|
BibliographicItem model'
|