elibri_onix 0.2.15 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2f50418e1d4a6edd648711bece18f570753b2c60
4
+ data.tar.gz: 2d864edd6ccbebe1e5c662e650ac5631928e4f42
5
+ SHA512:
6
+ metadata.gz: 8410b5f01f6b3fe54b44e16de387527595a0593e32bfb71c59095afb590034ed4800ca3b5ad7b513651fe1015b6d239978150f4c9b8b38a46ef2c716cb208b25
7
+ data.tar.gz: 2a245f1a4ea879f25fa50dc0c12fc723cd2f34a71ee99369916a0d0d7b869d20c8f83740a226d9d29104a328678e146158fadae13d422bbce2285ae40446202c
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ /Gemfile.lock
1
2
  # rcov generated
2
3
  coverage
3
4
 
data/.travis.yml CHANGED
@@ -1,12 +1,4 @@
1
1
  language: ruby
2
2
  rvm:
3
- - ree
4
- - 1.8.7
5
- - 1.9.2
6
- - 1.9.3
7
- - jruby-18mode
3
+ - 2.1.5
8
4
  - jruby-19mode
9
- notifications:
10
- email:
11
- - p.szmielew@ava.waw.pl
12
- - tomek@gildia.pl
data/FIELDS.rdoc CHANGED
@@ -58,7 +58,7 @@ type, minimum_order_quantity, amount, currency_code, printed_on_product, positio
58
58
 
59
59
  == Product
60
60
  === Attributes
61
- elibri_dialect, height, width, thickness, weight, ean, isbn13, number_of_pages, duration, file_size, publisher_name, publisher_id, imprint_name, current_state, reading_age_from, reading_age_to, table_of_contents, description, reviews, excerpts, series, title, subtitle, collection_title, collection_part, full_title, original_title, trade_title, parsed_publishing_date, record_reference, deletion_text, cover_type, cover_price, vat, pkwiu, product_composition, product_form, imprint, publisher, product_form, no_contributor, edition_statement, number_of_illustrations, publishing_status, publishing_date, premiere, front_cover, series_names, elibri_product_category1_id, elibri_product_category2_id, preview_exists, short_description
61
+ elibri_dialect, height, width, thickness, weight, ean, isbn13, number_of_pages, duration, file_size, publisher_name, publisher_id, imprint_name, current_state, reading_age_from, reading_age_to, table_of_contents, description, reviews, excerpts, series, title, subtitle, collection_title, collection_part, full_title, original_title, trade_title, parsed_publishing_date, record_reference, deletion_text, cover_type, cover_price, vat, pkwiu, pdw_exclusiveness, product_composition, product_form, imprint, publisher, product_form, no_contributor, edition_statement, number_of_illustrations, publishing_status, publishing_date, premiere, front_cover, series_names, elibri_product_category1_id, elibri_product_category2_id, preview_exists, short_description
62
62
  === Relations
63
63
  contributors, related_products, languages, measures, supply_details, measures, title_details, collections, extents, subjects, audience_ranges, text_contents, supporting_resources, sales_restrictions, authors, ghostwriters, scenarists, originators, illustrators, photographers, author_of_prefaces, drawers, cover_designers, inked_or_colored_bys, editors, revisors, translators, editor_in_chiefs, read_bys
64
64
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- elibri_onix (0.2.14)
4
+ elibri_onix (0.3.0)
5
5
  activesupport (>= 2.3.5)
6
6
  elibri_onix_dict (>= 0.0.5)
7
7
  i18n
@@ -10,23 +10,24 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (3.2.17)
13
+ activesupport (3.2.22.5)
14
14
  i18n (~> 0.6, >= 0.6.4)
15
15
  multi_json (~> 1.0)
16
16
  coderay (1.0.6)
17
- elibri_onix_dict (0.0.24)
18
- i18n (0.6.11)
17
+ elibri_onix_dict (0.0.28)
18
+ i18n (0.8.1)
19
19
  json (1.7.6)
20
20
  json (1.7.6-java)
21
21
  metaclass (0.0.1)
22
22
  method_source (0.7.1)
23
- mini_portile (0.5.3)
23
+ mini_portile2 (2.1.0)
24
24
  minitest (3.0.1)
25
25
  mocha (0.11.4)
26
26
  metaclass (~> 0.0.1)
27
- multi_json (1.10.1)
28
- nokogiri (1.6.1)
29
- mini_portile (~> 0.5.0)
27
+ multi_json (1.12.1)
28
+ nokogiri (1.7.2)
29
+ mini_portile2 (~> 2.1.0)
30
+ nokogiri (1.7.2-java)
30
31
  pry (0.9.9.6)
