elibri_onix 0.5.19 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/lib/elibri_onix/external_timestamp.rb +2 -2
  3. data/lib/elibri_onix/onix_3_0/audience_range.rb +4 -17
  4. data/lib/elibri_onix/onix_3_0/collection.rb +0 -0
  5. data/lib/elibri_onix/onix_3_0/contributor.rb +15 -38
  6. data/lib/elibri_onix/onix_3_0/excerpt_info.rb +8 -21
  7. data/lib/elibri_onix/onix_3_0/extent.rb +9 -24
  8. data/lib/elibri_onix/onix_3_0/file_info.rb +2 -13
  9. data/lib/elibri_onix/onix_3_0/header.rb +7 -17
  10. data/lib/elibri_onix/onix_3_0/imprint.rb +2 -18
  11. data/lib/elibri_onix/onix_3_0/language.rb +5 -22
  12. data/lib/elibri_onix/onix_3_0/measure.rb +4 -18
  13. data/lib/elibri_onix/onix_3_0/onix_message.rb +2 -17
  14. data/lib/elibri_onix/onix_3_0/price.rb +14 -25
  15. data/lib/elibri_onix/onix_3_0/price_constraint_limit.rb +22 -0
  16. data/lib/elibri_onix/onix_3_0/price_identifier.rb +18 -0
  17. data/lib/elibri_onix/onix_3_0/product.rb +62 -127
  18. data/lib/elibri_onix/onix_3_0/product_identifier.rb +6 -22
  19. data/lib/elibri_onix/onix_3_0/publisher.rb +4 -21
  20. data/lib/elibri_onix/onix_3_0/publisher_subject.rb +3 -13
  21. data/lib/elibri_onix/onix_3_0/publishing_date.rb +3 -21
  22. data/lib/elibri_onix/onix_3_0/related_product.rb +5 -24
  23. data/lib/elibri_onix/onix_3_0/sales_restriction.rb +5 -22
  24. data/lib/elibri_onix/onix_3_0/sender.rb +0 -12
  25. data/lib/elibri_onix/onix_3_0/stock_quantity_coded.rb +4 -19
  26. data/lib/elibri_onix/onix_3_0/supplier.rb +7 -25
  27. data/lib/elibri_onix/onix_3_0/supplier_identifier.rb +4 -23
  28. data/lib/elibri_onix/onix_3_0/supply_detail.rb +9 -26
  29. data/lib/elibri_onix/onix_3_0/supporting_resource.rb +7 -20
  30. data/lib/elibri_onix/onix_3_0/text_content.rb +9 -24
  31. data/lib/elibri_onix/onix_3_0/thema_subject.rb +2 -15
  32. data/lib/elibri_onix/onix_3_0/title_detail.rb +9 -28
  33. data/lib/elibri_onix/onix_3_0/title_element.rb +10 -35
  34. data/lib/elibri_onix/releases.rb +2 -2
  35. data/lib/elibri_onix/timestamp_parser.rb +12 -0
  36. data/lib/elibri_onix/version.rb +1 -1
  37. data/lib/elibri_onix.rb +4 -8
  38. data/test/elibri_audiobook_test.rb +1 -1
  39. data/test/elibri_contributors_test.rb +3 -3
  40. data/test/elibri_ebook_files_test.rb +2 -2
  41. data/test/elibri_extensions_test.rb +0 -12
  42. data/test/elibri_group_contributor_test.rb +1 -1
  43. data/test/elibri_onix_release_3_0_onix_message_test.rb +1 -6
  44. data/test/elibri_record_identifiers_test.rb +2 -2
  45. data/test/elibri_supporting_resources_test.rb +2 -2
  46. data/test/elibri_texts_test.rb +5 -5
  47. data/test/fixtures/all_possible_tags.xml +1 -18
  48. data/test/fixtures/lending_example.xml +419 -0
  49. data/test/fixtures/onix_announced_product_example.xml +1 -3
  50. data/test/fixtures/onix_audience_range_example.xml +1 -3
  51. data/test/fixtures/onix_audiobook_extent_example.xml +1 -3
  52. data/test/fixtures/onix_collective_work_example.xml +1 -3
  53. data/test/fixtures/onix_contributors_example.xml +1 -3
  54. data/test/fixtures/onix_ebook_extent_example.xml +1 -4
  55. data/test/fixtures/onix_edition_example.xml +1 -3
  56. data/test/fixtures/onix_epub_details_example.xml +5 -4
  57. data/test/fixtures/onix_languages_example.xml +1 -3
  58. data/test/fixtures/onix_measurement_example.xml +1 -3
  59. data/test/fixtures/onix_no_contributors_example.xml +1 -3
  60. data/test/fixtures/onix_out_of_print_product_example.xml +1 -3
  61. data/test/fixtures/onix_preorder_product_example.xml +1 -3
  62. data/test/fixtures/onix_product_form_example.xml +1 -4
  63. data/test/fixtures/onix_published_group_product_example.xml +1 -3
  64. data/test/fixtures/onix_published_product_example.xml +1 -3
  65. data/test/fixtures/onix_publisher_info_example.xml +1 -3
  66. data/test/fixtures/onix_record_identifiers_example.xml +1 -4
  67. data/test/fixtures/onix_related_products_example.xml +1 -3
  68. data/test/fixtures/onix_removed_elibri_extensions.xml +0 -1
  69. data/test/fixtures/onix_sale_restrictions_example.xml +1 -3
  70. data/test/fixtures/onix_series_memberships_example.xml +1 -3
  71. data/test/fixtures/onix_supporting_resources_example.xml +1 -2
  72. data/test/fixtures/onix_territorial_rights_example.xml +1 -4
  73. data/test/fixtures/onix_texts_example.xml +1 -3
  74. data/test/fixtures/onix_title_with_collection_example.xml +1 -3
  75. data/test/fixtures/onix_titles_example.xml +1 -3
  76. data/test/fixtures/onix_unlimited_book_sample_example.xml +1 -4
  77. data/test/lending_licence_test.rb +43 -0
  78. metadata +9 -20
  79. data/lib/elibri_onix/hash_id.rb +0 -37
  80. data/test/fixtures/old_dialect.xml +0 -29
  81. data/test/fixtures/onix_elibri_extensions_example.xml +0 -57
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -47,6 +46,5 @@
47
46
  </Territory>
