elibri_onix 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- elibri_onix (0.2.4)
4
+ elibri_onix (0.2.6)
5
5
  activesupport (>= 2.3.5)
6
6
  elibri_onix_dict (>= 0.0.5)
7
7
  i18n
@@ -24,7 +24,7 @@ GEM
24
24
  mocha (0.11.4)
25
25
  metaclass (~> 0.0.1)
26
26
  multi_json (1.5.0)
27
- nokogiri (1.5.6-java)
27
+ nokogiri (1.5.6)
28
28
  pry (0.9.9.6)
29
29
  coderay (~> 1.0.5)
30
30
  method_source (~> 0.7.1)
@@ -6,6 +6,7 @@ module Elibri
6
6
  class Contributor
7
7
  include ExternalId
8
8
  include ExternalTimestamp
9
+ include Inspector
9
10
 
10
11
  #from ONIX documentation:
11
12
  #Authorship and other forms of contribution are described by repeats of the <Contributor> composite,
@@ -91,7 +92,7 @@ module Elibri
91
92
  end
92
93
 
93
94
  def inspect_include_fields
94
- [:role_name]
95
+ [:role_name, :person_name]
95
96
  end
96
97
 
97
98
  end
@@ -10,6 +10,8 @@ module Elibri
10
10
  #An optional and repeatable group of data elements which together represent a language, and specify its role and,
11
11
  #where required, whether it is a country variant.
12
12
 
13
+ include Inspector
14
+
13
15
  #:nodoc:
14
16
  ATTRIBUTES = [
15
17
  :role, :code, :role_name, :language
@@ -35,7 +35,8 @@ module Elibri
35
35
  ]
36
36
 
37
37
  def inspect_include_fields
38
- [:record_reference, :full_title, :front_cover, :publisher, :isbn13, :ean, :premiere]
38
+ [:record_reference, :full_title, :front_cover, :publisher, :isbn13, :ean, :premiere, :contributors, :languages, :description, :product_form_name,
39
+ :technical_protection, :digital_formats]
39
40
  end
40
41
 
41
42
 
@@ -150,6 +151,10 @@ module Elibri
150
151
  #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml
151
152
  attr_reader :product_form
152
153
 
154
+ #nazwa typu produktu, małe litery, np. 'book' - patrz pełna lista pod adresem
155
+ #https://github.com/elibri/elibri_onix_dict/blob/master/lib/elibri_onix_dict/onix_3_0/serialized/ProductFormCode.yml
156
+ attr_reader :product_form_name
157
+
153
158
  #lista autorów, tłumaczy i innych, którzy mieli wkład w książkę, lista instancji Contributor
154
159
  attr_reader :contributors
155
160
 
@@ -259,6 +264,7 @@ module Elibri
259
264
  def descriptive_details_setup(data)
260
265
  @product_composition = data.at_xpath('xmlns:ProductComposition').try(:text)
261
266
  @product_form = data.at_xpath('xmlns:ProductForm').try(:text)
267
+ @product_form_name = Elibri::ONIX::Dict::Release_3_0::ProductFormCode::find_by_onix_code(@product_form).name(:en).downcase
262
268
  @measures = data.xpath('xmlns:Measure').map { |measure_data| Measure.new(measure_data) }
263
269
  @title_details = data.xpath('xmlns:TitleDetail').map { |title_data| TitleDetail.new(title_data) }
264
270
  @collections = data.xpath('xmlns:Collection').map { |collection_data| Collection.new(collection_data) }
@@ -6,6 +6,7 @@ module Elibri
6
6
  class TextContent
7
7
  include ExternalId
8
8
  include ExternalTimestamp
9
+ include Inspector
9
10
 
10
11
  #from ONIX documentation:
11
12
  #An optional and repeatable group of data elements which together carry text related to the product.
@@ -41,7 +42,7 @@ module Elibri
41
42
 
42
43
 
43
44
  def inspect_include_fields