31
32
  coderay (~> 1.0.5)
32
33
  method_source (~> 0.7.1)
@@ -54,3 +55,6 @@ DEPENDENCIES
54
55
  pry
55
56
  rake
56
57
  rdoc
58
+
59
+ BUNDLED WITH
60
+ 1.11.2
@@ -5,7 +5,7 @@ module Elibri
5
5
  #Klasa reprezentująca produkt
6
6
  #Niektóre pola mogą pozostać bez wartości - zależy to od formy produktu
7
7
  class Product
8
-
8
+
9
9
  include Inspector
10
10
 
11
11
  #:nodoc:
@@ -21,7 +21,7 @@ module Elibri
21
21
  :elibri_product_category1_id, :elibri_product_category2_id, :preview_exists, :short_description, :sale_restricted_to_poland,
22
22
  :technical_protection_onix_code, :unlimited_licence, :hyphenated_isbn, :preorder_embargo_date
23
23
  ]
24
-
24
+
25
25
  #:nodoc:
26
26
  RELATIONS =
27
27
  [
@@ -56,7 +56,7 @@ module Elibri
56
56
 
57
57
  #ean, jeśli jest inny, niż isbn13
58
58
  attr_reader :ean
59
-
59
+
60
60
  #isbn13 - bez kresek
61
61
  attr_reader :isbn13
62
62
 
@@ -133,13 +133,13 @@ module Elibri
133
133
  #sposób zabezpieczania pliki (DRM, WATERMARK) - pliki dostępne w API transakcyjnym zawsze będą chronione watermarkiem
134
134
  attr_reader :technical_protection
135
135
  attr_reader :technical_protection_onix_code
136
-
136
+
137
137
  #record reference - wewnętrzny identyfikator rekordu, niezmienny i unikatowy
138
138
  attr_reader :record_reference
139
139
 
140
140
  #typ okładki, np. 'miękka ze skrzydełkami'
141
141
  attr_reader :cover_type
142
-
142
+
143
143
  #sugerowana cena detaliczna brutto produktu
144
144
  attr_reader :cover_price
145
145
 
@@ -149,6 +149,9 @@ module Elibri
149
149
  #PKWiU
150
150
  attr_reader :pkwiu
151
151
 
152
+ #PDWExclusiveness
153
+ attr_reader :pdw_exclusiveness
154
+
152
155
  #kod ONIX typu produktu, np. 'BA' - lista dostępna pod adresem
153
156
  #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml
154
157
  attr_reader :product_form
@@ -156,10 +159,10 @@ module Elibri
156
159
  #nazwa typu produktu, małe litery, np. 'book' - patrz pełna lista pod adresem
157
160
  #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml
158
161
  attr_reader :product_form_name
159
-
162
+
160
163
  #lista autorów, tłumaczy i innych, którzy mieli wkład w książkę, lista instancji Contributor
161
164
  attr_reader :contributors
162
-
165
+
163
166
  #lista języków, lista intancji Language
164
167
  attr_reader :languages
165
168
 
@@ -233,9 +236,9 @@ module Elibri
233
236
  @audience_ranges = []
234
237
  ##publishing_details
235
238
  @sales_restrictions = []
236
-
239
+
237
240
  #moving to parsing attributes
238
-
241
+
239
242
  @elibri_dialect = data.at_xpath('//elibri:Dialect').try(:text)
240
243
  @record_reference = data.at_xpath('xmlns:RecordReference').try(:text)
241
244
  @notification_type = data.at_xpath('xmlns:NotificationType').try(:text)
@@ -245,6 +248,7 @@ module Elibri
245
248
  @vat = data.at_xpath('elibri:Vat').try(:text).try(:to_i)
246
249
  @pkwiu = data.at_xpath('elibri:PKWiU').try(:text)
247
250
  @hyphenated_isbn = data.at_xpath('elibri:HyphenatedISBN').try(:text)
251
+ @pdw_exclusiveness = data.at_xpath('elibri:PDWExclusiveness').try(:text)
248
252
 
249
253
  @preview_exists = (data.at_xpath('elibri:preview_exists').try(:text) == "true")
250
254
  @identifiers = data.xpath('xmlns:ProductIdentifier').map { |ident_data| ProductIdentifier.new(ident_data) }
@@ -274,7 +278,7 @@ module Elibri
274
278
  end
275
279
  after_parse
276
280
  end
277
-
281
+
278
282
  def licence_information_setup(data)
279
283
  if data.at_xpath("elibri:SaleNotRestricted")
280
284
  @unlimited_licence = true
@@ -284,7 +288,7 @@ module Elibri
284
288
  @licence_limited_to = Date.new(date[0...4].to_i, date[4...6].to_i, date[6...8].to_i)
285
289
  end
286
290
  end
287
-
291
+
288
292
  def descriptive_details_setup(data)
289
293
  @product_composition = data.at_xpath('xmlns:ProductComposition').try(:text)
290
294
  @product_form = data.at_xpath('xmlns:ProductForm').try(:text)
@@ -305,7 +309,7 @@ module Elibri
305
309
  @digital_formats << Elibri::ONIX::Dict::Release_3_0::ProductFormDetail::find_by_onix_code(format.text).name.upcase.gsub("MOBIPOCKET", "MOBI")
306
310
  end
307
311
  end
308
-
312
+
309
313
  #zabezpiecznie pliku
310
314
  if protection = data.at_xpath("xmlns:EpubTechnicalProtection").try(:text)
311
315
  @technical_protection = Elibri::ONIX::Dict::Release_3_0::EpubTechnicalProtection::find_by_onix_code(protection).name
@@ -315,12 +319,12 @@ module Elibri
315
319
  @edition_statement = data.at_xpath('xmlns:EditionStatement').try(:text)
316
320
  @number_of_illustrations = data.at_xpath('xmlns:NumberOfIllustrations').try(:text).try(:to_i)
317
321
  end
318
-
322
+
319
323
  def collateral_details_setup(data)
320
324
  @text_contents = data.xpath('xmlns:TextContent').map { |text_detail| TextContent.new(text_detail) }
321
325
  @supporting_resources = data.xpath('xmlns:SupportingResource').map { |supporting_data| SupportingResource.new(supporting_data) }
322
326
  end
323
-
327
+
324
328
  def publishing_details_setup(data)
325
329
  @imprint = Imprint.new(data.at_xpath('xmlns:Imprint')) if data.at_xpath('xmlns:Imprint')
326
330
  @publisher = Publisher.new(data.at_xpath('xmlns:Publisher')) if data.at_xpath('xmlns:Publisher')
@@ -351,7 +355,7 @@ module Elibri
351
355
  def sale_restricted_to_poland?
352
356
  @sale_restricted_to_poland
353
357
  end
354
-
358
+
355
359
  #flaga informująca, czy licencja jest bezterminowa
356
360
  def unlimited_licence?
357
361
  @unlimited_licence
@@ -412,7 +416,7 @@ module Elibri
412
416
  def related_products_record_references
413
417
  related_products.map(&:record_reference)
414
418
  end
415
-
419
+
416
420
  #:nodoc:
417
421
  def proprietary_identifiers
418
422
  @identifiers.find_all { |i| i.identifier_type == "proprietary" }.inject({}) { |res, ident| res[ident.type_name] = ident.value; res }
@@ -470,14 +474,14 @@ module Elibri
470
474
  @full_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTINCTIVE_TITLE).try(:full_title)