48
47
  </SalesRights>
49
48
  </PublishingDetail>
50
- <elibri:preview_exists>false</elibri:preview_exists>
51
49
  </Product>
52
50
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -46,6 +45,5 @@
46
45
  </Territory>
47
46
  </SalesRights>
48
47
  </PublishingDetail>
49
- <elibri:preview_exists>false</elibri:preview_exists>
50
48
  </Product>
51
49
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -54,6 +53,5 @@
54
53
  </Territory>
55
54
  </SalesRights>
56
55
  </PublishingDetail>
57
- <elibri:preview_exists>false</elibri:preview_exists>
58
56
  </Product>
59
57
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -46,7 +45,5 @@
46
45
  </Territory>
47
46
  </SalesRights>
48
47
  </PublishingDetail>
49
- <elibri:CoverType>miękka</elibri:CoverType>
50
- <elibri:preview_exists>false</elibri:preview_exists>
51
48
  </Product>
52
49
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -50,6 +49,5 @@
50
49
  </Territory>
51
50
  </SalesRights>
52
51
  </PublishingDetail>
53
- <elibri:preview_exists>false</elibri:preview_exists>
54
52
  </Product>
55
53
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -50,6 +49,5 @@
50
49
  </Territory>
51
50
  </SalesRights>
52
51
  </PublishingDetail>
53
- <elibri:preview_exists>false</elibri:preview_exists>
54
52
  </Product>
55
53
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -49,6 +48,5 @@
49
48
  </Territory>
50
49
  </SalesRights>
51
50
  </PublishingDetail>
52
- <elibri:preview_exists>false</elibri:preview_exists>
53
51
  </Product>
54
52
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -86,7 +85,5 @@
86
85
  </Price>
87
86
  </SupplyDetail>
88
87
  </ProductSupply>
89
- <elibri:preview_exists>false</elibri:preview_exists>
90
- <elibri:HyphenatedISBN>978-83-2478-888-2</elibri:HyphenatedISBN>
91
88
  </Product>
92
89
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions" release="3.0">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage xmlns="http://ns.editeur.org/onix/3.0/reference" release="3.0">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -56,6 +55,5 @@
56
55
  </ProductIdentifier>
57
56
  </RelatedProduct>
58
57
  </RelatedMaterial>
59
- <elibri:preview_exists>false</elibri:preview_exists>
60
58
  </Product>
61
59
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -57,6 +56,5 @@
57
56
  <EndDate>20120722</EndDate>
58
57
  </SalesRestriction>
59
58
  </PublishingDetail>
60
- <elibri:preview_exists>false</elibri:preview_exists>
61
59
  </Product>
62
60
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -68,6 +67,5 @@
68
67
  </Territory>
69
68
  </SalesRights>
70
69
  </PublishingDetail>
