elibri_onix 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - ree
4
+ - 1.9.2
5
+ - 1.8.7
6
+ notifications:
7
+ email:
8
+ - p.szmielew@ava.waw.pl
9
+ - tomek@gildia.pl
data/README.rdoc CHANGED
@@ -1,5 +1,11 @@
1
1
  = elibri_onix
2
2
 
3
+ == Build status
4
+
5
+ {<img src="https://secure.travis-ci.org/elibri/elibri_onix.png?branch=master" alt="Build Status" />}[http://travis-ci.org/elibri/elibri_onix]
6
+
7
+ == Description
8
+
3
9
  Description goes here.
4
10
 
5
11
  == Contributing to elibri_onix
data/elibri_onix.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{elibri_onix}
8
- s.version = "0.1.12"
8
+ s.version = "0.1.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marcin Urbanski"]
12
- s.date = %q{2012-03-16}
12
+ s.date = %q{2012-05-01}
13
13
  s.description = %q{EDItEUR ONIX format subset implementation used in Elibri publication system}
14
14
  s.email = %q{marcin@urbanski.vdl.pl}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
+ ".travis.yml",
21
22
  "Gemfile",
22
23
  "Gemfile.lock",
23
24
  "LICENSE.txt",
@@ -58,6 +59,7 @@ Gem::Specification.new do |s|
58
59
  "lib/elibri_onix/releases.rb",
59
60
  "lib/elibri_onix/version.rb",
60
61
  "test/elibri_audience_range_test.rb",
62
+ "test/elibri_categories_test.rb",
61
63
  "test/elibri_contributors_test.rb",
62
64
  "test/elibri_edition_test.rb",
63
65
  "test/elibri_extensions_test.rb",
@@ -80,6 +82,7 @@ Gem::Specification.new do |s|
80
82
  "test/fixtures/onix_announced_product_example.xml",
81
83
  "test/fixtures/onix_audience_range_example.xml",
82
84
  "test/fixtures/onix_audiobook_extent_example.xml",
85
+ "test/fixtures/onix_categories_example.xml",
83
86
  "test/fixtures/onix_collective_work_example.xml",
84
87
  "test/fixtures/onix_contributors_example.xml",
85
88
  "test/fixtures/onix_ebook_extent_example.xml",
@@ -9,7 +9,8 @@ module Elibri
9
9
  attr_accessor :elibri_dialect, :height, :width, :thickness, :weight, :ean, :isbn13, :number_of_pages, :duration,
10
10
  :file_size, :publisher_name, :publisher_id, :imprint_name, :current_state, :reading_age_from, :reading_age_to,
11
11
  :table_of_contents, :description, :reviews, :excerpts, :series, :title, :subtitle, :collection_title,
12
- :collection_part, :full_title, :original_title, :trade_title, :parsed_publishing_date
12
+ :collection_part, :full_title, :original_title, :trade_title, :parsed_publishing_date,
13
+ :elibri_product_category1_id, :elibri_product_category2_id
13
14
 
14
15
 
15
16
  xml_name 'Product'
@@ -189,6 +190,9 @@ module Elibri
189
190
  @full_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTINCTIVE_TITLE).try(:full_title)
190
191
  @original_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::ORIGINAL_TITLE).try(:full_title)
191
192
  @trade_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTRIBUTORS_TITLE).try(:full_title)
193
+
194
+ @elibri_product_category1_id = subjects[0].code if subjects[0]
195
+ @elibri_product_category2_id = subjects[1].code if subjects[1]
192
196
  compute_state!
193
197
  parse_publishing_date!
194
198
  end
@@ -4,7 +4,7 @@ module Elibri
4
4
  module Version
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- PATCH = 12
7
+ PATCH = 13
8
8
 
9
9
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
10
10
  end
@@ -0,0 +1,18 @@
1
+ # coding: utf-8
2
+
3
+ require 'helper'
4
+
5
+ describe Elibri::ONIX::Release_3_0::ONIXMessage do
6
+
7
+ it "should be able to parse categories informations stored in Elibri" do
8
+ product = load_fixture("onix_categories_example.xml")
9
+ assert_equal 2, product.subjects.size
10
+
11
+ assert_equal "1110", product.subjects[0].code
12
+ assert_equal "1110", product.elibri_product_category1_id
13
+ assert_equal "Historia / II Wojna Światowa / Ruch oporu", product.subjects[0].heading_text
14
+
15
+ assert_equal "491", product.elibri_product_category2_id
16
+ end
17
+
18
+ end
@@ -1,3 +1,4 @@
1
+ #encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  describe Elibri::ONIX::Release_3_0::ONIXMessage do
@@ -1,3 +1,4 @@
1
+ #encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  describe Elibri::ONIX::Release_3_0::ONIXMessage do
@@ -1,3 +1,4 @@
1
+ #encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
 