44
- [:type_name]
45
+ [:type_name, :text]
45
46
  end
46
47
 
47
48
  private
@@ -2,7 +2,7 @@ module Elibri
2
2
  module ONIX
3
3
  z = $VERBOSE
4
4
  $VERBOSE = nil
5
- VERSION = "0.2.5"
5
+ VERSION = "0.2.6"
6
6
  Version = VERSION
7
7
  $VERBOSE = z
8
8
  end
@@ -4,9 +4,9 @@ describe Elibri::ONIX::Release_3_0::ONIXMessage do
4
4
 
5
5
  it "should be able to parse the product form" do
6
6
  product = load_fixture("onix_product_form_example.xml")
7
- #TODO - rozwiń jak w php
8
7
  assert_equal "00", product.product_composition
9
8
  assert_equal "BA", product.product_form
9
+ assert_equal "book", product.product_form_name
10
10
  end
11
11
 
12
12
  end
metadata CHANGED
@@ -1,204 +1,185 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: elibri_onix
3
- version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.5
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 2
9
+ - 6
10
+ version: 0.2.6
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Marcin Urbanski
9
14
  - Piotr Szmielew
10
- autorequire:
15
+ autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
- date: 2013-01-24 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2013-01-24 00:00:00 +01:00
20
+ default_executable:
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
16
23
  name: activesupport
17
- version_requirements: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
21
- version: 2.3.5
24
+ prerelease: false
25
+ requirement: &id001 !ruby/object:Gem::Requirement
22
26
  none: false
23
- requirement: !ruby/object:Gem::Requirement
24
- requirements:
27
+ requirements:
25
28
  - - ">="
26
- - !ruby/object:Gem::Version
29
+ - !ruby/object:Gem::Version
30
+ hash: 9
31
+ segments:
32
+ - 2
33
+ - 3
34
+ - 5
27
35
  version: 2.3.5
28
- none: false
29
- prerelease: false
30
36
  type: :runtime
31
- - !ruby/object:Gem::Dependency
37
+ version_requirements: *id001
38
+ - !ruby/object:Gem::Dependency
32
39
  name: nokogiri
33
- version_requirements: !ruby/object:Gem::Requirement
34
- requirements:
35
- - - ">="
36
- - !ruby/object:Gem::Version
37
- version: !binary |-
38
- MA==
40
+ prerelease: false
41
+ requirement: &id002 !ruby/object:Gem::Requirement
39
42
  none: false
40
- requirement: !ruby/object:Gem::Requirement
41
- requirements:
43
+ requirements:
42
44
  - - ">="
43
- - !ruby/object:Gem::Version
44
- version: !binary |-
45
- MA==
46
- none: false
47
- prerelease: false
45
+ - !ruby/object:Gem::Version
46
+ hash: 3
47
+ segments:
48
+ - 0
49
+ version: "0"
48
50
  type: :runtime
49
- - !ruby/object:Gem::Dependency
51
+ version_requirements: *id002
52
+ - !ruby/object:Gem::Dependency
50
53
  name: i18n
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
55
- version: !binary |-
56
- MA==
54
+ prerelease: false
55
+ requirement: &id003 !ruby/object:Gem::Requirement
57
56
  none: false
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
57
+ requirements:
60
58
  - - ">="
61
- - !ruby/object:Gem::Version
62
- version: !binary |-
63
- MA==
64
- none: false
65
- prerelease: false
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
66
64
  type: :runtime
67
- - !ruby/object:Gem::Dependency
65
+ version_requirements: *id003
66
+ - !ruby/object:Gem::Dependency
68
67
  name: elibri_onix_dict
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: 0.0.5
68
+ prerelease: false
69
+ requirement: &id004 !ruby/object:Gem::Requirement
74
70
  none: false
75
- requirement: !ruby/object:Gem::Requirement
76
- requirements:
71
+ requirements:
77
72
  - - ">="
