relaton-jis 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac14dd89a5e207e3de88b287d2fa8a7a4b18fee184eca59e6083fc9733138c1a
4
- data.tar.gz: 6c38de3d1235a9ab8cb1a78c2aa3c8d82930049f02733923650b7c1ee3a73d3c
3
+ metadata.gz: 1a2abb23ea701fb33099e16b02eae904d3de747395444ed8286ccfd6f9078cb3
4
+ data.tar.gz: 7d161343c30d77222dde2f64b07ff71ecb9584a6cdbd9dd978dad41a323c40da
5
5
  SHA512:
6
- metadata.gz: a24537ee87d90330d588c1e7018b211af83973c94c90dad55cc28825f625d8aa20fd6a6ddc086771e7b05076f3f2310d9ac22bd6c1fdfe4343fae631da10bd6e
7
- data.tar.gz: 7fecb2b10ff53ae3bfefcfa75bfe91d059c641a7eaef69ebf73d6530801287625904876b493e5e3b2099d58ecd36730a3bc72d1c67190c132f879cb144f74f03
6
+ metadata.gz: f86fad4a0b3e2eb96d06d0311313fd02a2ea277aa0f09e93551dd1f7f688ff34366249d52d3e45689b740fb579738d7d55edc6e8a5196fafbc39660862ee5a3d
7
+ data.tar.gz: 103cff93037c28424ed9e665488d1f0accfe0fa79e9e37e5374d7ee8424a4a70fd638f72257e8d35b279c17585071d5523fd42e2bc4887fb60443a9cd19d81df
data/CLAUDE.md CHANGED
@@ -55,3 +55,7 @@ All classes live under `lib/relaton/jis/`:
55
55
  - All files use `# frozen_string_literal: true`
56
56
  - Linting follows [Ribose OSS style](https://github.com/riboseinc/oss-guides); target Ruby 3.1
57
57
  - Ruby >= 3.1.0 required
58
+
59
+ ## Testing
60
+
61
+ - **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-jis.
data/Gemfile CHANGED
@@ -6,13 +6,13 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
-
10
9
  gem "rspec", "~> 3.0"
11
10
 
12
11
  gem "rubocop", "~> 1.48"
13
12
  gem "rubocop-performance", "~> 1.11"
14
13
  gem "rubocop-rails", "~> 2.12"
15
14
 
15
+
16
16
  gem "equivalent-xml", "~> 0.6"
17
17
  gem "ruby-jing"
18
18
  gem "simplecov", "~> 0.21"
data/README.adoc CHANGED
@@ -170,6 +170,8 @@ RelatonJis uses the relaton-logger gem for logging. By default, it logs to STDOU
170
170
 
171
171
  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.
172
172
 
173
+ 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-jis[relaton-data-jis] repository.
174
+
173
175
  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).
174
176
 
175
177
  == Contributing
data/Rakefile CHANGED
@@ -10,3 +10,25 @@ require "rubocop/rake_task"
10
10
  RuboCop::RakeTask.new
11
11
 
12
12
  task default: :spec
13
+
14
+ namespace :spec do
15
+ desc "Download latest JIS index fixture from relaton-data-jis"
16
+ task :update_index do
17
+ require "net/http"
18
+ require "uri"
19
+
20
+ url = "https://raw.githubusercontent.com/relaton/relaton-data-jis/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
- <ref name="revision-date">
2019
- <a:documentation>The date at which the current version of the bibliographic item was produced</a:documentation>
2020
- </ref>
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">
@@ -1,6 +1,7 @@
1
1
  module Relaton
2
2
  module Jis
3
3
  class Bibdata < Item
4
+ model ItemData
4
5
  include Bib::BibdataShared
5
6
  end
6
7
  end
@@ -1,6 +1,7 @@
1
1
  module Relaton
2
2
  module Jis
3
3
  class Bibitem < Item
4
+ model ItemData
4
5
  include Bib::BibitemShared
5
6
  end
6
7
  end
@@ -4,13 +4,10 @@ require_relative "structured_identifier"
4
4
  module Relaton
5
5
  module Jis
6
6
  class Ext < Iso::Ext
7
- attribute :schema_version, method: :get_schema_version
8
7
  attribute :doctype, Doctype
9
8
  attribute :structuredidentifier, StructuredIdentifier
10
9
 
11
- def get_schema_version
12
- Relaton.schema_versions["relaton-model-jis"]
13
- end
10
+ def get_schema_version = Relaton.schema_versions["relaton-model-jis"]
14
11
  end