71
- <elibri:preview_exists>false</elibri:preview_exists>
72
70
  </Product>
73
71
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -45,7 +44,6 @@
45
44
  </Territory>
46
45
  </SalesRights>
47
46
  </PublishingDetail>
48
- <elibri:preview_exists>false</elibri:preview_exists>
49
47
  </Product>
50
48
  <Product>
51
49
  <RecordReference>fdb8fa072be774d97a97</RecordReference>
@@ -83,6 +81,5 @@
83
81
  </Territory>
84
82
  </SalesRights>
85
83
  </PublishingDetail>
86
- <elibri:preview_exists>false</elibri:preview_exists>
87
84
  </Product>
88
85
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -78,6 +77,5 @@
78
77
  </Territory>
79
78
  </SalesRights>
80
79
  </PublishingDetail>
81
- <elibri:preview_exists>false</elibri:preview_exists>
82
80
  </Product>
83
81
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -65,6 +64,5 @@
65
64
  </Territory>
66
65
  </SalesRights>
67
66
  </PublishingDetail>
68
- <elibri:preview_exists>false</elibri:preview_exists>
69
67
  </Product>
70
68
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -61,6 +60,5 @@
61
60
  </Territory>
62
61
  </SalesRights>
63
62
  </PublishingDetail>
64
- <elibri:preview_exists>false</elibri:preview_exists>
65
63
  </Product>
66
64
  </ONIXMessage>
@@ -1,6 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
2
+ <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference">
4
3
  <Header>
5
4
  <Sender>
6
5
  <SenderName>Elibri.com.pl</SenderName>
@@ -49,7 +48,5 @@
49
48
  </Territory>
50
49
  </SalesRights>
51
50
  </PublishingDetail>
52
- <elibri:preview_exists>false</elibri:preview_exists>
53
- <elibri:SaleNotRestricted/>
54
51
  </Product>
55
52
  </ONIXMessage>
@@ -0,0 +1,43 @@
1
+ #encoding: UTF-8
2
+ require 'helper'
3
+
4
+
5
+ describe "parsing onix lending infos" do
6
+
7
+ it "should be able to parse lending info" do
8
+ product = load_fixture("lending_example.xml")
9
+
10
+ assert_equal 5, product.vat
11
+ assert_equal 49.90, product.cover_price
12
+
13
+ library_supply = product.supply_details[1]
14
+ assert_equal 2, library_supply.prices.size
15
+
16
+ price1 = library_supply.prices[0]
17
+ assert_equal Elibri::ONIX::Dict::Release_3_0::PriceQualifier::LIBRARY_PRICE, price1.price_qualifier
18
+ assert_equal "ElibriLendingID", price1.price_identifier.type_name
19
+ assert_equal "25/2 36m.", price1.price_identifier.value
20
+ assert_equal 34, price1.amount
21
+
22
+ assert_equal 4, price1.price_constraint_limits.size
23
+
24
+ assert_equal 25, price1.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::TIMES }.value
25
+ assert_equal 2, price1.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::CONCURRENT_USERS }.value
26
+ assert_equal 36, price1.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::MONTHS }.value
27
+ assert_equal Date.new(2025,2, 20), price1.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::VALID_FROM }.value
28
+
29
+
30
+
31
+ price2 = library_supply.prices[1]
32
+ assert_equal Elibri::ONIX::Dict::Release_3_0::PriceQualifier::LIBRARY_PRICE, price2.price_qualifier
33
+ assert_equal "ElibriLendingID", price2.price_identifier.type_name
34
+ assert_equal "10/1 bezterminowo", price2.price_identifier.value
35
+ assert_equal 20, price2.amount
36
+
37
+ assert_equal 10, price2.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::TIMES }.value
38
+ assert_equal 1, price2.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::CONCURRENT_USERS }.value
39
+ assert_nil price2.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::MONTHS }
40
+ assert_nil price2.price_constraint_limits.find { |c| c.unit == Elibri::ONIX::Dict::Release_3_0::PriceConstraintUnit::VALID_FROM }
41
+ end
42
+
43
+ end
metadata CHANGED
@@ -1,30 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.19
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Urbanski
8
8
  - Piotr Szmielew
9
+ - Tomasz Meka
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2024-04-15 00:00:00.000000000 Z
13
+ date: 2024-11-21 00:00:00.000000000 Z
13
14
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: activesupport
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 2.3.5
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 2.3.5
28
15
  - !ruby/object:Gem::Dependency
29
16
  name: nokogiri
30
17
  requirement: !ruby/object:Gem::Requirement
