relaton-itu 1.2.0 → 1.3.0

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: 731a09736ad5aadeb53f70290bc4e7e03679360d419f9f1227327d6a3f0b4b06
4
- data.tar.gz: e7b7a3a1d60722e150de1cee48bed3843a0759fe1110cf454d4a468449828509
3
+ metadata.gz: b7ea346c3346b49aa11d8537809895a14ade4b648f9953371988c705e64c6081
4
+ data.tar.gz: 59d9fe418c8e54dd1bc678c42efe35650d1c99ffee0c05211ca4b29931f01c25
5
5
  SHA512:
6
- metadata.gz: ad25807e4727e037d2dce85b4e6f9324948fe0a620462c9d4daddabd8deadc12d157d290a1206748d6ff05a2bf27a9ccd832cb801ce4ccf009c645110ab54eb3
7
- data.tar.gz: 42adeed13d2531f34b3c9809028a58f2d2b3b2d1642a188d6425bd30bc5a79d4a00e9946c2af34427851a1554c70dc54eca65821efc1c66015403aece9d9a835
6
+ metadata.gz: 258db28aa9f3b4caf297881d47a3fca89e64b82d603712cfeefb450123219337ac59530b251356b87a7c5561fc0df0769ea59bb7e7b2ab894e845df01073bf3a
7
+ data.tar.gz: 6d5155965ed3aa9fc63e1feabde2557b171c5826c5078dcd5eee83602f2f5591a82542bf38f88f1418373f8f58691eeb6e9ab1881b1c7c18bebe9a2035ba6c4c
@@ -29,4 +29,5 @@ jobs:
29
29
  bundle install --jobs 4 --retry 3
30
30
  - name: Run specs
31
31
  run: |
32
+ unset JAVA_TOOL_OPTIONS
32
33
  bundle exec rake
@@ -5,6 +5,6 @@
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
7
  AllCops:
8
- TargetRubyVersion: 2.3
8
+ TargetRubyVersion: 2.4
9
9
  Rails:
10
- Enabled: true
10
+ Enabled: false
@@ -26,7 +26,7 @@ module RelatonItu
26
26
  end
27
27
 
28
28
  # @param builder [Nokogiri::XML::Builder]
29
- def to_xml(builder)
29
+ def to_xml(builder) # rubocop:disable Metrics/AbcSize
30
30
  builder.editorialgroup do
31
31
  builder.bureau bureau
32
32
  builder.group { |b| group.to_xml b } if group
@@ -43,5 +43,17 @@ module RelatonItu
43
43
  hash["workgroup"] = workgroup.to_hash if workgroup
44
44
  hash
45
45
  end
46
+
47
+ # @param prefix [String]
48
+ # @return [String]
49
+ def to_asciibib(prefix) # rubocop:disable Metrics/AbcSize
50
+ pref = prefix.empty? ? prefix : prefix + "."
51
+ pref += "editorialgroup"
52
+ out = "#{pref}.bureau:: #{bureau}\n"
53
+ out += group.to_asciibib "#{pref}.group" if group
54
+ out += subgroup.to_asciibib "#{pref}.subgroup" if subgroup
55
+ out += workgroup.to_asciibib "#{pref}.workgroup" if workgroup
56
+ out
57
+ end
46
58
  end
47
59
  end
@@ -15,7 +15,7 @@ module RelatonItu
15
15
  return unless ret[:structuredidentifier]
16
16
 
17
17
  ret[:structuredidentifier] = StructuredIdentifier.new(
18
- ret[:structuredidentifier],
18
+ ret[:structuredidentifier]
19
19
  )
20
20
  end
21
21
  end
@@ -9,12 +9,10 @@ module RelatonItu
9
9
 
10
10
  # @params structuredidentifier [RelatonItu::StructuredIdentifier]
11
11
  def initialize(**args)
12
- # @doctype = args.delete :doctype
13
12
  if args[:doctype] && !TYPES.include?(args[:doctype])
14
13
  warn "[relaton-itu] WARNING: invalid doctype: #{args[:doctype]}"
15
14
  end
16
15
  super
17
- # @doctype = args[:doctype]
18
16
  end
19
17
  end
20
18
  end
@@ -67,14 +67,6 @@ module RelatonItu
67
67
  nil
68
68
  end
69
69
 
70
- # def fetch_pages(hits, threads)
71
- # workers = RelatonBib::WorkersPool.new threads
72
- # workers.worker { |w| { i: w[:i], hit: w[:hit].fetch } }
73
- # hits.each_with_index { |hit, i| workers << { i: i, hit: hit } }
74
- # workers.end
75
- # workers.result.sort_by { |a| a[:i] }.map { |x| x[:hit] }
76
- # end
77
-
78
70
  def search_filter(code)
79
71
  docidrx = %r{\w+\.\d+|\w\sSuppl\.\s\d+} # %r{^ITU-T\s[^\s]+}
80
72
  c = code.sub(/Imp\s?/, "").match(docidrx).to_s
@@ -28,6 +28,16 @@ module RelatonItu
28
28
  hash["finish"] = finish if finish
29
29
  hash
30
30
  end
31
+
32
+ # @param prefix [String]
33
+ # @return [String]
34
+ def to_asciibib(prefix)
35
+ pref = prefix.empty? ? prefix : prefix + "."
36
+ pref += "period"
37
+ out = "#{pref}.start:: #{start}\n"
38
+ out += "#{pref}.finish:: #{finish}\n" if finish
39
+ out
40
+ end
31
41
  end
32
42
 
33
43
  TYPES = %w[tsag study-group work-group].freeze
@@ -72,5 +82,16 @@ module RelatonItu
72
82
  hash["period"] = period.to_hash if period
73
83
  hash
74
84
  end
85
+
86
+ # @param prefix [String]
87
+ # @return [String]
88
+ def to_asciibib(prefix)
89
+ pref = prefix.empty? ? prefix : prefix + "."
90
+ out = "#{pref}name:: #{name}\n"
91
+ out += "#{pref}type:: #{type}\n" if type
92
+ out += "#{pref}acronym:: #{acronym}\n" if acronym
93
+ out += period.to_asciibib prefix if period
94
+ out
95
+ end
75
96
  end
76
97
  end
@@ -34,6 +34,16 @@ module RelatonItu
34
34
  hash
35
35
  end
36
36
 
37
+ # @param prefix [String]
38
+ # @return [String]
39
+ def to_asciibib(prefix)
40
+ pref = prefix.empty? ? prefix : prefix + "."
41
+ pref += "structuredidentifier"
42
+ out = "#{pref}.bureau:: #{bureau}\n#{pref}.docnumber:: #{docnumber}\n"
43
+ out += "#{pref}.annexid:: #{annexid}\n" if annexid
44
+ out
45
+ end
46
+
37
47
  def presence?
38
48
  true
39
49
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "1.2.0".freeze
2
+ VERSION = "1.3.0".freeze
3
3
  end
@@ -37,5 +37,5 @@ Gem::Specification.new do |spec|
37
37
  spec.add_development_dependency "vcr", "~> 5.0.0"
38
38
  spec.add_development_dependency "webmock"
39
39
 
40
- spec.add_dependency "relaton-bib", "~> 1.2.0"
40
+ spec.add_dependency "relaton-bib", "~> 1.3.0"
41
41
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-06-26 00:00:00.000000000 Z
11
+ date: 2020-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 1.2.0
159
+ version: 1.3.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 1.2.0
166
+ version: 1.3.0
167
167
  description: 'RelatonItu: retrieve ITU Standards for bibliographic use using the BibliographicItem
168
168
  model'
169
169
  email: