relaton-jis 1.16.8 → 1.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton_jis/bibliographic_item.rb +0 -1
- data/lib/relaton_jis/document_type.rb +16 -0
- data/lib/relaton_jis/hash_converter.rb +9 -2
- data/lib/relaton_jis/scraper.rb +7 -6
- data/lib/relaton_jis/version.rb +1 -1
- data/lib/relaton_jis.rb +1 -0
- data/relaton_jis.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c9b68164a62654ac1ab254f5b0f2e4de7b3688e06197f5afe72471e0daafb58
|
4
|
+
data.tar.gz: 3fed90b431cf65b42921e8ab55df928dbd0aeee3b65cdca8a9c39a7cf88fa78f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9a87af54a8fb0cfc6d300e00b1f0b34872810b38ed50b16febbaf852aa1431c93657e2fef0fec9e5f60fc8ccb93ece43845dd56441534fe14dd9e2f9aae11d9
|
7
|
+
data.tar.gz: 70dca481c845108906840c91c3b70c9d44e7576f26f6e695b20f375c2ea3eb84e3dc2373b7d8e567000339110b8f6e9814ce4c703383bac8e06fa63565fe6bbb
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module RelatonJis
|
2
|
+
class DocumentType < RelatonBib::DocumentType
|
3
|
+
DOCTYPES = %w[japanese-industrial-standard technical-report technical-specification amendment].freeze
|
4
|
+
|
5
|
+
def initialize(type:, abbreviation: nil)
|
6
|
+
check_type type
|
7
|
+
super
|
8
|
+
end
|
9
|
+
|
10
|
+
def check_type(type)
|
11
|
+
unless DOCTYPES.include? type
|
12
|
+
Util.warn "WARNING: invalid doctype: `#{type}`"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,9 +1,16 @@
|
|
1
1
|
module RelatonJis
|
2
|
-
|
2
|
+
module HashConverter
|
3
|
+
include RelatonBib::HashConverter
|
4
|
+
extend self
|
5
|
+
|
3
6
|
# @param item_hash [Hash]
|
4
7
|
# @return [Relaton3gpp::BibliographicItem]
|
5
|
-
def
|
8
|
+
def bib_item(item_hash)
|
6
9
|
BibliographicItem.new(**item_hash)
|
7
10
|
end
|
11
|
+
|
12
|
+
def create_doctype(**args)
|
13
|
+
DocumentType.new(**args)
|
14
|
+
end
|
8
15
|
end
|
9
16
|
end
|
data/lib/relaton_jis/scraper.rb
CHANGED
@@ -103,12 +103,13 @@ module RelatonJis
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def fetch_doctype
|
106
|
-
case document_id
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
106
|
+
type = case document_id
|
107
|
+
when /JIS\s[A-Z]\s[\w-]+:\d{4}\/AMENDMENT/ then "amendment"
|
108
|
+
when /JIS\s[A-Z]\s[\w-]+/ then "japanese-industrial-standard"
|
109
|
+
when /TR[\s\/][\w-]+/ then "technical-report"
|
110
|
+
when /TS[\s\/][\w-]+/ then "technical-specification"
|
111
|
+
end
|
112
|
+
DocumentType.new type: type
|
112
113
|
end
|
113
114
|
|
114
115
|
def fetch_ics
|
data/lib/relaton_jis/version.rb
CHANGED
data/lib/relaton_jis.rb
CHANGED
@@ -5,6 +5,7 @@ require "relaton_iso_bib"
|
|
5
5
|
require_relative "relaton_jis/version"
|
6
6
|
require_relative "relaton_jis/config"
|
7
7
|
require_relative "relaton_jis/util"
|
8
|
+
require_relative "relaton_jis/document_type"
|
8
9
|
require_relative "relaton_jis/bibliographic_item"
|
9
10
|
require_relative "relaton_jis/xml_parser"
|
10
11
|
require_relative "relaton_jis/hash_converter"
|
data/relaton_jis.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
# Uncomment to register a new dependency of your gem
|
37
37
|
spec.add_dependency "mechanize", "~> 2.8.0"
|
38
|
-
spec.add_dependency "relaton-iso-bib", "~> 1.
|
38
|
+
spec.add_dependency "relaton-iso-bib", "~> 1.17.0"
|
39
39
|
|
40
40
|
# For more information and examples about making a new gem, check out our
|
41
41
|
# guide at: https://bundler.io/guides/creating_gem.html
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relaton-jis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.17.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.17.0
|
41
41
|
description: 'RelatonJis: retrieve IETF Standards for bibliographic use using the
|
42
42
|
BibliographicItem model'
|
43
43
|
email:
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- lib/relaton_jis/bibliographic_item.rb
|
62
62
|
- lib/relaton_jis/bibliography.rb
|
63
63
|
- lib/relaton_jis/config.rb
|
64
|
+
- lib/relaton_jis/document_type.rb
|
64
65
|
- lib/relaton_jis/hash_converter.rb
|
65
66
|
- lib/relaton_jis/hit.rb
|
66
67
|
- lib/relaton_jis/hit_collection.rb
|