relaton-itu 1.14.2 → 1.14.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: 6766812ad6660d739d3d4e4c1778846119eaca063c3c5cfc34242ffca6414a6b
4
- data.tar.gz: 7c3024fc052ddd75a7c82ab1b3231834d6b0c964cf940f5fa1e2c28c0ff5c085
3
+ metadata.gz: 1bdefbc155c0b9cf2d721888b2512f09913bac76831b421b44444f94dacb4d95
4
+ data.tar.gz: d5fa79047b6e08c91c8d320c8a95de3a63668a31eac6ae4d958aff3fcb5ce312
5
5
  SHA512:
6
- metadata.gz: 76647371a1ef4b6eaf3a4f57bd8bff607dda86f63f0f928e8969d9e9a25532eb456f7781740068f094b1fa4d9b505092ff7710e5fb16b9bdbd168207abc70f23
7
- data.tar.gz: d87e9793f3802bde3d39d672c7c10900f5fd1298811bf6bb0fa129f577020c5e3cbae9d52ef5623e6d3e7933c322b2cdc555e824830cfa4707e48169fe92cd73
6
+ metadata.gz: 0ae803ee1490114fd1ed254811aa46dc67ac2b9d273f3424018a3e5cf2a34a2a11876f7281184756a9b3ff4b2541bd9aba1eebdf2c39f530f9eacffe4137c0c6
7
+ data.tar.gz: a18d437f653e9955467dd9f26946cd853c97389835b271029ff721f9c86dfd11bf775bae72cab5ab5ed957467696c3dfbe0debf76670e0499ed6cc03eebcd9ae
@@ -17,21 +17,22 @@ module RelatonItu
17
17
  # @return [Mechanize]
18
18
  attr_reader :agent
19
19
 
20
- # @param ref [String]
21
- # @param year [String]
22
- def initialize(ref, year = nil) # rubocop:todo Metrics/MethodLength
23
- text = ref.sub(/(?<=\.)Imp\s?(?=\d)/, "")
24
- super text, year
20
+ #
21
+ # @param refid [RelatonItu::Pubid] reference
22
+ #
23
+ def initialize(refid) # rubocop:todo Metrics/MethodLength
24
+ text = refid.to_ref.sub(/(?<=\.)Imp\s?(?=\d)/, "")
25
+ super text, refid.year
25
26
  @agent = Mechanize.new
26
27
  agent.user_agent_alias = "Mac Safari"
27
- @gi_imp = /\.Imp\d/.match?(ref)
28
+ @gi_imp = /\.Imp\d/.match?(refid.to_s)
28
29
  @array = []
29
30
 
30
- case ref
31
+ case refid.to_ref
31
32
  when /^(ITU-T|ITU-R\sRR)/
32
33
  request_search
33
34
  when /^ITU-R\s/
34
- request_document(ref)
35
+ request_document(refid)
35
36
  end
36
37
  end
37
38
 
@@ -44,10 +45,12 @@ module RelatonItu
44
45
  @array = hits JSON.parse(resp.body)
45
46
  end
46
47
 
47
- # @param ref [String] a document ref
48
- def request_document(ref) # rubocop:todo Metrics/MethodLength, Metrics/AbcSize
48
+ #
49
+ # @param refid [RelatonItu::Pubid] a document reference
50
+ #
51
+ def request_document(refid) # rubocop:todo Metrics/MethodLength, Metrics/AbcSize
49
52
  index = Relaton::Index.find_or_create :itu, url: "#{GH_ITU_R}index-v1.zip", file: INDEX_FILE
50
- row = index.search(ref).min_by { |i| i[:id] }
53
+ row = index.search(refid.to_ref).min_by { |i| i[:id] }
51
54
  return unless row
52
55
 
53
56
  uri = URI("#{GH_ITU_R}#{row[:file]}")
@@ -14,134 +14,139 @@ require "date"
14
14
 
15
15
  module RelatonItu
16
16
  # Class methods for search ISO standards.
17
- class ItuBibliography
18
- class << self
19
- # @param text [String]
20
- # @return [RelatonItu::HitCollection]
21
- def search(text, year = nil)
22
- # code = text.sub(/(?<=ITU-T\s\w)\.(\w+\.)(?=\d+)/, ' \1')
23
- if text =~ /(ITU-T\s\w)\.(Suppl\.|Annex)\s?(\w?\d+)/
24
- correct_ref = "#{$~[1]} #{$~[2]} #{$~[3]}"
25
- warn "[relaton-itu] WARNING: Incorrect reference #{text}"
26
- warn "[relaton-itu] the reference should be #{correct_ref}"
27
- end
28
- HitCollection.new text, year
29
- rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET,
30
- EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError,
31
- Net::ProtocolError, URI::InvalidURIError => e
32
- raise RelatonBib::RequestError, e.message
17
+ module ItuBibliography
18
+ extend self
19
+
20
+ # @param refid [RelatonItu::Pubid, String] a document reference
21
+ # @return [RelatonItu::HitCollection]
22
+ #
23
+ def search(refid)
24
+ refid = RelatonItu::Pubid.parse refid if refid.is_a? String
25
+ if refid.to_ref =~ /(ITU[\s-]T\s\w)\.(Suppl\.|Annex)\s?(\w?\d+)/
26
+ correct_ref = "#{$~[1]} #{$~[2]} #{$~[3]}"
27
+ warn "[relaton-itu] WARNING: Incorrect reference #{refid}"
28
+ warn "[relaton-itu] the reference should be #{correct_ref}"
33
29
  end
30
+ HitCollection.new refid
31
+ rescue SocketError, Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Net::HTTPBadResponse,
32
+ Net::HTTPHeaderSyntaxError, Net::ProtocolError, URI::InvalidURIError => e
33
+ raise RelatonBib::RequestError, e.message
34
+ end
34
35
 
