relaton-plateau 1.19.0 → 1.19.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b586efb3d3b6188375642c4114578d2f04a60333442fbf0e5340ba6a68b1edee
4
- data.tar.gz: 30d4e809336062273b5969cac328ee5fe28eec96c287991d2f27422666cc1291
3
+ metadata.gz: 9e95b332f0144bd7af6816a2854082c34ba658ca7f0cc593e05a046be13ed44c
4
+ data.tar.gz: 2a69c3e8a2c0cde1603f4eadcb3f078b14a4b01970c28bf43edcdffb47ca034b
5
5
  SHA512:
6
- metadata.gz: d65e27275dca1182ba55a3df9477d8d894e5e206ab83c59d66e83fad18b3eede7785bdb530af29c4b071a01b1d70061cccee78f3a5b2837a84e79e481992c1de
7
- data.tar.gz: 4e7bca8756f84e820a1ebca666a8e950e901428f33ca6dfa66fb1140f2f07dba2858023e89dc38394cf5014e21fb8b4cafa4e11cede06f0661e67b37a8a47226
6
+ metadata.gz: 38f9bbd18d7ee0d63a9c0bdf25882af04004f863576a1999bf0f09d13effef3508c2acbe50cfbc9d3bafdcfd45fb91d688e5f328081427913969c21c1570ce05
7
+ data.tar.gz: 8e9bc8e67859ec617f302d1b080646be8e4157729619f71ee3e2fe3005984249ba36674fe48df663f444f0d06f3eb90ff0d7755107b11c8f966a0c8e149e6b3c
data/README.adoc CHANGED
@@ -6,11 +6,11 @@ image:https://github.com/relaton/relaton-plateau/workflows/windows/badge.svg["Bu
6
6
  image:https://github.com/relaton/relaton-plateau/workflows/ubuntu/badge.svg["Build Status (Ubuntu)", link="https://github.com/relaton/relaton-plateau/actions?workflow=ubuntu"]
7
7
  image:https://codeclimate.com/github/relaton/relaton-plateau/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-plateau"]
8
8
  image:https://img.shields.io/github/issues-pr-raw/relaton/relaton-plateau.svg["Pull Requests", link="https://github.com/relaton/relaton-plateau/pulls"]
9
- image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton/releases"]
9
+ image:https://img.shields.io/github/commits-since/relaton/relaton/latest.svg["Commits since latest",link="https://github.com/relaton/relaton-plateau/releases"]
10
10
 
11
- RelatonPlateau is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-plateau#iso-bibliographic-item[IsoBibliographicItem model].
11
+ RelatonPlateau is a Ruby gem that implements the https://github.com/metanorma/metanorma-model-plateau#iso-bibliographic-item[BibliographicItem model].
12
12
 
13
- You can use it to retrieve metadata of ISO Standards from https://www.iso.org, and access such metadata through the `IsoBibliographicItem` object.
13
+ You can use it to retrieve metadata of Plateau Standards from GitHub repositori, and access such metadata through the `BibliographicItem` object.
14
14
 
15
15
  == Installation
16
16
 
@@ -1204,7 +1204,9 @@
1204
1204
  <optional>
1205
1205
  <ref name="formattedref"/>
1206
1206
  </optional>
1207
- <ref name="btitle"/>
1207
+ <oneOrMore>
1208
+ <ref name="btitle"/>
1209
+ </oneOrMore>
1208
1210
  <optional>
1209
1211
  <ref name="bplace"/>
1210
1212
  </optional>
@@ -24,7 +24,7 @@ module Relaton
24
24
  end
25
25
 
26
26
  def search(code)
27
- rows = index.search(code)
27
+ rows = index.search { |r| r[:id] == code }
28
28
  return unless rows.any?
29
29
 
30
30
  row = rows.sort_by { |r| r[:id] }.last
@@ -39,18 +39,6 @@ module Relaton
39
39
  puts "Done in: #{(t2 - t1).round} sec."
40
40
  end
41
41
 
42
- # def fetch_handbooks
43
- # data = fetch_json_data(HANDBOOKS_URL)
44
- # extracted_data = extract_handbooks_data(data)
45
- # save_to_yaml(extracted_data, "handbooks.yaml")
46
- # end
47
-
48
- # def fetch_technical_reports
49
- # data = fetch_json_data(TECHNICAL_REPORTS_URL)
50
- # extracted_data = extract_technical_reports_data(data)
51
- # save_to_yaml(extracted_data, "technical_reports.yaml")
52
- # end
53
-
54
42
  # Create a GET request with custom headers to mimic a browser
55
43
  def create_request(uri)
56
44
  request = Net::HTTP::Get.new(uri)
@@ -127,22 +115,6 @@ module Relaton
127
115
  version: version, entry: entry, title_en: title_en, abstract: abstract, doctype: doctype
128
116
  ).parse
129
117
  save_document(item)
130
-
131
- # ::Relaton::Plateau::BibItem.new(
132
- # pubid: "PLATEAU Handbook ##{entry["slug"]}",
133
- # title_jp: handbook["title"],
134
- # title_en: title_en,
135
- # abstract_jp: abstract_jp,
136
- # cover: "https://www.mlit.go.jp/#{handbook["thumbnail"]["mediaItemUrl"]}",
137
- # type: document_type,
138
- # publication_date: Date.parse(version["date"].gsub(".", "-")),
139
- # url_pdf: version["pdf"],
140
- # url_html: version["html"],
141
- # filesize: version["filesize"].to_i,
142
- # edition_number: version["title"].match(/\d\.\d/)[0],
143
- # edition_text: version["title"],
144
- # # tags: [],
145
- # )
146
118
  end