@@ -1,3 +1,4 @@
1
+ #encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  describe Elibri::ONIX::Release_3_0::ONIXMessage do
@@ -1,3 +1,4 @@
1
+ #encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  describe Elibri::ONIX::Release_3_0::ONIXMessage do
@@ -1,3 +1,4 @@
1
+ #encoding: UTF-8
1
2
  require 'helper'
2
3
 
3
4
  describe Elibri::ONIX::Release_3_0::ONIXMessage do
@@ -0,0 +1,59 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ONIXMessage release="3.0" xmlns:elibri="http://elibri.com.pl/ns/extensions" xmlns="http://ns.editeur.org/onix/3.0/reference">
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>20120501</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
+ <Subject>
30
+ <MainSubject/>
31
+ <SubjectSchemeIdentifier>24</SubjectSchemeIdentifier>
32
+ <SubjectSchemeName>elibri.com.pl</SubjectSchemeName>
33
+ <SubjectSchemeVersion>1.0</SubjectSchemeVersion>
34
+ <SubjectCode>1110</SubjectCode>
35
+ <SubjectHeadingText>Historia / II Wojna Światowa / Ruch oporu</SubjectHeadingText>
36
+ </Subject>
37
+ <Subject>
38
+ <SubjectSchemeIdentifier>24</SubjectSchemeIdentifier>
39
+ <SubjectSchemeName>elibri.com.pl</SubjectSchemeName>
40
+ <SubjectSchemeVersion>1.0</SubjectSchemeVersion>
41
+ <SubjectCode>491</SubjectCode>
42
+ <SubjectHeadingText>Szkoła i nauczanie / Lektury szkolne z opracowaniami</SubjectHeadingText>
43
+ </Subject>
44
+ </DescriptiveDetail>
45
+ <PublishingDetail>
46
+ <Publisher>
47
+ <PublishingRole>01</PublishingRole>
48
+ <PublisherIdentifier>
49
+ <PublisherIDType>01</PublisherIDType>
50
+ <IDTypeName>ElibriPublisherCode</IDTypeName>
51
+ <IDValue>11</IDValue>
52
+ </PublisherIdentifier>
53
+ <PublisherName>GREG</PublisherName>
54
+ </Publisher>
55
+ <PublishingStatus>04</PublishingStatus>
56
+ </PublishingDetail>
57
+ <elibri:preview_exists>false</elibri:preview_exists>
58
+ </Product>
59
+ </ONIXMessage>
data/test/helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # coding: utf-8
2
+
1
3
  require 'rubygems'
2
4
  require 'bundler'
3
5
  begin
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 12
10
- version: 0.1.12
9
+ - 13
10
+ version: 0.1.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marcin Urbanski
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-16 00:00:00 +01:00
18
+ date: 2012-05-01 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -179,6 +179,7 @@ extra_rdoc_files:
179
179
  - README.rdoc
180
180
  files:
181
181
  - .document
182
+ - .travis.yml
182
183
  - Gemfile
183
184
  - Gemfile.lock
184
185
  - LICENSE.txt
@@ -219,6 +220,7 @@ files:
219
220
  - lib/elibri_onix/releases.rb
220
221
  - lib/elibri_onix/version.rb
221
222
  - test/elibri_audience_range_test.rb
223
+ - test/elibri_categories_test.rb
222
224
  - test/elibri_contributors_test.rb
223
225
  - test/elibri_edition_test.rb
224
226
  - test/elibri_extensions_test.rb
@@ -241,6 +243,7 @@ files:
241
243
  - test/fixtures/onix_announced_product_example.xml
242
244
  - test/fixtures/onix_audience_range_example.xml
243
245
  - test/fixtures/onix_audiobook_extent_example.xml
246
+ - test/fixtures/onix_categories_example.xml
244
247
  - test/fixtures/onix_collective_work_example.xml
245
248
  - test/fixtures/onix_contributors_example.xml
246
249
  - test/fixtures/onix_ebook_extent_example.xml