elibri_onix 0.5.3 → 0.5.4

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: 30ec7019130d683e54e567c7db336f7b5f238c4d4c337a47b0e042f2a87c294d
4
- data.tar.gz: 53466c5357b02f59c8c0711c8cba38209fcac581c168a6e132fd7edfd4a35129
3
+ metadata.gz: 268ca1ab2c2b63e995f2aa816d90c0b947ccdb8aafe6996952a7f9b51c0adf1a
4
+ data.tar.gz: 887617be809254210ed43320c55c4a471466e9d2c8cd03407825754eb13a27f1
5
5
  SHA512:
6
- metadata.gz: 1b149cc3c4cfb3c4bd633d56298d0e639b52bdb17f22a9c178279dda902b7fa44b03af4fb9b09485bdadec2ec86d5c5b252a3c1b2f71e9fb55d669284174d860
7
- data.tar.gz: 2f38194056ee21cc86a7436cec7f9b52069aec06c76ffc5e8f2d7acd90d1ead72ad4f9fc4a0483d4280d11eebe58f76f21d0f90538d6d0e78595c30a863eae94
6
+ metadata.gz: 3f78fcd552c578ca293647738d8c3cad126e49e96eac2092df91124e9e365ff34f2f1cd9c4c348a4246c22a7a27286c1c846af289a10baab2131e5b6204feefc
7
+ data.tar.gz: dacec693e3a2ff45d2ae30c3cf78578d7158c58c08c60b8d88bc4bde143dca5907131cfa519487fb5257149e2e9268a7ac50f2e3266612a464792237394218c2
@@ -306,32 +306,6 @@ module Elibri
306
306
  after_parse
307
307
  end
308
308
 
309
- def self.determine_cover_type(product_form, product_form_detail)
310
- if product_form == "BG"
311
- "skórzana"
312
- elsif product_form == "BP"
313
- "gąbka"
314
- elsif product_form == "BC"
315
- if product_form_detail == "B504"
316
- "miękka ze skrzydełkami"
317
- elsif product_form_detail == "B412"
318
- "zintegrowana"
319
- else
320
- "miękka"
321
- end
322
- elsif product_form == "BB"
323
- if product_form_detail == "B501"
324
- "twarda z obwolutą"
325
- elsif product_form_detail == "B415"
326
- "twarda lakierowana"
327
- elsif product_form_detail == "B413"
328
- "plastikowa"
329
- else
330
- "twarda"
331
- end
332
- end
333
- end
334
-
335
309
  def licence_information_setup(data)
336
310
  if data.namespaces.values.any? { |uri| uri =~ /elibri/ } && (data.at_xpath("elibri:SaleNotRestricted") || data.at_xpath("elibri:SaleRestrictedTo"))
337
311
  if data.at_xpath("elibri:SaleNotRestricted")
@@ -360,7 +334,7 @@ module Elibri
360
334
  @product_composition = data.at_css('ProductComposition').try(:text)
361
335
  @product_form = data.at_css('ProductForm').text
362
336
  if @product_form.starts_with?("B") && !@cover_type
363
- @cover_type = self.class.determine_cover_type(@product_form, data.at_css('ProductFormDetail').try(:text))
337
+ @cover_type = Elibri::ONIX::Dict::CoverType.determine_cover_type(@product_form, data.at_css('ProductFormDetail').try(:text))
364
338
  end
365
339
  if Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(@product_form)
366
340
  @product_form_name = Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(@product_form).name(:en).downcase
@@ -2,7 +2,7 @@ module Elibri
2
2
  module ONIX
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "0.5.3"
5
+ VERSION = "0.5.4"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
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.3
4
+ version: 0.5.4
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-05 00:00:00.000000000 Z
12
+ date: 2019-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 0.0.50
62
+ version: 0.0.60
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - ">="
68
68
  - !ruby/object:Gem::Version
69
- version: 0.0.50
69
+ version: 0.0.60
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: pry
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +202,6 @@ files:
202
202
  - lib/elibri_onix/onix_3_0/title_element.rb
203
203
  - lib/elibri_onix/releases.rb
204
204
  - lib/elibri_onix/version.rb
205
- - test/cover_test.rb
206
205
  - test/elibri_audience_range_test.rb
207
206
  - test/elibri_audiobook_test.rb
208
207
  - test/elibri_contributors_test.rb
@@ -1,18 +0,0 @@
1
- require 'helper'
2
-
3
-
4
- describe "CoverType" do
5
-
6
- it "should be able to determine the cover type" do
7
- assert_equal "gąbka", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BF", nil)
8
- assert_equal "miękka", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BC", nil)
9
- assert_equal "miękka ze skrzydełkami", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BC", "B504")
10
- assert_equal "plastikowa", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", "B413")
11
- assert_equal "skórzana", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BG", nil)
12
- assert_equal "twarda", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", nil)
13
- assert_equal "twarda lakierowana", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", "B415")
14
- assert_equal "twarda z obwolutą", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BB", "B501")
15
- assert_equal "zintegrowana", Elibri::ONIX::Release_3_0::Product.determine_cover_type("BC", "B412")
16
- end
17
-
18
- end