elibri_onix 0.5.8 → 0.5.9

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: e5ea523876f8d6c3592cb2a0db236799034257c23b8e2b7a66ee9b1554138348
4
- data.tar.gz: 75d75d545d5a86401dd99152e56dc8dfcc8215aa6e6073c9c3695d00cac5d7f1
3
+ metadata.gz: f7ff1ae7075744aafdb79d18947c90d4a37ae1dd087093dedd1afde70720b426
4
+ data.tar.gz: 8dd4634354067aabb96eab63eda2d368445f680da205bbed1286681f8159f43f
5
5
  SHA512:
6
- metadata.gz: a6b5248d7dbb0b983bf2e58fa8debd020a8157645e979c8311c8d1c817c12dda7efeecc135d9b2fc07bd4cabc6a5bc1cce7007c47749766a4a7ac5e58191df32
7
- data.tar.gz: 18602e1caa0e78b55ea9f541aa4dc67500ae28bf311d5e03be459731b78a54cd9c3000e38ef88d1622ec2870d2d4a8b0f77b1410d1e027cd0337c941fd0580d4
6
+ metadata.gz: 47d7d19a8cd7ebc26bd42e216e28010b617c12067de43d2df15395b7f1c380c5c27d79abec2473e1bc64db5e5d56db60a9fec549eae2e76933b522744ff3d5e0
7
+ data.tar.gz: c40cf4564716de2a527609148a084dd292101e046e8d3a27a98d9016d849bf56dae9ba2074da91b0ff43845c78085188c0df99fb1fe865ad7bf68f278d6d9dde
@@ -7,7 +7,7 @@ module Elibri
7
7
  include ExternalId
8
8
  include ExternalTimestamp
9
9
  include Inspector
10
-
10
+
11
11
  #from ONIX documentation:
12
12
  #Authorship and other forms of contribution are described by repeats of the <Contributor> composite,
13
13
  #within which the recommended form of representation of a person name is the structured data element
@@ -16,20 +16,20 @@ module Elibri
16
16
  #for example if a contributor is referenced both by their real name and by a pseudonym,
17
17
  #or by the name given on the title page and by an authority-controlled name.
18
18
  #In addition, more than one representation of the same name may be sent.
19
-
19
+
20
20
  #:nodoc:
21
21
  ATTRIBUTES =
22
22
  [
23
23
  :number, :role, :person_name, :from_language, :titles_before_names, :names_before_key, :prefix_to_key,
24
24
  :key_names, :names_after_key, :biographical_note, :unnamed_persons, :role_name
25
25
  ]
26
-
26
+
27
27
  #:nodoc:
28
28
  RELATIONS =
29
29
  [
30
30
  :inspect_include_fields
31
31
  ]
32
-
32
+
33
33
  #:nodoc:
34
34
  attr_reader :number
35
35
 
@@ -41,6 +41,9 @@ module Elibri
41
41
  #pełne imię i nazwisko - to pole jest zawsze uzupełnione
42
42
  attr_reader :person_name
43
43
 
44
+ #jednak czasami, nie ma :person_name, jest za to :person_name_inverted - e-isbn
45
+ attr_reader :person_name_inverted
46
+
44
47
  #w przypadku tłumacza kod języka oryginału, lista języków dostępna pod adresem
45
48
  #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/LanguageCode.yml
46
49
  attr_reader :from_language
@@ -56,7 +59,7 @@ module Elibri
56
59
 
57
60
  #nazwisko lub nazwiska
58
61
  attr_reader :key_names
59
-
62
+
60
63
  #dodatkowe oznaczenia, np. OHP (zakon)
61
64
  attr_reader :names_after_key
62
65
 
@@ -65,16 +68,17 @@ module Elibri
65
68
 
66
69
  #:nodoc:
67
70
  attr_reader :unnamed_persons
68
-
71
+
69
72
  #reprezentacja danych w xml-u
70
73
  attr_reader :to_xml
71
-
74
+
72
75
 
73
76
  def initialize(data)
74
77
  @to_xml = data.to_s
75
78
  @number = data.at_css('SequenceNumber').try(:text).try(:to_i)
76
79
  @role = data.at_css('ContributorRole').try(:text)
77
80
  @person_name = data.at_css('PersonName').try(:text)
81
+ @person_name_inverted = data.at_css('PersonNameInverted').try(:text)
78
82
  @from_language = data.at_css('FromLanguage').try(:text)
79
83
  @titles_before_names = data.at_css('TitlesBeforeNames').try(:text)
80
84
  @names_before_key = data.at_css('NamesBeforeKey').try(:text)
@@ -88,13 +92,13 @@ module Elibri
88
92
  end
89
93
 
90
94
  def role_name
91
- Elibri::ONIX::Dict::Release_3_0::ContributorRole.find_by_onix_code(@role).const_name.downcase
95
+ Elibri::ONIX::Dict::Release_3_0::ContributorRole.find_by_onix_code(@role).const_name.downcase rescue nil
92
96
  end
93
97
 
94
98
  def inspect_include_fields
95
99
  [:role_name, :person_name]
96
100
  end
97
-
101
+
98
102
  end
99
103
 
100
104
  end
@@ -6,26 +6,26 @@ module Elibri
6
6
  module Release_3_0
7
7
 
8
8
  class PublishingDate
9
-
9
+
10
10
  #from ONIX documentation:
11
11
  #A repeatable group of data elements which together specify a date associated with the publishing of the product.
12
12
  #Optional, but a date of publication must be specified either or in <MarketPublishingDetail> (P.25).
13
13
  #Other dates related to the publishing of a product can be sent in further repeats.
14
14
 
15
15
  include HashId
16
-
16
+
17
17
  ATTRIBUTES = [
18
18
  :role, :format, :date, :parsed
19
19
  ]
20
-
20
+
21
21
  RELATIONS = []
22
-
22
+
23
23
  attr_accessor :role, :format, :date, :to_xml
24
-
24
+
25
25
  def initialize(data)
26
26
  @to_xml = data.to_s
27
27
  @role = data.at_css('PublishingDateRole').try(:text)
28
- @format = data.at_css('DateFormat').try(:text)
28
+ @format = data.at_css('DateFormat').try(:text) || data.at_css('Date')['dateformat'] || '00'
29
29
  @date = data.at_css('Date').try(:text)
30
30
  end
31
31
 
@@ -2,7 +2,7 @@ module Elibri
2
2
  module ONIX
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "0.5.8"
5
+ VERSION = "0.5.9"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Urbanski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-01-01 00:00:00.000000000 Z
12
+ date: 2020-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -284,8 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
284
284
  - !ruby/object:Gem::Version
285
285
  version: '0'
286
286
  requirements: []
287
- rubyforge_project:
288
- rubygems_version: 2.7.9
287
+ rubygems_version: 3.0.3
289
288
  signing_key:
290
289
  specification_version: 4
291
290
  summary: EDItEUR ONIX format subset implementation used in Elibri publication system