78
- - !ruby/object:Gem::Version
73
+ - !ruby/object:Gem::Version
74
+ hash: 21
75
+ segments:
76
+ - 0
77
+ - 0
78
+ - 5
79
79
  version: 0.0.5
80
- none: false
81
- prerelease: false
82
80
  type: :runtime
83
- - !ruby/object:Gem::Dependency
81
+ version_requirements: *id004
82
+ - !ruby/object:Gem::Dependency
84
83
  name: pry
85
- version_requirements: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: !binary |-
90
- MA==
84
+ prerelease: false
85
+ requirement: &id005 !ruby/object:Gem::Requirement
91
86
  none: false
92
- requirement: !ruby/object:Gem::Requirement
93
- requirements:
87
+ requirements:
94
88
  - - ">="
95
- - !ruby/object:Gem::Version
96
- version: !binary |-
97
- MA==
98
- none: false
99
- prerelease: false
89
+ - !ruby/object:Gem::Version
90
+ hash: 3
91
+ segments:
92
+ - 0
93
+ version: "0"
100
94
  type: :development
101
- - !ruby/object:Gem::Dependency
95
+ version_requirements: *id005
96
+ - !ruby/object:Gem::Dependency
102
97
  name: mocha
103
- version_requirements: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - ">="
106
- - !ruby/object:Gem::Version
107
- version: !binary |-
108
- MA==
98
+ prerelease: false
99
+ requirement: &id006 !ruby/object:Gem::Requirement
109
100
  none: false
110
- requirement: !ruby/object:Gem::Requirement
111
- requirements:
101
+ requirements:
112
102
  - - ">="
113
- - !ruby/object:Gem::Version
114
- version: !binary |-
115
- MA==
116
- none: false
117
- prerelease: false
103
+ - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
107
+ version: "0"
118
108
  type: :development
119
- - !ruby/object:Gem::Dependency
109
+ version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
120
111
  name: minitest
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - ">="
124
- - !ruby/object:Gem::Version
125
- version: !binary |-
126
- MA==
112
+ prerelease: false
113
+ requirement: &id007 !ruby/object:Gem::Requirement
127
114
  none: false
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
115
+ requirements:
130
116
  - - ">="
131
- - !ruby/object:Gem::Version
132
- version: !binary |-
133
- MA==
134
- none: false
135
- prerelease: false
117
+ - !ruby/object:Gem::Version
118
+ hash: 3
119
+ segments:
120
+ - 0
121
+ version: "0"
136
122
  type: :development
137
- - !ruby/object:Gem::Dependency
123
+ version_requirements: *id007
124
+ - !ruby/object:Gem::Dependency
138
125
  name: bundler
139
- version_requirements: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- version: 1.0.0
126
+ prerelease: false
127
+ requirement: &id008 !ruby/object:Gem::Requirement
144
128
  none: false
145
- requirement: !ruby/object:Gem::Requirement
146
- requirements:
129
+ requirements:
147
130
  - - ">="
148
- - !ruby/object:Gem::Version
131
+ - !ruby/object:Gem::Version
132
+ hash: 23
133
+ segments:
134
+ - 1
135
+ - 0
136
+ - 0
149
137
  version: 1.0.0
150
- none: false
151
- prerelease: false
152
138
  type: :development
153
- - !ruby/object:Gem::Dependency
139
+ version_requirements: *id008
140
+ - !ruby/object:Gem::Dependency
154
141
  name: rake
155
- version_requirements: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: !binary |-
160
- MA==
142
+ prerelease: false
143
+ requirement: &id009 !ruby/object:Gem::Requirement
161
144
  none: false
162
- requirement: !ruby/object:Gem::Requirement
163
- requirements:
145
+ requirements:
164
146
  - - ">="
165
- - !ruby/object:Gem::Version
166
- version: !binary |-
167
- MA==
168
- none: false
169
- prerelease: false
147
+ - !ruby/object:Gem::Version
148
+ hash: 3
149
+ segments:
150
+ - 0
151
+ version: "0"
170
152
  type: :development