35
- # @param code [String] the ISO standard Code to look up (e..g "ISO 9000")
36
- # @param year [String] the year the standard was published (optional)
37
- # @param opts [Hash] options; restricted to :all_parts if all-parts
38
- # reference is required
39
- # @return [String] Relaton XML serialisation of reference
40
- def get(code, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
41
- if year.nil?
42
- /^(?<code1>[^\s]+\s[^\s]+)\s\((?:\d{2}\/)?(?<year1>\d+)\)$/ =~ code
43
- unless code1.nil?
44
- code = code1
45
- year = year1
46
- end
47
- end
36
+ # def transform_ref(ref)
37
+ # ref.sub(/^ITU[\s-](\w)[\s-](?:REC[\s-])?/, 'ITU-\1')
38
+ # end
48
39
 
49
- code += "-1" if opts[:all_parts]
50
- ret = itubib_get1(code, year, opts)
51
- return nil if ret.nil?
40
+ # @param code [String] the ISO standard Code to look up (e..g "ISO 9000")
41
+ # @param year [String] the year the standard was published (optional)
42
+ # @param opts [Hash] options; restricted to :all_parts if all-parts
43
+ # reference is required
44
+ # @return [String] Relaton XML serialisation of reference
45
+ def get(code, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
46
+ refid = Pubid.parse code
47
+ refid.year ||= year
48
+ # if year.nil?
49
+ # /^(?<code1>[^\s]+\s[^\s]+)\s\((?:\d{2}\/)?(?<year1>\d+)\)$/ =~ code
50
+ # unless code1.nil?
51
+ # code = code1
52
+ # year = year1
53
+ # end
54
+ # end
52
55
 
53
- ret = ret.to_most_recent_reference unless year || opts[:keep_year]
54
- ret = ret.to_all_parts if opts[:all_parts]
55
- ret
56
- end
56
+ ret = itubib_get1(refid)
57
+ return nil if ret.nil?
57
58
 
58
- private
59
+ ret = ret.to_most_recent_reference unless refid.year || opts[:keep_year]
60
+ ret = ret.to_all_parts if opts[:all_parts]
61
+ ret
62
+ end
59
63
 
60
- def fetch_ref_err(code, year, missed_years) # rubocop:disable Metrics/MethodLength
61
- id = year ? "#{code}:#{year}" : code
62
- warn "[relaton-itu] WARNING: no match found online for #{id}. " \
63
- "The code must be exactly like it is on the standards website."
64
- unless missed_years.empty?
65
- warn "[relaton-itu] (There was no match for #{year}, though there " \
66
- "were matches found for #{missed_years.join(', ')}.)"
67
- end
68
- if /\d-\d/.match? code
69
- warn "[relaton-itu] The provided document part may not exist, or " \
70
- "the document may no longer be published in parts."
71
- else
72
- warn "[relaton-itu] If you wanted to cite all document parts for the reference, " \
73
- "use \"#{code} (all parts)\".\nIf the document is not a standard, " \
74
- "use its document type abbreviation (TS, TR, PAS, Guide)."
75
- end
76
- nil
64
+ private
65
+
66
+ def fetch_ref_err(refid, missed_years) # rubocop:disable Metrics/MethodLength
67
+ warn "[relaton-itu] WARNING: no match found online for #{refid}. " \
68
+ "The code must be exactly like it is on the standards website."
69
+ unless missed_years.empty?
70
+ warn "[relaton-itu] (There was no match for #{refid.year}, though there " \
71
+ "were matches found for #{missed_years.join(', ')}.)"
77
72
  end
73
+ # if /\d-\d/.match? refid.code
74
+ # warn "[relaton-itu] The provided document part may not exist, or " \
75
+ # "the document may no longer be published in parts."
76
+ # else
77
+ warn "[relaton-itu] If you wanted to cite all document parts for the reference, " \
78
+ "use \"#{refid} (all parts)\".\nIf the document is not a standard, " \
79
+ "use its document type abbreviation (TS, TR, PAS, Guide)."
80
+ # end
81
+ end
78
82
 
79
- def search_filter(code, year) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
80
- %r{
81
- ^(?<pref1>ITU)?(?:-(?<type1>\w))?\s?(?<code1>[^\s/]+(?:/\w[.\d]+)?)
82
- (?:\s\(?(?<ver1>v\d+)\)?)?
83
- (?:\s\((?:(?<month1>\d{2})/)?(?<year1>\d{4})\))?
84
- (?:\s-\s(?<buldate1>\d{2}\.\w{1,4}\.\d{4}))?
85
- (?:\s(?<corr1>(?:Amd|Cor|Amendment|Corrigendum)\.?\s?\d+))?
86
- (?:\s\((?:(?<cormonth1>\d{2})/)?(?<coryear1>\d{4})\))?
87
- }x =~ code
88
- year ||= year1
89
- warn "[relaton-itu] (\"#{code}\") fetching..."
90
- result = search(code)
91
- code1.sub!(/(?<=\.)Imp(?=\d)/, "") if result.gi_imp
92
- if corr1
93
- corr1.sub!(/[.\s]+/, " ").sub!("Amendment", "Amd")
94
- corr1.sub!("Corrigendum", "Corr")
95
- end
96
- result.select do |i|
97
- next true unless i.hit[:code]
83
+ def search_filter(refid) # rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
84
+ # %r{
85
+ # ^(?<pref1>ITU)?(?:-(?<type1>\w))?\s?(?<code1>[^\s/]+(?:/\w[.\d]+)?)
86
+ # (?:\s\(?(?<ver1>v\d+)\)?)?
87
+ # (?:\s\((?:(?<month1>\d{2})/)?(?<year1>\d{4})\))?
88
+ # (?:\s-\s(?<buldate1>\d{2}\.\w{1,4}\.\d{4}))?
89
+ # (?:\s(?<corr1>(?:Amd|Cor|Amendment|Corrigendum)\.?\s?\d+))?
90
+ # (?:\s\((?:(?<cormonth1>\d{2})/)?(?<coryear1>\d{4})\))?
91
+ # }x =~ code
92
+ # year ||= year1
93
+ warn "[relaton-itu] (\"#{refid}\") fetching..."
94
+ result = search(refid)
95
+ # refid.code.sub!(/(?<=\.)Imp(?=\d)/, "") if result.gi_imp
96
+ # if corr1
97
+ # corr1.sub!(/[.\s]+/, " ").sub!("Amendment", "Amd")
98
+ # corr1.sub!("Corrigendum", "Corr")
99
+ # end
100
+ result.select do |i|
101
+ next true unless i.hit[:code]
98
102
 
99
- %r{
100
- ^(?<pref2>ITU)?(?:-(?<type2>\w))?\s?(?<code2>\S+)
101
- (?:\s\(?(?<ver2>v\d+)\)?)?
102
- (?:\s\((?:(?<month2>\d{2})/)?(?<year2>\d{4})\))?
103
- (?:\s(?<corr2>(?:Amd|Cor)\.\s?\d+))?
104
- (?:\s\((?:(?<cormonth2>\d{2})/)?(?<coryear2>\d{4})\))?
105
- }x =~ i.hit[:code]
106
- /:[^(]+\((?<buldate2>\d{2}\.\w{1,4}\.\d{4})\)/ =~ i.hit[:title]
107
- corr2&.sub!(/\.\s?/, " ")
108
- pref1 == pref2 && (!type1 || type1 == type2) && code2.include?(code1) &&
109
- (!year || year == year2) && (!month1 || month1 == month2) &&
110
- corr1 == corr2 && (!coryear1 || coryear1 == coryear2) &&
111
- buldate1 == buldate2 && (!cormonth1 || cormonth1 == cormonth2) &&
112
- (!ver1 || ver1 == ver2)
113
- end
103
+ pubid = Pubid.parse i.hit[:code]
104
+ refid === pubid
105
+ # %r{
106
+ # ^(?<pref2>ITU)?(?:-(?<type2>\w))?\s?(?<code2>\S+)
107
+ # (?:\s\(?(?<ver2>v\d+)\)?)?
108
+ # (?:\s\((?:(?<month2>\d{2})/)?(?<year2>\d{4})\))?
109
+ # (?:\s(?<corr2>(?:Amd|Cor)\.\s?\d+))?
110
+ # (?:\s\((?:(?<cormonth2>\d{2})/)?(?<coryear2>\d{4})\))?
111
+ # }x =~ i.hit[:code]
112
+ # /:[^(]+\((?<buldate2>\d{2}\.\w{1,4}\.\d{4})\)/ =~ i.hit[:title]
113
+ # corr2&.sub!(/\.\s?/, " ")
114
+ # pref1 == pref2 && (!type1 || type1 == type2) && code2.include?(code1) &&
115
+ # (!year || year == year2) && (!month1 || month1 == month2) &&
116
+ # corr1 == corr2 && (!coryear1 || coryear1 == coryear2) &&
117
+ # buldate1 == buldate2 && (!cormonth1 || cormonth1 == cormonth2) &&
118
+ # (!ver1 || ver1 == ver2)
114
119
  end
120
+ end
115
121
 
116
- # Sort through the results from Isobib, fetching them three at a time,
117
- # and return the first result that matches the code,
118
- # matches the year (if provided), and which # has a title (amendments do not).
119
- # Only expects the first page of results to be populated.
120
- # Does not match corrigenda etc (e.g. ISO 3166-1:2006/Cor 1:2007)
121
- # If no match, returns any years which caused mismatch, for error reporting
122
- def isobib_results_filter(result, year)
123
- missed_years = []
124
- result.each do |r|
125
- /\((?:\d{2}\/)?(?<pyear>\d{4})\)/ =~ r.hit[:code]
126
- if !year || year == pyear
127
- ret = r.fetch
128
- return { ret: ret } if ret
129
- end
130
-
131
- missed_years << pyear
122
+ # Sort through the results from Isobib, fetching them three at a time,
123
+ # and return the first result that matches the code,
124
+ # matches the year (if provided), and which # has a title (amendments do not).
125
+ # Only expects the first page of results to be populated.
126
+ # Does not match corrigenda etc (e.g. ISO 3166-1:2006/Cor 1:2007)
127
+ # If no match, returns any years which caused mismatch, for error reporting
128
+ def isobib_results_filter(result, refid)
129
+ missed_years = []
130
+ result.each do |r|
131
+ /\((?:\d{2}\/)?(?<pyear>\d{4})\)/ =~ r.hit[:code]
132
+ if !refid.year || refid.year == pyear
133
+ ret = r.fetch
134
+ return { ret: ret } if ret
132
135
  end
133
- { years: missed_years }
136
+
137
+ missed_years << pyear
134
138
  end
139
+ { years: missed_years }
140
+ end
135
141
 
136
- def itubib_get1(code, year, _opts)
137
- result = search_filter(code, year) || return
138
- ret = isobib_results_filter(result, year)
139
- if ret[:ret]
140
- warn "[relaton-itu] (\"#{code}\") found #{ret[:ret].docidentifier.first&.id}"
141
- ret[:ret]
142
- else
143
- fetch_ref_err(code, year, ret[:years])
144
- end
142
+ def itubib_get1(refid)
143
+ result = search_filter(refid) || return
144
+ ret = isobib_results_filter(result, refid)
145
+ if ret[:ret]
146
+ warn "[relaton-itu] (\"#{refid}\") found #{ret[:ret].docidentifier.first&.id}"
147
+ ret[:ret]
148
+ else
149
+ fetch_ref_err(refid, ret[:years])
145
150
  end
146
151
  end
147
152
  end
@@ -0,0 +1,142 @@
1
+ module RelatonItu
2
+ class Pubid
3
+ class Parser < Parslet::Parser
4
+ rule(:dash) { str("-") }
5
+ rule(:dot) { str(".") }
6
+ rule(:dot?) { dot.maybe }
7
+ rule(:separator) { match['\s-'] }
8
+ rule(:space) { match("\s") }
9
+ rule(:num) { match["0-9"] }
10
+
11
+ rule(:prefix) { str("ITU").as(:prefix) }
12
+ rule(:sector) { separator >> match("[A-Z]").as(:sector) }
13
+ rule(:type) { separator >> str("REC").as(:type) }
14
+ rule(:type?) { type.maybe }
15
+ rule(:code) { separator >> (match["A-Z0-9"].repeat(1) >> match["[:alnum:]/.-"].repeat).as(:code) }
16
+ rule(:year) { (match["12"] >> num.repeat(3, 3)).as(:year) }
17
+
18
+ rule(:month1) { num.repeat(2, 2).as(:month) }
19
+ rule(:date1) { str(" (") >> (month1 >> str("/")).maybe >> year >> str(")") }
20
+ rule(:month2) { match["IVX"].repeat(1, 3).as(:month) }
21
+ rule(:date2) { str(" - ") >> num.repeat(2, 2) >> dot >> month2 >> dot >> year }
22
+ rule(:date) { date1 | date2 }
23
+ rule(:date?) { date.maybe }
24
+
25
+ rule(:amd) { space >> (str("Amd") | str("Amendment")) >> dot? >> space >> num.repeat(1, 2).as(:amd) }
26
+ rule(:amd?) { amd.maybe }
27
+
28
+ rule(:sup) { space >> str("Suppl") >> dot? >> space >> num.repeat(1, 2).as(:suppl) }
29
+ rule(:sup?) { sup.maybe }
30
+
31
+ rule(:annex) { space >> str("Annex") >> space >> match["[:alnum:]"].repeat(1, 2).as(:annex) }
32
+ rule(:annex?) { annex.maybe }
33
+
34
+ rule(:itu_pubid) { prefix >> sector >> type? >> code >> sup? >> annex? >> date? >> amd? >> any.repeat }
35
+ root(:itu_pubid)
36
+ end
37
+
38
+ attr_accessor :prefix, :sector, :type, :code, :suppl, :annex, :year, :month, :amd
39
+
40
+ #
41
+ # Create a new ITU publication identifier.
42
+ #
43
+ # @param [String] prefix
44
+ # @param [String] sector
45
+ # @param [String, nil] type
46
+ # @param [String] code
47
+ # @param [String, nil] suppl number
48
+ # @param [String, nil] year
49
+ # @param [String, nil] month
50
+ # @param [String, nil] amd amendment number
51
+ #
52
+ def initialize(prefix:, sector:, code:, **args)
53
+ @prefix = prefix
54
+ @sector = sector
55
+ @type = args[:type]
56
+ @code, year, month = date_from_code code
57
+ @suppl = args[:suppl]
58
+ @annex = args[:annex]
59
+ @year = args[:year] || year
60
+ @month = roman_to_2digit args[:month] || month
61
+ @amd = args[:amd]
62
+ end
63
+
64
+ def self.parse(id)
65
+ id_parts = Parser.new.parse(id).to_h.transform_values(&:to_s)
66
+ new(**id_parts)
67
+ rescue Parslet::ParseFailed => e
68
+ warn "[relaton-itu] WARNING: #{id} is invalid ITU publication identifier"
69
+ warn e.parse_failure_cause.ascii_tree
70
+ raise e
71
+ end
72
+
73
+ def to_h(with_type: true) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
74
+ hash = { prefix: prefix, sector: sector, code: code }
75
+ hash[:type] = type if type && with_type
76
+ hash[:suppl] = suppl if suppl
77
+ hash[:annex] = annex if annex
78
+ hash[:year] = year if year
79
+ hash[:month] = month if month
80
+ hash[:amd] = amd if amd
81
+ hash
82
+ end
83
+
84
+ def to_ref
85
+ to_s ref: true
86
+ end
87
+
88
+ def to_s(ref: false) # rubocop:disable Metrics/AbcSize
89
+ s = "#{prefix}-#{sector}"
90
+ s << " #{type}" if type && !ref
91
+ s << " #{code}"
92
+ s << " Suppl. #{suppl}" if suppl
93
+ s << " Annex #{annex}" if annex
94
+ s << date_to_s
95
+ s << " Amd #{amd}" if amd
96
+ s
97
+ end
98
+
99
+ def ===(other)
100
+ hash = to_h with_type: false
101
+ other_hash = other.to_h with_type: false
102
+ hash.delete(:month)
103
+ other_hash.delete(:month)
104
+ other_hash.delete(:year) unless hash[:year]
105
+ hash == other_hash
106
+ end
107
+
108
+ private
109
+
110
+ def date_from_code(code)
111
+ /(?<cod>.+?)-(?<date>\d{6})(?:-I|$)/ =~ code
112
+ return [code, nil, nil] unless cod && date
113
+
114
+ [cod, date[0..3], date[4..5]]
115
+ end
116
+
117
+ def roman_to_2digit(num) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
118
+ return unless num
119
+
120
+ roman_nums = { "I" => 1, "V" => 5, "X" => 10 }
121
+ last = roman_nums[num[-1]]
122
+ return num unless last
123
+
124
+ return roman_nums[num].to_s.rjust(2, "0") if num.size == 1
125
+
126
+ num.chars.each_cons(2).reduce(last) do |acc, (a, b)|
127
+ if roman_nums[a] < roman_nums[b]
128
+ acc - roman_nums[a]
129
+ else
130
+ acc + roman_nums[a]
131
+ end
132
+ end.to_s.rjust(2, "0")
133
+ end
134
+
135
+ def date_to_s
136
+ if month && year then " (#{month}/#{year})"
137
+ elsif year then " (#{year})"
138
+ else ""
139
+ end
140
+ end
141
+ end
142
+ end
@@ -1,3 +1,3 @@
1
1
  module RelatonItu
2
- VERSION = "1.14.2".freeze
2
+ VERSION = "1.14.3".freeze
3
3
  end
data/lib/relaton_itu.rb CHANGED
@@ -1,7 +1,9 @@
1
1
  require "mechanize"
2
+ require "parslet"
2
3
  require "digest/md5"
3
4
  require "relaton/index"
4
5
  require "relaton_itu/version"
6
+ require "relaton_itu/pubid"
5
7
  require "relaton_itu/itu_bibliography"
6
8
  require "relaton_itu/data_fetcher"
7
9
  require "relaton_itu/data_parser_r"
data/relaton-itu.gemspec CHANGED
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "mechanize", "~> 2.8.0"
29
+ spec.add_dependency "parslet", "~> 2.0.0"
29
30
  spec.add_dependency "relaton-bib", "~> 1.14.0"
30
31
  spec.add_dependency "relaton-index", "~> 0.2.0"
31
32
  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.14.2
4
+ version: 1.14.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: 2023-05-27 00:00:00.000000000 Z
11
+ date: 2023-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 2.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: parslet
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.0.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.0.0
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: relaton-bib
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +102,7 @@ files:
88
102
  - lib/relaton_itu/itu_bibliography.rb
89
103
  - lib/relaton_itu/itu_group.rb
90
104
  - lib/relaton_itu/processor.rb
105
+ - lib/relaton_itu/pubid.rb
91
106
  - lib/relaton_itu/scrapper.rb
92
107
  - lib/relaton_itu/structured_identifier.rb
93
108
  - lib/relaton_itu/version.rb