relaton-xsf 2.0.0 → 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 +1 -0
- data/Gemfile +1 -0
- data/README.adoc +2 -0
- data/Rakefile +22 -0
- data/lib/relaton/xsf/bibdata.rb +1 -0
- data/lib/relaton/xsf/bibitem.rb +1 -0
- data/lib/relaton/xsf/hit.rb +1 -1
- data/lib/relaton/xsf/item.rb +1 -1
- data/lib/relaton/xsf/item_data.rb +6 -0
- data/lib/relaton/xsf/processor.rb +2 -2
- data/lib/relaton/xsf/version.rb +1 -1
- data/lib/relaton/xsf.rb +1 -0
- metadata +9 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2eff61967040fd3ea6500df569aeb613bbe63073e229452ff38cf74ad772f049
|
|
4
|
+
data.tar.gz: c6abda880e33632ccd613c85a24f343d7cd159cd471b8792f2bbb76209d400f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4c11b6c3de956757d00a77d95e12d0ceb52c4c7601b774fcceb030402c1950c534c2af6882818f4d6d2f087082c21eddcc4c361e0213da6257ddf8de06f821d
|
|
7
|
+
data.tar.gz: 50b47c9c717b7745e822c2d4a8e8aea426f02b56d7eb139ef6439d6e7d5083b63b884107fb2b1acc0fb7568e03688d3754f0f75826e91d02bf6743365df16be0
|
data/CLAUDE.md
CHANGED
|
@@ -37,6 +37,7 @@ Constants: `INDEXFILE = "index-v1"`, `GHDATA_URL` points to relaton-data-xsf `da
|
|
|
37
37
|
|
|
38
38
|
## Testing
|
|
39
39
|
|
|
40
|
+
- **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-xsf.
|
|
40
41
|
- RSpec with VCR cassettes (`spec/vcr_cassettes/`) for HTTP interactions
|
|
41
42
|
- WebMock disables all external network connections
|
|
42
43
|
- Fixtures in `spec/fixtures/` (item.yaml, bibdata.xml, bibitem.xml)
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -139,6 +139,8 @@ Relaton::Xsf uses the relaton-logger gem for logging. By default, it logs to STD
|
|
|
139
139
|
|
|
140
140
|
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.
|
|
141
141
|
|
|
142
|
+
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-xsf[relaton-data-xsf] repository.
|
|
143
|
+
|
|
142
144
|
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 tags, and push the `.gem` file to https://rubygems.org[rubygems.org].
|
|
143
145
|
|
|
144
146
|
== 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 XSF index fixture from relaton-data-xsf"
|
|
16
|
+
task :update_index do
|
|
17
|
+
require "net/http"
|
|
18
|
+
require "uri"
|
|
19
|
+
|
|
20
|
+
url = "https://raw.githubusercontent.com/relaton/relaton-data-xsf/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/lib/relaton/xsf/bibdata.rb
CHANGED
data/lib/relaton/xsf/bibitem.rb
CHANGED
data/lib/relaton/xsf/hit.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Relaton
|
|
|
8
8
|
resp = agent.get hit[:url]
|
|
9
9
|
hash = YAML.safe_load resp.body
|
|
10
10
|
hash["fetched"] = Date.today.to_s
|
|
11
|
-
@doc = Relaton::
|
|
11
|
+
@doc = Relaton::Xsf::Item.from_yaml hash.to_yaml
|
|
12
12
|
rescue StandardError => e
|
|
13
13
|
raise Relaton::RequestError, e.message
|
|
14
14
|
end
|
data/lib/relaton/xsf/item.rb
CHANGED
|
@@ -26,12 +26,12 @@ module Relaton
|
|
|
26
26
|
|
|
27
27
|
def from_xml(xml)
|
|
28
28
|
require_relative "../xsf"
|
|
29
|
-
Relaton::
|
|
29
|
+
Relaton::Xsf::Item.from_xml(xml)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def from_yaml(yaml)
|
|
33
33
|
require_relative "../xsf"
|
|
34
|
-
Relaton::
|
|
34
|
+
Relaton::Xsf::Item.from_yaml(yaml)
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def grammar_hash
|
data/lib/relaton/xsf/version.rb
CHANGED
data/lib/relaton/xsf.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-xsf
|
|
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
|
|
@@ -29,14 +30,14 @@ dependencies:
|
|
|
29
30
|
requirements:
|
|
30
31
|
- - "~>"
|
|
31
32
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 2.
|
|
33
|
+
version: 2.1.0
|
|
33
34
|
type: :runtime
|
|
34
35
|
prerelease: false
|
|
35
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
37
|
requirements:
|
|
37
38
|
- - "~>"
|
|
38
39
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 2.
|
|
40
|
+
version: 2.1.0
|
|
40
41
|
- !ruby/object:Gem::Dependency
|
|
41
42
|
name: relaton-core
|
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -88,6 +89,7 @@ files:
|
|
|
88
89
|
- lib/relaton/xsf/hit.rb
|
|
89
90
|
- lib/relaton/xsf/hit_collection.rb
|
|
90
91
|
- lib/relaton/xsf/item.rb
|
|
92
|
+
- lib/relaton/xsf/item_data.rb
|
|
91
93
|
- lib/relaton/xsf/processor.rb
|
|
92
94
|
- lib/relaton/xsf/util.rb
|
|
93
95
|
- lib/relaton/xsf/version.rb
|
|
@@ -97,6 +99,7 @@ licenses:
|
|
|
97
99
|
- BSD-2-Clause
|
|
98
100
|
metadata:
|
|
99
101
|
homepage_uri: https://github.com/relaton/relaton-xsf
|
|
102
|
+
post_install_message:
|
|
100
103
|
rdoc_options: []
|
|
101
104
|
require_paths:
|
|
102
105
|
- lib
|
|
@@ -111,7 +114,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
111
114
|
- !ruby/object:Gem::Version
|
|
112
115
|
version: '0'
|
|
113
116
|
requirements: []
|
|
114
|
-
rubygems_version: 3.
|
|
117
|
+
rubygems_version: 3.5.22
|
|
118
|
+
signing_key:
|
|
115
119
|
specification_version: 4
|
|
116
120
|
summary: 'Relaton::Xsf: retrieve ISO Standards for bibliographic use using the IsoBibliographicItem
|
|
117
121
|
model'
|