471
475
  @original_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::ORIGINAL_TITLE).try(:full_title)
472
476
  @trade_title = find_title(Elibri::ONIX::Dict::Release_3_0::TitleType::DISTRIBUTORS_TITLE).try(:full_title)
473
-
477
+
474
478
  @elibri_product_category1_id = subjects[0].code if subjects[0]
475
479
  @elibri_product_category2_id = subjects[1].code if subjects[1]
476
480
 
477
481
  compute_state!
478
482
  end
479
483
 
480
-
484
+
481
485
 
482
486
  def compute_state!
483
487
  if @notification_type == "01"
@@ -2,7 +2,7 @@ module Elibri
2
2
  module ONIX
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "0.2.15"
5
+ VERSION = "0.3.0"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
@@ -5,11 +5,12 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
5
5
 
6
6
  it "should be able to parse elibri extensions" do
7
7
  product = load_fixture("onix_elibri_extensions_example.xml")
8
-
8
+
9
9
  assert_equal "miękka", product.cover_type
10
10
  assert_equal 12.99, product.cover_price
11
11
  assert_equal 5, product.vat
12
12
  assert_equal "58.11.1", product.pkwiu
13
+ assert_equal "VIC", product.pdw_exclusiveness
13
14
  assert product.preview_exists?
14
15
  end
15
16
 
@@ -51,5 +51,6 @@
51
51
  <elibri:Vat>5</elibri:Vat>
52
52
  <elibri:PKWiU>58.11.1</elibri:PKWiU>
