relaton-plateau 1.19.0 → 1.19.1

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: ae5d826317709e8c18d51a8b92a78a12b213d22c0f9d9dc215edbec03e9edea4
4
+ data.tar.gz: 5c8e0509587c6c6cdba671fbb6d44af70df2b8c60576be9800bfd16d7b1517c4
5
5
  SHA512:
6
- metadata.gz: d65e27275dca1182ba55a3df9477d8d894e5e206ab83c59d66e83fad18b3eede7785bdb530af29c4b071a01b1d70061cccee78f3a5b2837a84e79e481992c1de
7
- data.tar.gz: 4e7bca8756f84e820a1ebca666a8e950e901428f33ca6dfa66fb1140f2f07dba2858023e89dc38394cf5014e21fb8b4cafa4e11cede06f0661e67b37a8a47226
6
+ metadata.gz: dd8ce7ce303cdb163bc0ff9a3c70b948d15f8d69051d37d1f2a77f449eab95addba439d898600c038457b7aa94b43ab80e271fafee224044029c87971ad406aa
7
+ data.tar.gz: 1909f32fe4006048df00982c4ff6e1560c0dcf2cdf9fe40087cf1200e6482b14cd86ddcf92486f913d873c241d36c77e63b7fd70bad5107fbb2b7d06a187140b
@@ -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
@@ -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.1"
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.1
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-26 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