relaton-itu 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 +1 -0
- data/Gemfile +1 -0
- data/README.adoc +2 -0
- data/Rakefile +22 -0
- data/data.json +191429 -0
- data/grammars/biblio.rng +4 -8
- data/lib/relaton/itu/model/bibdata.rb +1 -0
- data/lib/relaton/itu/model/bibitem.rb +1 -0
- data/lib/relaton/itu/model/ext.rb +11 -3
- data/lib/relaton/itu/version.rb +1 -1
- data/{relaton_itu.gemspec → relaton-itu.gemspec} +1 -1
- metadata +10 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f99c128530261fd98b5a29679341fa049465a336b9f549b70f332fcff8a305d
|
|
4
|
+
data.tar.gz: 92628dc4cb52a75ae803db9f48b96b8dcbaa9fcf4f67542c35c69b13eecb4df6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91b754b728d5f63c288262d8b28e9ba2ec00175301f81f4fd066e85b84a3c7382dbaf2b488fa371a3624118ae65a13038c26cc44110ffcfb87d7eb9ff2b81651
|
|
7
|
+
data.tar.gz: 5ae98ea7dbe2f6cae2033aaa5176c302554c8a0e486b47f82a8fb6e4a0c99f712b5988784626c3e3e13980aa6466e6a474fc79fa501658da84c52b5502da637f
|
data/CLAUDE.md
CHANGED
|
@@ -51,6 +51,7 @@ All model classes use `Lutaml::Model::Serializable` for XML/YAML serialization:
|
|
|
51
51
|
|
|
52
52
|
## Testing
|
|
53
53
|
|
|
54
|
+
- **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-itu-r.
|
|
54
55
|
- **Framework:** RSpec with VCR cassettes for HTTP mocking and WebMock
|
|
55
56
|
- **Fixtures:** `spec/fixtures/` contains sample YAML/XML documents for round-trip tests
|
|
56
57
|
- **VCR cassettes:** `spec/vcr_cassettes/` — 22 cassettes recording real HTTP responses
|
data/Gemfile
CHANGED
data/README.adoc
CHANGED
|
@@ -183,6 +183,8 @@ RelatonItu uses the relaton-logger gem for logging. By default, it logs to STDOU
|
|
|
183
183
|
|
|
184
184
|
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.
|
|
185
185
|
|
|
186
|
+
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-itu-r[relaton-data-itu-r] repository.
|
|
187
|
+
|
|
186
188
|
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 [rubygems.org](https://rubygems.org).
|
|
187
189
|
|
|
188
190
|
== Contributing
|
data/Rakefile
CHANGED
|
@@ -4,3 +4,25 @@ require "rspec/core/rake_task"
|
|
|
4
4
|
RSpec::Core::RakeTask.new(:spec)
|
|
5
5
|
|
|
6
6
|
task :default => :spec
|
|
7
|
+
|
|
8
|
+
namespace :spec do
|
|
9
|
+
desc "Download latest ITU index fixture from relaton-data-itu-r"
|
|
10
|
+
task :update_index do
|
|
11
|
+
require "net/http"
|
|
12
|
+
require "uri"
|
|
13
|
+
|
|
14
|
+
url = "https://raw.githubusercontent.com/relaton/relaton-data-itu-r/data-v2/index-v1.zip"
|
|
15
|
+
dest = File.join(__dir__, "spec", "fixtures", "index-v1.zip")
|
|
16
|
+
|
|
17
|
+
puts "Downloading \#{url} ..."
|
|
18
|
+
uri = URI.parse(url)
|
|
19
|
+
response = Net::HTTP.get_response(uri)
|
|
20
|
+
|
|
21
|
+
if response.is_a?(Net::HTTPSuccess)
|
|
22
|
+
File.binwrite(dest, response.body)
|
|
23
|
+
puts "Updated \#{dest} (\#{response.body.bytesize} bytes)"
|
|
24
|
+
else
|
|
25
|
+
abort "Failed to download: HTTP \#{response.code}"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|