@@ -170,7 +157,6 @@ files:
170
157
  - lib/elibri_onix.rb
171
158
  - lib/elibri_onix/external_id.rb
172
159
  - lib/elibri_onix/external_timestamp.rb
173
- - lib/elibri_onix/hash_id.rb
174
160
  - lib/elibri_onix/inspector.rb
175
161
  - lib/elibri_onix/onix_3_0/audience_range.rb
176
162
  - lib/elibri_onix/onix_3_0/collection.rb
@@ -184,6 +170,8 @@ files:
184
170
  - lib/elibri_onix/onix_3_0/measure.rb
185
171
  - lib/elibri_onix/onix_3_0/onix_message.rb
186
172
  - lib/elibri_onix/onix_3_0/price.rb
173
+ - lib/elibri_onix/onix_3_0/price_constraint_limit.rb
174
+ - lib/elibri_onix/onix_3_0/price_identifier.rb
187
175
  - lib/elibri_onix/onix_3_0/product.rb
188
176
  - lib/elibri_onix/onix_3_0/product_identifier.rb
189
177
  - lib/elibri_onix/onix_3_0/publisher.rb
@@ -202,6 +190,7 @@ files:
202
190
  - lib/elibri_onix/onix_3_0/title_detail.rb
203
191
  - lib/elibri_onix/onix_3_0/title_element.rb
204
192
  - lib/elibri_onix/releases.rb
193
+ - lib/elibri_onix/timestamp_parser.rb
205
194
  - lib/elibri_onix/version.rb
206
195
  - test/elibri_audience_range_test.rb
207
196
  - test/elibri_audiobook_test.rb
@@ -235,7 +224,7 @@ files:
235
224
  - test/elibri_titles_test.rb
236
225
  - test/fixtures/all_possible_tags.xml
237
226
  - test/fixtures/eisbn-pl-sample.xml
238
- - test/fixtures/old_dialect.xml
227
+ - test/fixtures/lending_example.xml
239
228
  - test/fixtures/onix_announced_product_example.xml
240
229
  - test/fixtures/onix_audience_range_example.xml
241
230
  - test/fixtures/onix_audiobook_example.xml
@@ -247,7 +236,6 @@ files:
247
236
  - test/fixtures/onix_ebook_extent_example.xml
248
237
  - test/fixtures/onix_ebook_with_files_example.xml
249
238
  - test/fixtures/onix_edition_example.xml
250
- - test/fixtures/onix_elibri_extensions_example.xml
251
239
  - test/fixtures/onix_epub_details_example.xml
252
240
  - test/fixtures/onix_exclusive_distributor_example.xml
253
241
  - test/fixtures/onix_languages_example.xml
@@ -273,6 +261,7 @@ files:
273
261
  - test/fixtures/onix_titles_example.xml
274
262
  - test/fixtures/onix_unlimited_book_sample_example.xml
275
263
  - test/helper.rb
264
+ - test/lending_licence_test.rb
276
265
  homepage: http://github.com/elibri/elibri_onix
277
266
  licenses:
278
267
  - MIT
@@ -292,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
281
  - !ruby/object:Gem::Version
293
282
  version: '0'
294
283
  requirements: []
295
- rubygems_version: 3.1.6
284
+ rubygems_version: 3.5.3
296
285
  signing_key:
297
286
  specification_version: 4
298
287
  summary: EDItEUR ONIX format subset implementation used in Elibri publication system
