elibri_onix_dict 0.0.79 → 0.1.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: 0cff5a5055eaf527e6f99f9f00f7271542f34eb73f56c988fc801625b3b13233
4
- data.tar.gz: 0dbdb3924553d38b5cc32d01f2cad75a06fbfa13d3074dff3c3d26771ccd406b
3
+ metadata.gz: 76b71ef7b46e12eef3ac3afffdb4ecf3cfd028e1780c5726a0db3547e32caa98
4
+ data.tar.gz: 98f5ddad33ec7287eeccaf3703d027a1cf4e57046f1f4569653d56e9008e73ba
5
5
  SHA512:
6
- metadata.gz: ea274b5ec5b329e405dd86911cd2da852edb5047a76050b0380b6a43ff45d001eeeaa159407962666e3b4468e3dfe23c5c26694ccc32cce1387704eeb90dfde3
7
- data.tar.gz: 052b5a34d4b424b8d8bd277bf76fcfac751241a3c1553c53c23e959978dbfdc102695076d47c042bfd6faec35715d55b0390f0f2fb24c507294dc9c571ac1bb1
6
+ metadata.gz: a7806b7ec0af6e1528c32a213d224ea5bc2ba37769c5af8d6b96d0fa9c3e0ce5a45cf229d6570322462addabe4caf940809cb3d63a61331ca56f512f0e3f9605
7
+ data.tar.gz: 9a33281b53b0e935ba8c941bd005c10d648bd7225bb9127ff95d5ae24fff36b4779c36a14efc8631761efe7ba481609722c4ae76364ac2558471a343f2ff42d2
@@ -1,5 +1,4 @@
1
1
  require 'yaml'
2
- require 'amatch'
3
2
 
4
3
  module Elibri
5
4
  module ONIX
@@ -12,7 +11,11 @@ module Elibri
12
11
 
13
12
 
14
13
  conf = File.expand_path(File.join(File.dirname(__FILE__), "cover_types.yml"))
15
- ALL = YAML::load_file(conf)
14
+ if RUBY_VERSION[0] == "2"
15
+ ALL = YAML::load_file(conf)
16
+ else
17
+ ALL = YAML::load_file(conf, permitted_classes: [Elibri::ONIX::Dict::CoverType])
18
+ end
16
19
 
17
20
  HARDBACK = 8
18
21
  PLASTIC = 6
@@ -31,21 +34,10 @@ module Elibri
31
34
  I18n::t("products.cover_type.#{matching_cover.key}") if matching_cover
32
35
  end
33
36
 
34
- # Znajdź w słowniku typ okładki, którego nazwa jest najbardziej podobna do podanego stringu.
35
- def self.most_similar_to(cover_name)
36
- if cover_name =~ /karton/
37
- return all.find { |c| c.name == "twarda" }
38
- else
39
- all.sort_by {|cover_type| cover_type.name.downcase.levenshtein_similar(cover_name.downcase) }.last
40
- end
41
- end
42
-
43
-
44
37
  def self.all
45
38
  ALL
46
39
  end
47
40
 
48
-
49
41
  end
50
42
  end
51
43
  end
@@ -6,3 +6,11 @@
6
6
  name:
7
7
  en: watermark
8
8
  pl: watermark
9
+
10
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::EpubTechnicalProtection
11
+ onix_code: '06'
12
+ const_name: LCP
13
+ name:
14
+ en: LCP
15
+ pl: LCP
16
+
@@ -335,3 +335,10 @@
335
335
  name:
336
336
  en: Sanskrit
337
337
  pl: sanskryt
338
+
339
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::LanguageCode
340
+ onix_code: szl
341
+ name:
342
+ en: Silesian
343
+ pl: śląski
344
+
@@ -0,0 +1,16 @@
1
+
2
+ ---
3
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::NameType
4
+ onix_code: '04'
5
+ const_name: REAL_NAME
6
+ name:
7
+ en: real name
8
+ pl: prawdziwe imię i nazwisko
9
+
10
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::NameType
11
+ onix_code: '07'
12
+ const_name: FICTIONAL_NAME
13
+ name:
14
+ en: fictional character name
15
+ pl: imię i nazwisko postaci fikcyjnej
16
+
@@ -0,0 +1,17 @@
1
+
2
+ ---
3
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::PriceDateRole
4
+ onix_code: '14'
5
+ const_name: FROM_DATE
6
+ name:
7
+ en: from date
8
+ pl: data od
9
+
10
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::PriceDateRole
11
+ onix_code: '15'
12
+ const_name: UNTIL_DATE
13
+ name:
14
+ en: until date
15
+ pl: data do
16
+
17
+
@@ -1,5 +1,5 @@
1
1
 