147
119
  end
148
120
  index.save
@@ -156,35 +128,10 @@ module Relaton
156
128
  Util.info "Extracting technical reports data..."
157
129
  data["pageProps"]["nodes"].map do |entry|
158
130
  save_document(TechnicalReportParser.new(entry).parse)
159
-
160
- # technical_report = entry["technicalReport"]
161
-
162
- # ::Relaton::Plateau::BibItem.new(
163
- # title_jp: technical_report["title"],
164
- # abstract_jp: technical_report["subtitle"],
165
- # cover: "https://www.mlit.go.jp/#{technical_report["thumbnail"]["mediaItemUrl"]}",
166
- # pubid: "PLATEAU Tech Report ##{entry["slug"]}",
167
- # type: "technical-report",
168
- # subtype: entry["technicalReportCategories"]["nodes"].map { |cat| cat["name"] },
169
- # publication_date: Date.parse(entry["date"]),
170
- # url_pdf: technical_report["pdf"],
171
- # filesize: technical_report["filesize"].to_i,
172
- # edition_number: "1.0",
173
- # edition_text: "1.0",
174
- # tags: entry["globalTags"]["nodes"].map { |tag| tag["name"] },
175
- # )
176
-
177
131
  end
178
132
  index.save
179
133
  end
180
134
 
181
- # def self.save_to_yaml(data, filename)
182
- # File.open(filename, "w") do |file|
183
- # file.write(data.to_yaml)
184
- # end
185
- # puts "Data saved to #{filename}."
186
- # end
187
-
188
135
  def save_document(item)
189
136
  id = item.docidentifier.first.id
190
137
  file = file_name id
@@ -2,7 +2,7 @@ module Relaton
2
2
  module Plateau
3
3
  class Parser
4
4
  ATTRIS = %i[docid title abstract cover edition type doctype subdoctype
5
- date link filesize keyword structuredidentifier].freeze
5
+ date link contributor filesize keyword structuredidentifier].freeze
6
6
 
7
7
  def initialize(item)
8
8
  @item = item
@@ -53,6 +53,19 @@ module Relaton
53
53
  def parse_date; [] end
54
54
  def parse_link; [] end
55
55
 
56
+ def parse_contributor
57
+ name = [
58
+ { content: "国土交通省都市局", language: "ja", script: "Jpan" },
59
+ {
60
+ content: "Japanese Ministry of Land, Infrastructure, Transport and Tourism",
61
+ language: "en",
62
+ script: "Latn"
63
+ }
64
+ ]
65
+ org = RelatonBib::Organization.new(name: name, abbreviation: "MLIT")
66
+ [RelatonBib::ContributionInfo.new(entity: org, role: [type: "publisher"])]
67
+ end
68
+
56
69
  def create_date(date, type = "published")
57
70
  RelatonBib::BibliographicDate.new(type: type, on: date)
58
71
  end
@@ -9,7 +9,7 @@ module Relaton
9
9
  private
10
10
 
11
11
  def parse_docid
12
- super << create_docid("PLATEAU Tech Report ##{@entry["slug"]}")
12
+ super << create_docid("PLATEAU Technical Report ##{@entry["slug"]}")
13
13
  end
14
14
 
15
15
  def parse_abstract
@@ -46,7 +46,7 @@ module Relaton
46
46
 
47
47
  def parse_structuredidentifier
48
48
  strid = RelatonBib::StructuredIdentifier.new(
49
- type: "Tech Report", class: parse_subdoctype, agency: ["PLATEAU"], docnumber: @entry["slug"]
49
+ type: "Technical Report", class: parse_subdoctype, agency: ["PLATEAU"], docnumber: @entry["slug"]
50
50
  )
51
51
  RelatonBib::StructuredIdentifierCollection.new [strid]
52
52
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Relaton
4
4
  module Plateau
5
- VERSION = "1.19.0"
5
+ VERSION = "1.19.2"
6
6
  end
7
7
  end
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
24
24
  spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
25
25
 
26
26
  # spec.add_dependency "pubid", "~> 0.1.1"
27
+ spec.add_dependency "base64"
27
28
  spec.add_dependency "relaton-index", "~> 0.2.12"
28
29
  spec.add_dependency "relaton-logger", "~> 0.2.0"
29
30
  spec.add_dependency "relaton-bib", "~> 1.19.3"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-plateau
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-25 00:00:00.000000000 Z
11
+ date: 2024-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: relaton-index
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -70,11 +84,11 @@ files:
70
84
  - Rakefile
71
85
  - bin/console
72
86
  - bin/setup
73
- - grammar/basicdoc.rng
74
- - grammar/biblio-standoc.rng
75
- - grammar/biblio.rng
76
- - grammar/relaton-plateau-compile.rng
77
- - grammar/relaton-plateau.rng
87
+ - grammars/basicdoc.rng
88
+ - grammars/biblio-standoc.rng
89
+ - grammars/biblio.rng
90
+ - grammars/relaton-plateau-compile.rng
91
+ - grammars/relaton-plateau.rng
78
92
  - lib/relaton/plateau.rb
79
93
  - lib/relaton/plateau/bibitem.rb
80
94
  - lib/relaton/plateau/bibliography.rb
File without changes
File without changes
File without changes
File without changes