171
- - !ruby/object:Gem::Dependency
153
+ version_requirements: *id009
154
+ - !ruby/object:Gem::Dependency
172
155
  name: rdoc
173
- version_requirements: !ruby/object:Gem::Requirement
174
- requirements:
175
- - - ">="
176
- - !ruby/object:Gem::Version
177
- version: !binary |-
178
- MA==
156
+ prerelease: false
157
+ requirement: &id010 !ruby/object:Gem::Requirement
179
158
  none: false
180
- requirement: !ruby/object:Gem::Requirement
181
- requirements:
159
+ requirements:
182
160
  - - ">="
183
- - !ruby/object:Gem::Version
184
- version: !binary |-
185
- MA==
186
- none: false
187
- prerelease: false
161
+ - !ruby/object:Gem::Version
162
+ hash: 3
163
+ segments:
164
+ - 0
165
+ version: "0"
188
166
  type: :development
167
+ version_requirements: *id010
189
168
  description: EDItEUR ONIX format subset implementation used in Elibri publication system
190
- email:
169
+ email:
191
170
  - marcin@urbanski.vdl.pl
192
171
  - p.szmielew@ava.waw.pl
193
172
  executables: []
173
+
194
174
  extensions: []
195
- extra_rdoc_files:
175
+
176
+ extra_rdoc_files:
196
177
  - LICENSE.txt
197
178
  - README.rdoc
198
179
  - FIELDS.rdoc
199
- files:
200
- - ".gitignore"
201
- - ".travis.yml"
180
+ files:
181
+ - .gitignore
182
+ - .travis.yml
202
183
  - FIELDS.rdoc
203
184
  - Gemfile
204
185
  - Gemfile.lock
@@ -295,34 +276,41 @@ files:
295
276
  - test/fixtures/onix_titles_example.xml
296
277
  - test/fixtures/onix_unlimited_book_sample_example.xml
297
278
  - test/helper.rb
279
+ has_rdoc: true
298
280
  homepage: http://github.com/elibri/elibri_onix
299
- licenses:
281
+ licenses:
300
282
  - MIT
301
- post_install_message:
283
+ post_install_message:
302
284
  rdoc_options: []
303
- require_paths:
285
+
286
+ require_paths:
304
287
  - lib
305
- required_ruby_version: !ruby/object:Gem::Requirement
306
- requirements:
307
- - - ">="
308
- - !ruby/object:Gem::Version
309
- version: !binary |-
310
- MA==
288
+ required_ruby_version: !ruby/object:Gem::Requirement
311
289
  none: false
312
- required_rubygems_version: !ruby/object:Gem::Requirement
313
- requirements:
290
+ requirements:
314
291
  - - ">="
315
- - !ruby/object:Gem::Version
316
- version: !binary |-
317
- MA==
292
+ - !ruby/object:Gem::Version
293
+ hash: 3
294
+ segments:
295
+ - 0
296
+ version: "0"
297
+ required_rubygems_version: !ruby/object:Gem::Requirement
318
298
  none: false
299
+ requirements:
300
+ - - ">="
301
+ - !ruby/object:Gem::Version
302
+ hash: 3
303
+ segments:
304
+ - 0
305
+ version: "0"
319
306
  requirements: []
320
- rubyforge_project:
321
- rubygems_version: 1.8.24
322
- signing_key:
307
+
308
+ rubyforge_project:
309
+ rubygems_version: 1.5.2
310
+ signing_key:
323
311
  specification_version: 3
324
312
  summary: EDItEUR ONIX format subset implementation used in Elibri publication system
325
- test_files:
313
+ test_files:
326
314
  - test/elibri_audience_range_test.rb
327
315
  - test/elibri_categories_test.rb
328
316
  - test/elibri_contributors_test.rb