2
- ---
2
+ ---
3
3
  - !ruby/object:Elibri::ONIX::Dict::Release_3_0::ProductFormDetail
4
4
  onix_code: 'E101'
5
5
  const_name: EPUB
@@ -28,3 +28,10 @@
28
28
  en: MP3
29
29
  pl: MP3
30
30
 
31
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::ProductFormDetail
32
+ onix_code: 'A113'
33
+ const_name: LPF
34
+ name:
35
+ en: LPF
36
+ pl: LPF
37
+
@@ -1,5 +1,5 @@
1
1
 
2
- ---
2
+ ---
3
3
  - !ruby/object:Elibri::ONIX::Dict::Release_3_0::PublishingStatusCode
4
4
  onix_code: '00'
5
5
  const_name: UNSPECIFIED
@@ -21,6 +21,13 @@
21
21
  en: forthcoming
22
22
  pl: nadchodzący
23
23
 
24
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::PublishingStatusCode
25
+ onix_code: '03'
26
+ const_name: POSTPONED_INDEFINITELY
27
+ name:
28
+ en: postponed indefinitely
29
+ pl: publikacja wstrzymana
30
+
24
31
  - !ruby/object:Elibri::ONIX::Dict::Release_3_0::PublishingStatusCode
25
32
  onix_code: '04'
26
33
  const_name: ACTIVE
@@ -1,8 +1,36 @@
1
1
 
2
- ---
2
+ ---
3
3
  - !ruby/object:Elibri::ONIX::Dict::Release_3_0::UnnamedPersons
4
4
  onix_code: '04'
5
5
  const_name: VARIOUS_AUTHORS
6
6
  name:
7
7
  en: various authors
8
8
  pl: opracowanie zbiorowe
9
+
10
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::UnnamedPersons
11
+ onix_code: '05'
12
+ const_name: SYNTHESISED_VOICE_MALE
13
+ name:
14
+ en: "Synthesised voice – male"
15
+ pl: "Głos syntetyzowany - męski"
16
+
17
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::UnnamedPersons
18
+ onix_code: '06'
19
+ const_name: SYNTHESISED_VOICE_FEMALE
20
+ name:
21
+ en: "Synthesised voice – female"
22
+ pl: "Głos syntetyzowany - kobiecy"
23
+
24
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::UnnamedPersons
25
+ onix_code: '07'
26
+ const_name: SYNTHESISED_VOICE_UNSPECIFIED
27
+ name:
28
+ en: "Synthesised voice – female"
29
+ pl: "Głos syntetyzowany"
30
+
31
+ - !ruby/object:Elibri::ONIX::Dict::Release_3_0::UnnamedPersons
32
+ onix_code: '08'
33
+ const_name: SYNTHESISED_VOICE_BASED_ON_REAL_VOICE
34
+ name:
35
+ en: "Synthesised voice – based on real voice"
36
+ pl: "Głos syntetyzowany - bazujący na głosie aktora"
@@ -1,7 +1,7 @@
1
1
  module Elibri
2
2
  module ONIX
3
3
  module Dict
4
- VERSION = "0.0.79"
4
+ VERSION = "0.1.4"
5
5
  Version = VERSION
6
6
  end
7
7
  end
@@ -20,18 +20,23 @@ module Elibri
20
20
  klass = Class.new(Elibri::ONIX::Dict::Release_3_0::Base)
21
21
  # Elibri::ONIX::Dict::Release_3_0::ResourceMode
22
22
  const_set(klass_name, klass)
23
- klass.const_set(:ALL, YAML::load_file(file))
23
+
24
+ if RUBY_VERSION[0] == "2"
25
+ klass.const_set(:ALL, YAML::load_file(file))
26
+ else
27
+ klass.const_set(:ALL, YAML::load_file(file, permitted_classes: [klass]))
28
+ end
24
29
 
25
30
  klass::ALL.each do |dict_item|