@@ -1,37 +0,0 @@
1
- module HashId
2
-
3
- SKIPPED_ATTRIBS = ["@opts", "@default_namespace", "@instance"]
4
- SKIPPED_2 = ["@id", "@id_before_type_cast"]
5
-
6
- def eid
7
- calculate_hash(self)
8
- end
9
-
10
- def calculate_hash(object)
11
- result = []
12
- if object.is_a? Array
13
- object.each { |x| result << calculate_hash(x) }
14
- else
15
- vars = []
16
- if object.class.to_s.include? "Elibri::ONIX"
17
- vars += object.class::ATTRIBUTES
18
- vars += object.class::RELATIONS
19
- end
20
- vars = object.instance_variables if vars.blank?
21
- vars.each do |attrib|
22
- next if SKIPPED_ATTRIBS.include? attrib
23
- next if SKIPPED_2.include? attrib
24
- attrib = attrib.to_s.gsub("@", "").to_sym if attrib.is_a?(String)
25
- if object.send(attrib).is_a? Array
26
- result << calculate_hash(object.send(attrib))
27
- elsif object.send(attrib).is_a?(String) || object.send(attrib).is_a?(Numeric) || object.send(attrib).is_a?(Fixnum) || object.send(attrib).is_a?(Symbol)
28
- result << object.send(attrib)
29
- else
30
- result << calculate_hash(object.send(attrib))
31
- end
32
- end
33
- end
34
- return Digest::SHA1.hexdigest(result.join("-"))
35
- end
36
-
37
- end
@@ -1,29 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns:elibri="http://elibri.com.pl/ns/extensions" xmlns="http://www.editeur.org/onix/3.0/reference">
3
- <elibri:Dialect>3.0.0</elibri:Dialect>
4
- <Header>
5
- <Sender>
6
- <SenderName>Elibri.com.pl</SenderName>
7
- <ContactName>Tomasz Meka</ContactName>
8
- <EmailAddress>kontakt@elibri.com.pl</EmailAddress>
9
- </Sender>
10
- <SentDateTime>20111005</SentDateTime>
11
- </Header>
12
- <Product>
13
- <RecordReference>fdb8fa072be774d97a97</RecordReference>
14
- <NotificationType>02</NotificationType>
15
- <DescriptiveDetail>
16
- <TitleDetail>
17
- <TitleType>01</TitleType>
18
- <TitleElement>
19
- <TitleElementLevel>01</TitleElementLevel>
20
- <TitleText>Nielegalni</TitleText>
21
- </TitleElement>
22
- </TitleDetail>
23
- </DescriptiveDetail>
24
- <elibri:CoverType>miękka</elibri:CoverType>
25
- <elibri:CoverPrice>12.99</elibri:CoverPrice>
26
- <elibri:Vat>5</elibri:Vat>
27
- <elibri:PKWiU>58.11.1</elibri:PKWiU>
28
- </Product>
29
- </ONIXMessage>
@@ -1,57 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <ONIXMessage release="3.0" xmlns="http://ns.editeur.org/onix/3.0/reference" xmlns:elibri="http://elibri.com.pl/ns/extensions">
3
- <elibri:Dialect>3.0.1</elibri:Dialect>
4
- <Header>
5
- <Sender>
6
- <SenderName>Elibri.com.pl</SenderName>
7
- <ContactName>Tomasz Meka</ContactName>
8
- <EmailAddress>kontakt@elibri.com.pl</EmailAddress>
9
- </Sender>
10
- <SentDateTime>20111111</SentDateTime>
11
- </Header>
12
- <Product>
13
- <RecordReference>fdb8fa072be774d97a97</RecordReference>
14
- <NotificationType>03</NotificationType>
15
- <ProductIdentifier>
16
- <ProductIDType>15</ProductIDType>
17
- <IDValue>9788324799992</IDValue>
18
- </ProductIdentifier>
19
- <DescriptiveDetail>
20
- <ProductComposition>00</ProductComposition>
21
- <ProductForm>BA</ProductForm>
22
- <TitleDetail>
23
- <TitleType>01</TitleType>
24
- <TitleElement>
25
- <TitleElementLevel>01</TitleElementLevel>
26
- <TitleText>Nielegalni</TitleText>
27
- </TitleElement>
28
- </TitleDetail>
29
- </DescriptiveDetail>
30
- <PublishingDetail>
31
- <Publisher>
32
- <PublishingRole>01</PublishingRole>
33
- <PublisherIdentifier>
34
- <PublisherIDType>01</PublisherIDType>
35
- <IDTypeName>ElibriPublisherCode</IDTypeName>
36
- <IDValue>11</IDValue>
37
- </PublisherIdentifier>
38
- <PublisherName>GREG</PublisherName>
39
- </Publisher>
40
- <CityOfPublication>Warszawa</CityOfPublication>
41
- <PublishingStatus>04</PublishingStatus>
42
- <SalesRights>
43
- <SalesRightsType>01</SalesRightsType>
44
- <Territory>
45
- <RegionsIncluded>WORLD</RegionsIncluded>
46
- </Territory>
47
- </SalesRights>
48
- </PublishingDetail>
49
- <elibri:CoverType>miękka</elibri:CoverType>
50
- <elibri:CoverPrice>12.99</elibri:CoverPrice>
51
- <elibri:Vat>5</elibri:Vat>
52
- <elibri:PKWiU>58.11.1</elibri:PKWiU>
53
- <elibri:preview_exists>true</elibri:preview_exists>
54
- <elibri:PDWExclusiveness>VIC</elibri:PDWExclusiveness>
55
- <elibri:AdditionalInfo>PROMOCJA!</elibri:AdditionalInfo>
56
- </Product>
57
- </ONIXMessage>