elibri_onix 0.2.12 → 0.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- elibri_onix (0.2.12)
4
+ elibri_onix (0.2.13)
5
5
  activesupport (>= 2.3.5)
6
6
  elibri_onix_dict (>= 0.0.5)
7
7
  i18n
@@ -15,7 +15,7 @@ GEM
15
15
  multi_json (~> 1.0)
16
16
  coderay (1.0.6)
17
17
  elibri_onix_dict (0.0.22)
18
- i18n (0.6.4)
18
+ i18n (0.6.5)
19
19
  json (1.7.6)
20
20
  json (1.7.6-java)
21
21
  metaclass (0.0.1)
@@ -24,7 +24,7 @@ GEM
24
24
  minitest (3.0.1)
25
25
  mocha (0.11.4)
26
26
  metaclass (~> 0.0.1)
27
- multi_json (1.7.7)
27
+ multi_json (1.8.2)
28
28
  nokogiri (1.6.0)
29
29
  mini_portile (~> 0.5.0)
30
30
  pry (0.9.9.6)
@@ -13,7 +13,11 @@ module ExternalId
13
13
  end
14
14
 
15
15
  def eid
16
- @id_before_type_cast.split(":")[1].to_i
16
+ begin
17
+ @id_before_type_cast.split(":")[1].to_i
18
+ rescue
19
+ nil
20
+ end
17
21
  end
18
22
 
19
23
  def id
@@ -2,7 +2,7 @@ module Elibri
2
2
  module ONIX
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "0.2.12"
5
+ VERSION = "0.2.13"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
@@ -0,0 +1,26 @@
1
+ #encoding: UTF-8
2
+ require 'helper'
3
+
4
+ describe Elibri::ONIX::Release_3_0::ONIXMessage do
5
+
6
+ it "should be able to parse contributors info" do
7
+ product = load_fixture("onix_published_group_product_example.xml")
8
+
9
+ assert !product.no_contributor?
10
+ assert product.unnamed_persons?
11
+
12
+ cont1 = product.contributors[0]
13
+ cont2 = product.contributors[1]
14
+
15
+ # assert_equal "contributorid:255", cont1.id_before_type_cast
16
+ assert_nil cont1.eid
17
+ assert_nil cont1.datestamp_before_type_cast
18
+
19
+ assert_equal "author", cont1.role_name
20
+ assert_equal nil, cont1.person_name
21
+ assert_equal ["praca zbiorowa"], product.authors
22
+ assert !cont1.biographical_note.present?
23
+
24
+ end
25
+
26
+ end
@@ -0,0 +1,55 @@
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>Taka jest nasza wiara</TitleText>
27
+ </TitleElement>
28
+ </TitleDetail>
29
+ <Contributor>
30
+ <ContributorRole>A01</ContributorRole>
31
+ <UnnamedPersons>04</UnnamedPersons>
32
+ </Contributor>
33
+ </DescriptiveDetail>
34
+ <PublishingDetail>
35
+ <Publisher>
36
+ <PublishingRole>01</PublishingRole>
37
+ <PublisherIdentifier>
38
+ <PublisherIDType>01</PublisherIDType>
39
+ <IDTypeName>ElibriPublisherCode</IDTypeName>
40
+ <IDValue>11</IDValue>
41
+ </PublisherIdentifier>
42
+ <PublisherName>GREG</PublisherName>
43
+ </Publisher>
44
+ <CityOfPublication>Warszawa</CityOfPublication>
45
+ <PublishingStatus>04</PublishingStatus>
46
+ <SalesRights>
47
+ <SalesRightsType>01</SalesRightsType>
48
+ <Territory>
49
+ <RegionsIncluded>WORLD</RegionsIncluded>
50
+ </Territory>
51
+ </SalesRights>
52
+ </PublishingDetail>
53
+ <elibri:preview_exists>false</elibri:preview_exists>
54
+ </Product>
55
+ </ONIXMessage>
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.2.12
4
+ version: 0.2.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-07-26 00:00:00.000000000 Z
13
+ date: 2013-12-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -238,6 +238,7 @@ files:
238
238
  - test/elibri_extensions_test.rb
239
239
  - test/elibri_extent_test.rb
240
240
  - test/elibri_formats_and_protection_test.rb
241
+ - test/elibri_group_contributor_test.rb
241
242
  - test/elibri_languages_test.rb
242
243
  - test/elibri_licence_information_test.rb
243
244
  - test/elibri_measurement_test.rb
@@ -273,6 +274,7 @@ files:
273
274
  - test/fixtures/onix_out_of_print_product_example.xml
274
275
  - test/fixtures/onix_preorder_product_example.xml
275
276
  - test/fixtures/onix_product_form_example.xml
277
+ - test/fixtures/onix_published_group_product_example.xml
276
278
  - test/fixtures/onix_published_product_example.xml
277
279
  - test/fixtures/onix_publisher_info_example.xml
278
280
  - test/fixtures/onix_record_identifiers_example.xml
@@ -301,7 +303,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
301
303
  version: '0'
302
304
  segments:
303
305
  - 0
304
- hash: -2082582836940986665
306
+ hash: 3259318260067271762
305
307
  required_rubygems_version: !ruby/object:Gem::Requirement
306
308
  none: false
307
309
  requirements:
@@ -310,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
310
312
  version: '0'
311
313
  segments:
312
314
  - 0
313
- hash: -2082582836940986665
315
+ hash: 3259318260067271762
314
316
  requirements: []
315
317
  rubyforge_project:
316
318
  rubygems_version: 1.8.25
@@ -326,6 +328,7 @@ test_files:
326
328
  - test/elibri_extensions_test.rb
327
329
  - test/elibri_extent_test.rb
328
330
  - test/elibri_formats_and_protection_test.rb
331
+ - test/elibri_group_contributor_test.rb
329
332
  - test/elibri_languages_test.rb
330
333
  - test/elibri_licence_information_test.rb
331
334
  - test/elibri_measurement_test.rb
@@ -361,6 +364,7 @@ test_files:
361
364
  - test/fixtures/onix_out_of_print_product_example.xml
362
365
  - test/fixtures/onix_preorder_product_example.xml
363
366
  - test/fixtures/onix_product_form_example.xml
367
+ - test/fixtures/onix_published_group_product_example.xml
364
368
  - test/fixtures/onix_published_product_example.xml
365
369
  - test/fixtures/onix_publisher_info_example.xml
366
370
  - test/fixtures/onix_record_identifiers_example.xml