elibri_onix 0.5.4 → 0.5.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 695f587e6eee6ea9804909889dc9a61cf108e6fbc79564d9178e6b39873f13c9
|
4
|
+
data.tar.gz: 460af7593bfa60baa5984118125680f459ea64e17fda35e9cc1a1a955589b0ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af51afa939aa24e5712fce8b56ba1a3bfd04e102c116ff035e6974c68c9e925fbe45cf093a7d10b9a29d06b407ad0d2009d65126fafee223b0418403af690add
|
7
|
+
data.tar.gz: 041378df54dd07234a7cdf975e6d5c469e943bf4116fa14b9e4332d869c931d2d03eea36cc4f4c2ce8d8e586f8e39118c115b4aceeea05f114ecde0cc3ddd392
|
@@ -22,17 +22,17 @@ module Elibri
|
|
22
22
|
|
23
23
|
def initialize(data)
|
24
24
|
@to_xml = data.to_s
|
25
|
-
@type = data.css('ExtentType').try(:text)
|
26
|
-
@value = data.css('ExtentValue').try(:text).try(:to_i)
|
27
|
-
@unit = data.css('ExtentUnit').try(:text)
|
25
|
+
@type = data.css('ExtentType').try(:text).try(:strip)
|
26
|
+
@value = data.css('ExtentValue').try(:text).try(:strip).try(:to_i)
|
27
|
+
@unit = data.css('ExtentUnit').try(:text).try(:strip)
|
28
28
|
end
|
29
29
|
|
30
30
|
def type_name
|
31
|
-
Elibri::ONIX::Dict::Release_3_0::ExtentType.find_by_onix_code(@type).const_name.downcase
|
31
|
+
Elibri::ONIX::Dict::Release_3_0::ExtentType.find_by_onix_code(@type).try(:const_name).try(:downcase)
|
32
32
|
end
|
33
33
|
|
34
34
|
def unit_name
|
35
|
-
Elibri::ONIX::Dict::Release_3_0::ExtentUnit.find_by_onix_code(@unit).const_name.downcase
|
35
|
+
Elibri::ONIX::Dict::Release_3_0::ExtentUnit.find_by_onix_code(@unit).try(:const_name).try(:downcase)
|
36
36
|
end
|
37
37
|
|
38
38
|
def inspect_include_fields
|
@@ -355,7 +355,7 @@ module Elibri
|
|
355
355
|
@audience_ranges = data.css('AudienceRange').map { |audience_data| AudienceRange.new(audience_data) }
|
356
356
|
|
357
357
|
simplified_product_form = @product_form.starts_with?("B") ? "BA" : @product_form
|
358
|
-
if Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(simplified_product_form).digital?
|
358
|
+
if Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(simplified_product_form).try!(:digital?)
|
359
359
|
@digital_formats = []
|
360
360
|
data.css("ProductFormDetail").each do |format|
|
361
361
|
@digital_formats << Elibri::ONIX::Dict::Release_3_0::ProductFormDetail::find_by_onix_code(format.text).name.upcase.gsub("MOBIPOCKET", "MOBI")
|
@@ -364,7 +364,7 @@ module Elibri
|
|
364
364
|
|
365
365
|
#zabezpiecznie pliku
|
366
366
|
if protection = data.at_css("EpubTechnicalProtection").try(:text)
|
367
|
-
@technical_protection = Elibri::ONIX::Dict::Release_3_0::EpubTechnicalProtection::find_by_onix_code(protection).name
|
367
|
+
@technical_protection = Elibri::ONIX::Dict::Release_3_0::EpubTechnicalProtection::find_by_onix_code(protection).try(:name)
|
368
368
|
@technical_protection_onix_code = protection
|
369
369
|
end
|
370
370
|
|
@@ -544,6 +544,8 @@ module Elibri
|
|
544
544
|
@current_state = :published
|
545
545
|
elsif @publishing_status == "07"
|
546
546
|
@current_state = :out_of_print
|
547
|
+
elsif @notification_type == "03"
|
548
|
+
@current_state = :published
|
547
549
|
else
|
548
550
|
raise "cannot determine the state of the product #{@record_reference}"
|
549
551
|
end
|
@@ -39,7 +39,7 @@ module Elibri
|
|
39
39
|
|
40
40
|
#returs the string name of value type
|
41
41
|
def identifier_type
|
42
|
-
Elibri::ONIX::Dict::Release_3_0::ProductIDType.find_by_onix_code(@type).const_name.downcase
|
42
|
+
Elibri::ONIX::Dict::Release_3_0::ProductIDType.find_by_onix_code(@type).try(:const_name).try(:downcase)
|
43
43
|
end
|
44
44
|
|
45
45
|
#:nodoc:
|
data/lib/elibri_onix/version.rb
CHANGED
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.
|
4
|
+
version: 0.5.5
|
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: 2019-12-
|
12
|
+
date: 2019-12-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|