26
31
  klass.const_set(dict_item.const_name, dict_item.onix_code) if dict_item.const_name
27
- end
28
- end
32
+ end
33
+ end
29
34
  end
30
-
35
+
31
36
  end
32
37
 
33
38
  Release_3_0.load_dictionaries!
34
-
39
+
35
40
  end
36
41
  end
37
42
  end
@@ -9,10 +9,6 @@ describe Elibri::ONIX::Dict::Release_3_0 do
9
9
  assert_equal 19, Elibri::ONIX::Dict::Release_3_0::ProductFormCode::ALL.size
10
10
  assert_equal 17, Elibri::ONIX::Dict::Release_3_0::ProductFormCode.all_except('BA', 'EA').size
11
11
  assert_equal 'BA', Elibri::ONIX::Dict::Release_3_0::ProductFormCode::BOOK
12
- assert_equal '02', Elibri::ONIX::Dict::Release_3_0::EpubUsageStatus::LIMITED
13
- assert_equal '01', Elibri::ONIX::Dict::Release_3_0::EpubUsageType::PREVIEW
14
- assert_equal '05', Elibri::ONIX::Dict::Release_3_0::EpubUsageUnit::PERCENTAGE
15
-
16
12
  assert_equal '27', Elibri::ONIX::Dict::Release_3_0::PublishingDateRole::PREORDER_EMBARGO_DATE
17
13
 
18
14
  form = Elibri::ONIX::Dict::Release_3_0::ProductFormCode.find_by_onix_code('BA')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix_dict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.79
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Urbanski
@@ -10,20 +10,6 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2012-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: amatch
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: pry
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +44,28 @@ dependencies:
58
44
  requirements:
59
45
  - - ">="
60
46
  - !ruby/object:Gem::Version
61
- version: 1.0.0
47
+ version: '0'
62
48
  type: :development
63
49
  prerelease: false
64
50
  version_requirements: !ruby/object:Gem::Requirement
65
51
  requirements:
66
52
  - - ">="
67
53
  - !ruby/object:Gem::Version
68
- version: 1.0.0
54
+ version: '0'
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: jeweler
71
57
  requirement: !ruby/object:Gem::Requirement
72
58
  requirements:
73
- - - "~>"
59
+ - - ">="
74
60
  - !ruby/object:Gem::Version
75
- version: 1.6.2
61
+ version: '0'
76
62
  type: :development
77
63
  prerelease: false
78
64
  version_requirements: !ruby/object:Gem::Requirement
79
65
  requirements:
80
- - - "~>"
66
+ - - ">="
81
67
  - !ruby/object:Gem::Version
82
- version: 1.6.2
68
+ version: '0'
83
69
  description: EDItEUR ONIX format dictionary helpers used in eLibri publication system
84
70
  email:
85
71
  - marcin@urbanski.vdl.pl
@@ -115,8 +101,10 @@ files:
115
101
  - lib/elibri_onix_dict/onix_3_0/serialized/LanguageRole.yml
116
102
  - lib/elibri_onix_dict/onix_3_0/serialized/MeasureType.yml
117
103
  - lib/elibri_onix_dict/onix_3_0/serialized/NameIdentifier.yml
104
+ - lib/elibri_onix_dict/onix_3_0/serialized/NameType.yml
118
105
  - lib/elibri_onix_dict/onix_3_0/serialized/NotificationType.yml
119
106
  - lib/elibri_onix_dict/onix_3_0/serialized/OtherTextType.yml
107
+ - lib/elibri_onix_dict/onix_3_0/serialized/PriceDateRole.yml
120
108
  - lib/elibri_onix_dict/onix_3_0/serialized/PricePositionOnProduct.yml
121
109
  - lib/elibri_onix_dict/onix_3_0/serialized/PricePrintedOnProduct.yml
122
110
  - lib/elibri_onix_dict/onix_3_0/serialized/PriceTypeCode.yml
@@ -174,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
162
  - !ruby/object:Gem::Version
175
163
  version: '0'
176
164
  requirements: []
177
- rubygems_version: 3.0.1
165
+ rubygems_version: 3.1.6
178
166
  signing_key:
179
167
  specification_version: 4
180
168
  summary: EDItEUR ONIX format dictionary helpers used in eLibri publication system