15
12
  end
16
13
  end
@@ -4,23 +4,19 @@ require_relative "item_data"
4
4
 
5
5
  module Relaton
6
6
  module Jis
7
+ class Relation < Bib::Relation
8
+ end
9
+
7
10
  class Item < Iso::Item
8
11
  model ItemData
9
12
 
10
13
  attribute :docidentifier, Docidentifier,
11
14
  collection: true, initialize_empty: true
15
+ attribute :relation, Relation,
16
+ collection: true, initialize_empty: true
12
17
  attribute :ext, Ext
13
18
  end
14
19
  end
15
20
  end
16
21
 
17
22
  require_relative "relation"
18
-
19
- module Relaton
20
- module Jis
21
- class Item
22
- attribute :relation, Relation,
23
- collection: true, initialize_empty: true
24
- end
25
- end
26
- end
@@ -1,11 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "docidentifier"
4
+
3
5
  module Relaton
4
6
  module Jis
5
- class ItemBase < Item
7
+ class ItemBase < Lutaml::Model::Serializable
8
+ include Bib::NamespaceHelper
9
+
10
+ attr_accessor :type
11
+
6
12
  model ItemData
7
13
 
8
- include Bib::ItemBaseAttributes
14
+ instance_exec(&Bib::ItemShared::ATTRIBUTES)
15
+ attribute :docidentifier, Docidentifier,
16
+ collection: true, initialize_empty: true
17
+ attribute :relation, Relation,
18
+ collection: true, initialize_empty: true
19
+
20
+ xml do
21
+ map_attribute "type", to: :type
22
+ instance_exec(&Bib::ItemShared::XML_BODY)
23
+ end
9
24
  end
10
25
  end
11
26
  end
@@ -4,7 +4,7 @@ require_relative "item_base"
4
4
 
5
5
  module Relaton
6
6
  module Jis
7
- class Relation < Bib::Relation
7
+ class Relation
8
8
  attribute :bibitem, ItemBase
9
9
  end
10
10
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Relaton
4
4
  module Jis
5
- VERSION = "2.0.0"
5
+ VERSION = "2.1.0"
6
6
  end
7
7
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_dependency "mechanize", "~> 2.10"
38
38
  spec.add_dependency "relaton-core", "~> 0.0.13"
39
39
  spec.add_dependency "relaton-index", "~> 0.2.0"
40
- spec.add_dependency "relaton-iso", "~> 2.0.0"
40
+ spec.add_dependency "relaton-iso", "~> 2.1.0"
41
41
 
42
42
  # For more information and examples about making a new gem, check out our
43
43
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
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: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-05-04 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: mechanize
@@ -57,14 +58,14 @@ dependencies:
57
58
  requirements:
58
59
  - - "~>"
59
60
  - !ruby/object:Gem::Version
60
- version: 2.0.0
61
+ version: 2.1.0
61
62
  type: :runtime
62
63
  prerelease: false
63
64
  version_requirements: !ruby/object:Gem::Requirement
64
65
  requirements:
65
66
  - - "~>"
66
67
  - !ruby/object:Gem::Version
67
- version: 2.0.0
68
+ version: 2.1.0
68
69
  description: 'Relaton::Jis: retrieve IETF Standards for bibliographic use using the
69
70
  BibliographicItem model'
70
71
  email:
@@ -104,13 +105,14 @@ files:
104
105
  - lib/relaton/jis/structured_identifier.rb
105
106
  - lib/relaton/jis/util.rb
106
107
  - lib/relaton/jis/version.rb
107
- - relaton_jis.gemspec
108
+ - relaton-jis.gemspec
108
109
  - sig/relaton_jis.rbs
109
110
  homepage: https://github.com/relaton/relaton-jis
110
111
  licenses:
111
112
  - MIT
112
113
  metadata:
113
114
  homepage_uri: https://github.com/relaton/relaton-jis
115
+ post_install_message:
114
116
  rdoc_options: []
115
117
  require_paths:
116
118
  - lib
@@ -125,7 +127,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
127
  - !ruby/object:Gem::Version
126
128
  version: '0'
127
129
  requirements: []
128
- rubygems_version: 3.6.9
130
+ rubygems_version: 3.5.22
131
+ signing_key:
129
132
  specification_version: 4
130
133
  summary: 'Relaton::Jis: retrieve IETF Standards for bibliographic use using the BibliographicItem
131
134
  model'