relaton 0.4.0 → 0.4.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
- SHA256:
3
- metadata.gz: 00f79ee6d4b4884984fe6749a60932b026822a6355416f7620c06dbb0bc3f4e7
4
- data.tar.gz: 6cd7711482a8e44df75b278b6e0c5f19e7de48319e8cd4949c121e6ca5d8055f
2
+ SHA1:
3
+ metadata.gz: 2ca1c7dea3d3757e5dfae19c317f5c688a68b11f
4
+ data.tar.gz: e08d15f1a2743778895f749e427db6ea2b8efa0b
5
5
  SHA512:
6
- metadata.gz: cb0a9e93a381597c95513a6966d6795822dd0eca1f3fa903de22218416570ebc41f9424082bf3f79423a6e2fa23b387d34e40bb9df822118e4a2c719a7a06751
7
- data.tar.gz: fd679aacb503d9ec7ee0b6483048dda5de8fcf203a2ffd45d1f376f1fc37bf82896bc735f467579f7283ef6bae9abe2529269505ca8eef551fc968e4c95e3b71
6
+ metadata.gz: 29006cff91af9ea3358cad7d6f48906066ea2841595d67ce039172ccd1ce166abb18dbc499a549197e0f05a3ca64cece96da1882a496d6f1ddad570dd5f2599a
7
+ data.tar.gz: b6968ea0a1d63b900e703d74e433281cc924b0131613e7d2585b912dde4683fd42d2c45d268850d9bae3671c7062d00f88123c0dfbffedfb8b2651bb2bd21cf8
data/.gitignore CHANGED
@@ -7,4 +7,5 @@ testcache2
7
7
  globalcahe/
8
8
  localcahe/
9
9
  .rubocop-https---raw-githubusercontent-com-riboseinc-oss-guides-master-ci-rubocop-yml
10
- .vscode/
10
+ .vscode/
11
+ pkg/
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton (0.4.0)
4
+ relaton (0.4.1)
5
5
  algoliasearch
6
6
  relaton-gb (~> 0.5.0)
7
7
  relaton-iec (~> 0.3.0)
@@ -76,36 +76,36 @@ GEM
76
76
  pry-byebug (3.6.0)
77
77
  byebug (~> 10.0)
78
78
  pry (~> 0.10)
79
- public_suffix (3.1.0)
79
+ public_suffix (3.1.1)
80
80
  rainbow (3.0.0)
81
81
  rake (12.3.2)
82
82
  rb-fsevent (0.10.3)
83
83
  rb-inotify (0.10.0)
84
84
  ffi (~> 1.0)
85
- relaton-bib (0.2.0)
85
+ relaton-bib (0.2.3)
86
86
  addressable
87
87
  nokogiri (~> 1.8.4)
88
- relaton-gb (0.5.0)
88
+ relaton-gb (0.5.1)
89
89
  cnccs (~> 0.1.1)
90
90
  gb-agencies (~> 0.0.1)
91
91
  relaton-iso-bib (~> 0.2.0)
92
- relaton-iec (0.3.0)
92
+ relaton-iec (0.3.1)
93
93
  addressable
94
94
  relaton-iso-bib (~> 0.2.0)
95
- relaton-ietf (0.5.0)
95
+ relaton-ietf (0.5.3)
96
96
  relaton-iso-bib (~> 0.2.0)
97
- relaton-iso (0.5.0)
97
+ relaton-iso (0.5.1)
98
98
  algoliasearch
99
99
  relaton-iec (~> 0.3.0)
100
100
  relaton-iso-bib (~> 0.2.0)
101
- relaton-iso-bib (0.2.0)
101
+ relaton-iso-bib (0.2.3)
102
102
  isoics (~> 0.1.6)
103
103
  nokogiri (~> 1.8.4)
104
104
  relaton-bib (~> 0.2.0)
105
105
  ruby_deep_clone (~> 0.8.0)
106
- relaton-itu (0.2.0)
106
+ relaton-itu (0.2.1)
107
107
  relaton-iso-bib (~> 0.2.0)
108
- relaton-nist (0.2.0)
108
+ relaton-nist (0.2.1)
109
109
  relaton-bib (~> 0.2.0)
110
110
  rspec (3.8.0)
111
111
  rspec-core (~> 3.8.0)
data/lib/relaton/db.rb CHANGED
@@ -42,16 +42,16 @@ module Relaton
42
42
  check_bibliocache(code, year, opts, stdclass)
43
43
  end
44
44
 
45
- # def fetch_std(code, year = nil, stdclass = nil, opts = {})
46
- # std = nil
47
- # @registry.processors.each do |name, processor|
48
- # std = name if processor.prefix == stdclass
49
- # end
50
- # unless std
51
- # std = standard_class(code) or return nil
52
- # end
53
- # check_bibliocache(code, year, opts, std)
54
- # end
45
+ def fetch_std(code, year = nil, stdclass = nil, opts = {})
46
+ std = nil
47
+ @registry.processors.each do |name, processor|
48
+ std = name if processor.prefix == stdclass
49
+ end
50
+ unless std
51
+ std = standard_class(code) or return nil
52
+ end
53
+ check_bibliocache(code, year, opts, std)
54
+ end
55
55
 
56
56
  # def fetched(key)
57
57
  # return @local_db.fetched key if @local_db
@@ -1,3 +1,3 @@
1
1
  module Relaton
2
- VERSION = "0.4.0".freeze
2
+ VERSION = "0.4.1".freeze
3
3
  end
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -8,7 +8,7 @@ RSpec.describe Relaton::DbCache do
8
8
  Relaton::DbCache.init_bib_caches(global_cache: true, local_cache: "", flush_caches: true)
9
9
  expect(File.exist?(File.expand_path("~/.relaton"))).to be true
10
10
  expect(File.exist?("relaton")).to be true
11
- FileUtils.mv "relaton1", File.expand_path("~/.relaton")
11
+ FileUtils.mv "relaton1", File.expand_path("~/.relaton") if File.exist? "relaton1"
12
12
  end
13
13
 
14
14
  # it "returns fetched" do
@@ -32,7 +32,7 @@ RSpec.describe Relaton::Db do
32
32
  VCR.use_cassette "19133_2005" do
33
33
  bib = @db.fetch("ISO 19133:2005")
34
34
  expect(bib).to be_instance_of RelatonIsoBib::IsoBibliographicItem
35
- expect(bib.to_xml).to include "<bibitem id=\"ISO19133-2005\">"
35
+ expect(bib.to_xml).to include "<bibitem id=\"ISO19133-2005\" type=\"standard\">"
36
36
  testcache = Relaton::DbCache.new "testcache"
37
37
  expect(testcache.valid_entry?("ISO(ISO 19133:2005)", "2019")).to eq Date.today.year.to_s
38
38
  end