relaton-ieee 1.11.0 → 1.11.3

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: 26b97a44379b5aec10066301f3fb0c41c2fead4117a42d1142a24d6c6b524854
4
- data.tar.gz: e35e4ddf09d1f8d70c12a191fd9435166dc33fd31bfb446816befed9ee617574
3
+ metadata.gz: 205eda20b73d53acb35dc384d63032fffb8766e35d0589d71b2b9a178f695e8b
4
+ data.tar.gz: 73f78d3e92cc774dccb04358cd69729ad55ddb8b4b000126a30ebe372de52233
5
5
  SHA512:
6
- metadata.gz: 88017c27ee3d56b1bee97059f6524c9c3264fe6f0fc79208da003ad13ad57ee386bc7e15812a5a56615ea209d6cc144af6abc0142fb76aae03c9eff22e6cafa6
7
- data.tar.gz: 2855561c0a523670ab89da09599144c287cdaea316030f565fa25d89fe65278d41642385322e5aad7573c1d64ec86ef7ae104c494f49126dd14a0a4427e098f3
6
+ metadata.gz: d18696607cb50fbac2a1ed2b9110c1e25832373dce9e8f50672aef215c8d62c4c7380dc76ed6b14c792364fb286d304c6a6c898cdfbb741614e7dbda301d17c1
7
+ data.tar.gz: 1c6550e0cb2f14cff7e5f160d4f1cd1bfafb5719d2878e79fca7a13f209c91d431d9f38b8a0d95b9928dd94716fd0d73d1a261949ca0c66fee716dd189748a46
@@ -10,27 +10,4 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@v2
24
- with:
25
- submodules: true
26
-
27
- # https://github.com/ruby-debug/debase/issues/89#issuecomment-686827382
28
- - if: matrix.os == 'macos-latest' && matrix.ruby == '2.5'
29
- run: echo BUNDLE_BUILD__DEBASE="--with-cflags=\"-Wno-error=implicit-function-declaration\"" >> $GITHUB_ENV
30
-
31
- - uses: ruby/setup-ruby@v1
32
- with:
33
- ruby-version: ${{ matrix.ruby }}
34
- bundler-cache: true
35
-
36
- - run: bundle exec rake
13
+ uses: relaton/support/.github/workflows/rake.yml@master
data/.rubocop.yml CHANGED
@@ -7,6 +7,6 @@ require: rubocop-rails
7
7
  inherit_from:
8
8
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 2.6
11
11
  Rails:
12
12
  Enabled: false
@@ -96,7 +96,7 @@ module RelatonIeee
96
96
  warn "Empty file: #{filename}"
97
97
  return
98
98
  end
99
- stdid = doc.at("./publicationinfo/standard_id").text
99
+ stdid = doc.at("./publicationinfo/standard_id")&.text
100
100
  if stdid == "0"
101
101
  # nt = doc&.at("./normtitle")&.text
102
102
  # ntid = @normtitles.index nt
@@ -196,11 +196,12 @@ module RelatonIeee
196
196
  #
197
197
  # @return [RelatonBib::DocumentRelation]
198
198
  #
199
- def create_relation(type, fref)
199
+ def create_relation(type, fref) # rubocop:disable Metrics/MethodLength
200
200
  return if RELATION_TYPES[type] == false
201
201
 
202
202
  fr = RelatonBib::FormattedRef.new(content: fref)
203
- bib = IeeeBibliographicItem.new formattedref: fr
203
+ docid = RelatonBib::DocumentIdentifier.new(type: "IEEE", id: fref, primary: true)
204
+ bib = IeeeBibliographicItem.new formattedref: fr, docid: [docid]
204
205
  desc = RELATION_TYPES[type][:description]
205
206
  description = desc && RelatonBib::FormattedString.new(content: desc, language: "en", script: "Latn")
206
207
  RelatonBib::DocumentRelation.new(
@@ -190,7 +190,7 @@ module RelatonIeee
190
190
  # @return [Array<RelatonBib::FormattedString>]
191
191
  #
192
192
  def parse_abstract
193
- doc.xpath("./volume/article/articleinfo/abstract").map do |a|
193
+ doc.xpath("./volume/article/articleinfo/abstract")[0...1].map do |a|
194
194
  RelatonBib::FormattedString.new(
195
195
  content: a.text, language: "en", script: "Latn",
196
196
  )
@@ -20,13 +20,22 @@ module RelatonIeee
20
20
  query = reference.gsub("/", " ")
21
21
  resp = Faraday.post url, { action: "ieee_cloudsearch", q: query }
22
22
  json = JSON.parse resp.body
23
- html = Nokogiri::HTML json["html"]
24
- @array = html.xpath("//h4/a").reduce([]) do |s, hit|
25
- ref = hit.text.strip
26
- /^(?:\w+\s)?(?<code2>[A-Z\d.]+)(?:-(?<year>\d{4}))?/ =~ ref
23
+ # html = Nokogiri::HTML json["html"]
24
+ # @array = html.xpath("//h4/a").reduce([]) do |s, hit|
25
+ @array = json["results"]["hits"]["hit"].reduce([]) do |s, hit|
26
+ flds = hit["fields"]
27
+ # ref = hit.text.strip
28
+ # /^(?:\w+\s)?(?<code2>[A-Z\d.]+)(?:-(?<year>\d{4}))?/ =~ ref
29
+ /^(?:\w+\s)?(?<code2>[A-Z\d.]+)(?:-(?<year>\d{4}))?/ =~ flds["meta_designation_l"]
27
30
  next s unless code2 && code1 =~ %r{^#{code2}}
28
31
 
29
- hit_data = { ref: ref, year: year.to_i, url: hit[:href] }
32
+ hit_data = {
33
+ ref: flds["meta_designation_l"],
34
+ # title: flds["meta_title_t"],
35
+ # abstract: flds["meta_description_l"],
36
+ year: year.to_i,
37
+ url: flds["doc_id_l"],
38
+ }
30
39
  s << Hit.new(hit_data, self)
31
40
  end.sort_by { |h| h.hit[:year].to_s + h.hit[:url] }.reverse
32
41
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonIeee
2
- VERSION = "1.11.0".freeze
2
+ VERSION = "1.11.3".freeze
3
3
  end
data/relaton_ieee.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  "use using the IeeeBibliographicItem model"
15
15
  spec.homepage = "https://github.com/relaton/relaton-ieee"
16
16
  spec.license = "BSD-2-Clause"
17
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
17
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
18
18
 
19
19
  # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
20
20
 
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "vcr"
38
38
  spec.add_development_dependency "webmock"
39
39
 
40
- spec.add_dependency "faraday", "~> 1.1"
40
+ spec.add_dependency "faraday", "~> 1.0"
41
41
  spec.add_dependency "relaton-bib", "~> 1.11.0"
42
42
  spec.add_dependency "rubyzip", "~> 2.3.0"
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-10 00:00:00.000000000 Z
11
+ date: 2022-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.1'
89
+ version: '1.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.1'
96
+ version: '1.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: relaton-bib
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -176,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - ">="
178
178
  - !ruby/object:Gem::Version
179
- version: 2.5.0
179
+ version: 2.6.0
180
180
  required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  requirements:
182
182
  - - ">="