53
53
  <elibri:preview_exists>true</elibri:preview_exists>
54
+ <elibri:PDWExclusiveness>VIC</elibri:PDWExclusiveness>
54
55
  </Product>
55
56
  </ONIXMessage>
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.15
5
- prerelease:
4
+ version: 0.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marcin Urbanski
@@ -10,166 +9,146 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2014-12-08 00:00:00.000000000 Z
12
+ date: 2017-05-18 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: activesupport
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: 2.3.5
23
21
  type: :runtime
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: 2.3.5
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: nokogiri
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0'
39
35
  type: :runtime
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: i18n
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - ">="
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - ">="
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: elibri_onix_dict
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - ">="
69
61
  - !ruby/object:Gem::Version
70
62
  version: 0.0.5
71
63
  type: :runtime
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - ">="
77
68
  - !ruby/object:Gem::Version
78
69
  version: 0.0.5
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: pry
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ! '>='
74
+ - - ">="
85
75
  - !ruby/object:Gem::Version
86
76
  version: '0'
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ! '>='
81
+ - - ">="
93
82
  - !ruby/object:Gem::Version
94
83
  version: '0'
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: mocha
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - ">="
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - ">="
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: minitest
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - ">="
117
103
  - !ruby/object:Gem::Version
118
104
  version: '0'
119
105
  type: :development
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
109
+ - - ">="
125
110
  - !ruby/object:Gem::Version
126
111
  version: '0'
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: bundler
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
- - - ! '>='
116
+ - - ">="
133
117
  - !ruby/object:Gem::Version
134
118
  version: 1.0.0
135
119
  type: :development
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
- - - ! '>='
123
+ - - ">="
141
124
  - !ruby/object:Gem::Version
142
125
  version: 1.0.0
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: rake
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
- - - ! '>='
130
+ - - ">="
149
131
  - !ruby/object:Gem::Version
150
132
  version: '0'
151
133
  type: :development
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
- - - ! '>='
137
+ - - ">="
157
138
  - !ruby/object:Gem::Version
158
139
  version: '0'
159
140
  - !ruby/object:Gem::Dependency
160
141
  name: rdoc
161
142
  requirement: !ruby/object:Gem::Requirement
162
- none: false
163
143
  requirements:
164
- - - ! '>='
144
+ - - ">="
165
145
  - !ruby/object:Gem::Version
166
146
  version: '0'
167
147
  type: :development
168
148
  prerelease: false
169
149
  version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
150
  requirements:
172
- - - ! '>='
151
+ - - ">="
173
152
  - !ruby/object:Gem::Version
174
153
  version: '0'
175
154
  description: EDItEUR ONIX format subset implementation used in Elibri publication
@@ -184,8 +163,8 @@ extra_rdoc_files:
184
163
  - README.rdoc
185
164
  - FIELDS.rdoc
186
165
  files:
187
- - .gitignore
188
- - .travis.yml
166
+ - ".gitignore"
167
+ - ".travis.yml"
189
168
  - FIELDS.rdoc
190
169
  - Gemfile
191
170
  - Gemfile.lock
@@ -291,27 +270,26 @@ files:
291
270
  homepage: http://github.com/elibri/elibri_onix
292
271
  licenses:
293
272
  - MIT
273
+ metadata: {}
294
274
  post_install_message:
295
275
  rdoc_options: []
296
276
  require_paths:
297
277
  - lib
298
278
  required_ruby_version: !ruby/object:Gem::Requirement
299
- none: false
300
279
  requirements:
301
- - - ! '>='
280
+ - - ">="
302
281
  - !ruby/object:Gem::Version
303
282
  version: '0'
304
283
  required_rubygems_version: !ruby/object:Gem::Requirement
305
- none: false
306
284
  requirements:
307
- - - ! '>='
285
+ - - ">="
308
286
  - !ruby/object:Gem::Version
309
287
  version: '0'
310
288
  requirements: []
311
289
  rubyforge_project:
312
- rubygems_version: 1.8.23
290
+ rubygems_version: 2.4.8
313
291
  signing_key:
314
- specification_version: 3
292
+ specification_version: 4
315
293
  summary: EDItEUR ONIX format subset implementation used in Elibri publication system
316
294
  test_files:
317
295
  - test/elibri_audience_range_test.rb
@@ -372,4 +350,3 @@ test_files:
372
350
  - test/fixtures/onix_titles_example.xml
373
351
  - test/fixtures/onix_unlimited_book_sample_example.xml
374
352
  - test/helper.rb
375
- has_rdoc: