relaton-cen 1.9.0 → 1.9.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
2
  SHA256:
3
- metadata.gz: 4cfd15611267ccf483a5f5ab60906815886d45859adc4e10fb1d0aa2c6d77d08
4
- data.tar.gz: 26406a2e1d96ca91f87eca73eeee8e7e43c605bd87fc249e04cee2ab78ae1648
3
+ metadata.gz: '09727f48b755249b669732a011ca4674b4f0a1f782d9adc9bf49a2c6ea9bda42'
4
+ data.tar.gz: c6e98c93aecbd1e291e03d9967b819131299532232d3e1122ccca717c64c821b
5
5
  SHA512:
6
- metadata.gz: e5921128e03d6b4f5e08cbae5b0f093aec9102fbf8a9a15e657fdd8f231a477a624d6a81983e7a16b5f12d253badd48a236b4024277072243612baf99172bd25
7
- data.tar.gz: 4a6efc6e28c9b2941f4ad1f0c96688a3c2c1f2cb996a8cabaacdf2297e78f71f4ca2223c8a52dd499422a2c887190055df037b027fd13b37ea9d8992f677212f
6
+ metadata.gz: b14a05ff7c665101f1dc9a4d469a621696a6560230a920df8f406d981a606bc6813a2af45eb039f7a37fe76ba2e4eee809508901c988b50f65e36f5166843527
7
+ data.tar.gz: fe5c8f91f64774b9aa1f5f7bf3b10ae58da09fef73d2b0a4f9cea6aa472116f8514d74950b7cd7f516f1b3c72ac435ab2e46c729fb919a32f824cbcb1683b806
@@ -26,20 +26,11 @@ module RelatonCen
26
26
  # reference is required
27
27
  # @return [RelatonBib::BibliographicItem, nil]
28
28
  def get(code, year = nil, opts = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
29
- # if year.nil?
30
29
  code1, year1 = code.split ":"
31
- # unless code1.nil?
32
30
  code = code1
33
31
  year ||= year1
34
- # end
35
- # end
36
-
37
- ret = bib_get1(code, year, opts)
38
- return nil if ret.nil?
39
32
 
40
- # ret = ret.to_most_recent_reference unless year || opts[:keep_year]
41
- # ret = ret.to_all_parts if opts[:all_parts]
42
- ret
33
+ bib_get1(code, year, opts)
43
34
  end
44
35
 
45
36
  private
@@ -5,7 +5,7 @@ require "relaton_cen/hit"
5
5
  module RelatonCen
6
6
  # Page of hit collection.
7
7
  class HitCollection < RelatonBib::HitCollection
8
- DOMAIN = "https://standards.cen.eu/dyn/www/"
8
+ DOMAIN = "https://standards.cencenelec.eu/dyn/www/"
9
9
 
10
10
  # @return [Mechanize]
11
11
  attr_reader :agent
@@ -21,23 +21,25 @@ module RelatonCen
21
21
  return
22
22
  end
23
23
 
24
- search_page = agent.get "#{DOMAIN}f?p=204:105:0:::::"
25
- form = search_page.at "//form"
26
- req_body = form.xpath("//input").map do |f|
27
- next if f[:name].empty? || f[:name] == "f11"
24
+ search_page = agent.get "#{DOMAIN}f?p=205:105:0:::::"
25
+ form = search_page.at "//form[@id='wwvFlowForm']"
26
+ skip_inputs = %w[f11 essentialCookies]
27
+ req_body = form.xpath(".//input").map do |f|
28
+ next if f[:name].empty? || skip_inputs.include?(f[:name])
28
29
 
29
30
  val = case f[:value]
30
31
  when "LANGUAGE_LIST" then 0
31
32
  when "STAND_REF" then ref
32
33
  else
33
34
  case f[:name]
34
- when "p_request" then "S1-S2-S3-S4-S5-S6"
35
+ when "p_request" then "S1-S2-S3-S4-S5-S6-CEN-CLC-"
35
36
  when "f10" then ""
36
37
  else f[:value]
37
38
  end
38
39
  end
39
40
  if f[:name] == "f10" then "f10=#{f[:value]}&f11=#{val}"
40
- else "#{f[:name]}=#{val}"
41
+ else
42
+ "#{f[:name]}=#{val}"
41
43
  end
42
44
  end.compact.join("&")
43
45
  resp = agent.post form[:action], req_body
@@ -76,7 +76,7 @@ module RelatonCen
76
76
  # @return [RelatonIsoBib::EditorialGroup]
77
77
  def fetch_editorialgroup(doc) # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
78
78
  code = doc.at("//tr/td/h1/text()").text
79
- title = doc.at("//tr/td/h1/span").text
79
+ title = doc.at("//tr/td[3]/h1").text
80
80
  %r{/(?<type>\w+)(?:\s(?<num>[^/]+))?$} =~ code
81
81
  tc = []
82
82
  COMMITTEES.each do |k, v|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RelatonCen
4
- VERSION = "1.9.0"
4
+ VERSION = "1.9.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-cen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 1.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-26 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: equivalent-xml