relaton-iec 0.4.3 → 0.4.4

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
  SHA1:
3
- metadata.gz: 7e32eec9580b2ce05bb78db4265203cb98c06a08
4
- data.tar.gz: 06c30a2a49f3f501084f5050b1c15f8ebc9b01c0
3
+ metadata.gz: 7b0ad75aacbf0360cdcacc6e744dd6c26e6df9f0
4
+ data.tar.gz: 847e68d1a06123dfa521d7779f5608aa0702c4fa
5
5
  SHA512:
6
- metadata.gz: 37df6854d11d3541fb485923c5ad59936b20eeb54055a2a92a4224309e8e113691bc4efe739bc3ab9fbb19ca92cbc86b50276db671a2a2f0df9d5f47ab9a1f60
7
- data.tar.gz: f29b3bc18fb7aac91e5aa1447a959aad4cb992b37dc9925d804aec687dd529a15c3e2ec3b992df06dcd04ad67af922bad0ba3b9d9a85f91331f735e142f5fceb
6
+ metadata.gz: bf0ceb4def8efe09e404c2b540700fb60709d52e184796742b6f5d7bd1e29dff3d6656201b631ecd1e50c27e6f96ec3749518eb2a82c7037c78f79102f334730
7
+ data.tar.gz: 4541bd9010a9ab99eb2a6903c03e5e07bbbc46710432bfc14d461196e8e52f81145c497294416e8b0605d66babfc6f20365d037d38a39169acb1f5d6ada7c32e
@@ -1,15 +1,15 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- relaton-iec (0.4.3)
4
+ relaton-iec (0.4.4)
5
5
  addressable
6
6
  relaton-iso-bib (~> 0.3.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.6.0)
12
- public_suffix (>= 2.0.2, < 4.0)
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
13
  byebug (11.0.1)
14
14
  coderay (1.1.2)
15
15
  crack (0.4.3)
@@ -34,12 +34,12 @@ GEM
34
34
  pry-byebug (3.7.0)
35
35
  byebug (~> 11.0)
36
36
  pry (~> 0.10)
37
- public_suffix (3.1.1)
37
+ public_suffix (4.0.1)
38
38
  rake (10.5.0)
39
- relaton-bib (0.3.5)
39
+ relaton-bib (0.3.6)
40
40
  addressable
41
- nokogiri (~> 1.10)
42
- relaton-iso-bib (0.3.4)
41
+ nokogiri
42
+ relaton-iso-bib (0.3.5)
43
43
  isoics (~> 0.1.6)
44
44
  relaton-bib (~> 0.3.0)
45
45
  ruby_deep_clone (~> 0.8.0)
@@ -1,9 +1,13 @@
1
1
  require "relaton_iec/version"
2
2
  require "relaton_iec/iec_bibliography"
3
- if defined? Relaton
4
- require_relative "relaton/processor"
5
- Relaton::Registry.instance.register(Relaton::RelatonIec::Processor)
6
- end
3
+
4
+ # if defined? Relaton
5
+ # require "relaton_iec/processor"
6
+ # # don't register the gem if it's required form relaton's registry
7
+ # return if caller.detect { |c| c.include? "register_gems" }
8
+
9
+ # Relaton::Registry.instance.register(RelatonIec::Processor)
10
+ # end
7
11
 
8
12
  module RelatonIec
9
13
  # Your code goes here...
@@ -0,0 +1,33 @@
1
+ require "relaton/processor"
2
+
3
+ module RelatonIec
4
+ class Processor < Relaton::Processor
5
+ def initialize
6
+ @short = :relaton_iec
7
+ @prefix = "IEC"
8
+ @defaultprefix = %r{^(IEC)[ /]|^IEV($| )}
9
+ @idtype = "IEC"
10
+ end
11
+
12
+ # @param code [String]
13
+ # @param date [String, NilClass] year
14
+ # @param opts [Hash]
15
+ # @return [RelatonIsoBib::IsoBibliographicItem]
16
+ def get(code, date, opts)
17
+ ::RelatonIec::IecBibliography.get(code, date, opts)
18
+ end
19
+
20
+ # @param xml [String]
21
+ # @return [RelatonIsoBib::IsoBibliographicItem]
22
+ def from_xml(xml)
23
+ RelatonIsoBib::XMLParser.from_xml xml
24
+ end
25
+
26
+ # @param hash [Hash]
27
+ # @return [RelatonIsoBib::IsoBibliographicItem]
28
+ def hash_to_bib(hash)
29
+ item_hash = ::RelatonIsoBib::HashConverter.hash_to_bib(hash)
30
+ ::RelatonIsoBib::IsoBibliographicItem.new item_hash
31
+ end
32
+ end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonIec
2
- VERSION = "0.4.3".freeze
2
+ VERSION = "0.4.4".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-20 00:00:00.000000000 Z
11
+ date: 2019-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -198,11 +198,11 @@ files:
198
198
  - appveyor.yml
199
199
  - bin/console
200
200
  - bin/setup
201
- - lib/relaton/processor.rb
202
201
  - lib/relaton_iec.rb
203
202
  - lib/relaton_iec/hit.rb
204
203
  - lib/relaton_iec/hit_collection.rb
205
204
  - lib/relaton_iec/iec_bibliography.rb
205
+ - lib/relaton_iec/processor.rb
206
206
  - lib/relaton_iec/scrapper.rb
207
207
  - lib/relaton_iec/statuses.yml
208
208
  - lib/relaton_iec/version.rb
@@ -1,23 +0,0 @@
1
- require "relaton/processor"
2
-
3
- module Relaton
4
- module RelatonIec
5
- class Processor < Relaton::Processor
6
-
7
- def initialize
8
- @short = :relaton_iec
9
- @prefix = "IEC"
10
- @defaultprefix = %r{^(IEC)[ /]|^IEV($| )}
11
- @idtype = "IEC"
12
- end
13
-
14
- def get(code, date, opts)
15
- ::RelatonIec::IecBibliography.get(code, date, opts)
16
- end
17
-
18
- def from_xml(xml)
19
- RelatonIsoBib::XMLParser.from_xml xml
20
- end
21
- end
22
- end
23
- end