relaton 0.2.4 → 0.2.5

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: 7572658c834a43892700846acb448ed8c15573ec5a3b748f947464cb086ed9c4
4
- data.tar.gz: bef8f6f331b769fd2e0f719eb41223c43ab19045ec7f180b2539a871abf550de
3
+ metadata.gz: 0c1beef6d057ce75ecd9f18f02d3ce887bf9c8d259c0ac7d159f24d8584134c3
4
+ data.tar.gz: 62db2b47dae11069a14dc8eb83dcc62090aec6a4d586508d00cf81736d9492a1
5
5
  SHA512:
6
- metadata.gz: c2ef0a6645e2b806d8e9a36247ec50646776cc01c35d6aa19da254c1095d2f944b83635f265667ea7572cc4c174f163713478f75473a81d90c6f2d8cc253b391
7
- data.tar.gz: 104efaea9d07bcb9cae61cad2077ac7a3e404aafd66cb618d7369048e508c08a0a8dbc5c12f466b933a751d40a62c592840f23a0ee8c716566903a809e4de472
6
+ metadata.gz: 83a73440d1eb4f63c12e33d296075a7e46759db37bafe40bda57369d6786202e57eb17426f4975d1c1b005fa7dab76fa06996ecc538f608060f269625605a3b0
7
+ data.tar.gz: e1e8ab5afcb76904239547bbbdc4dca80a3e8dd0b2ca7040f721487970224c010b5e50b2357b9a8121a6147c05091d2babed9745c8b626cd282199b6849f21b0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton (0.2.3)
4
+ relaton (0.2.5)
5
5
  algoliasearch
6
6
  gbbib (~> 0.3.1)
7
7
  iecbib (~> 0.1.1)
@@ -47,7 +47,7 @@ GEM
47
47
  guard-compat (~> 1.1)
48
48
  rspec (>= 2.99.0, < 4.0)
49
49
  httpclient (2.8.3)
50
- iecbib (0.1.1)
50
+ iecbib (0.1.2)
51
51
  addressable
52
52
  iso-bib-item (~> 0.3.0)
53
53
  ietfbib (0.4.1)
@@ -105,7 +105,7 @@ GEM
105
105
  diff-lcs (>= 1.2.0, < 2.0)
106
106
  rspec-support (~> 3.8.0)
107
107
  rspec-support (3.8.0)
108
- rubocop (0.59.1)
108
+ rubocop (0.59.2)
109
109
  jaro_winkler (~> 1.5.1)
110
110
  parallel (~> 1.10)
111
111
  parser (>= 2.5, != 2.5.1.1)
data/lib/relaton/db.rb CHANGED
@@ -41,6 +41,17 @@ module Relaton
41
41
  check_bibliocache(code, year, opts, stdclass)
42
42
  end
43
43
 
44
+ def fetch_std(code, year = nil, stdclass = nil, opts = {})
45
+ std = nil
46
+ @registry.processors.each do |name, processor|
47
+ std = name if processor.prefix == stdclass
48
+ end
49
+ unless std
50
+ std = standard_class(code) or return nil
51
+ end
52
+ check_bibliocache(code, year, opts, std)
53
+ end
54
+
44
55
  # The document identifier class corresponding to the given code
45
56
  def docid_type(code)
46
57
  stdclass = standard_class(code) or return [nil, code]
@@ -1,3 +1,3 @@
1
1
  module Relaton
2
- VERSION = "0.2.4".freeze
2
+ VERSION = "0.2.5".freeze
3
3
  end
@@ -1,10 +1,11 @@
1
1
  require "spec_helper"
2
+ require "fileutils"
2
3
 
3
4
  RSpec.describe Relaton::Db do
4
5
  # let!(:db) { Relaton::Db.new("testcache", "testcache2") }
5
6
 
6
7
  before :each do
7
- system "rm testcache testcache2"
8
+ FileUtils.rm_f %w(testcache testcache2)
8
9
  @db = Relaton::Db.new "testcache", "testcache2"
9
10
  end
10
11
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-22 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: algoliasearch