milkfarm-onix 0.7.7 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +31 -1
- data/README.markdown +24 -2
- data/lib/onix.rb +3 -16
- data/lib/onix/addressee_identifier.rb +0 -1
- data/lib/onix/apa_product.rb +19 -2
- data/lib/onix/audience_range.rb +6 -7
- data/lib/onix/contributor.rb +0 -1
- data/lib/onix/header.rb +0 -1
- data/lib/onix/imprint.rb +0 -1
- data/lib/onix/language.rb +0 -1
- data/lib/onix/lists/contributor_role.rb +99 -0
- data/lib/onix/market_representation.rb +0 -1
- data/lib/onix/measure.rb +0 -1
- data/lib/onix/media_file.rb +0 -1
- data/lib/onix/normaliser.rb +0 -77
- data/lib/onix/other_text.rb +0 -1
- data/lib/onix/price.rb +0 -1
- data/lib/onix/product.rb +3 -2
- data/lib/onix/product_identifier.rb +0 -1
- data/lib/onix/publisher.rb +0 -1
- data/lib/onix/reader.rb +39 -96
- data/lib/onix/sales_restriction.rb +0 -1
- data/lib/onix/sender_identifier.rb +0 -1
- data/lib/onix/series.rb +8 -8
- data/lib/onix/series_identifier.rb +0 -1
- data/lib/onix/set.rb +76 -0
- data/lib/onix/sl_product.rb +32 -45
- data/lib/onix/stock.rb +0 -1
- data/lib/onix/subject.rb +0 -1
- data/lib/onix/supply_detail.rb +0 -1
- data/lib/onix/title.rb +0 -1
- data/lib/onix/website.rb +0 -1
- data/lib/onix/writer.rb +1 -1
- data/spec/apa_product_spec.rb +44 -4
- data/spec/audience_range_spec.rb +5 -7
- data/spec/contributor_spec.rb +2 -4
- data/spec/header_spec.rb +2 -4
- data/spec/imprint_spec.rb +4 -6
- data/spec/language_spec.rb +5 -7
- data/spec/market_representation_spec.rb +2 -4
- data/spec/measure_spec.rb +2 -4
- data/spec/media_file_spec.rb +2 -4
- data/spec/normaliser_spec.rb +1 -78
- data/spec/other_text_spec.rb +2 -4
- data/spec/price_spec.rb +2 -4
- data/spec/product_identifier_spec.rb +2 -4
- data/spec/product_spec.rb +2 -5
- data/spec/publisher_spec.rb +2 -4
- data/spec/reader_spec.rb +15 -22
- data/spec/sales_restriction_spec.rb +2 -4
- data/spec/sender_identifier.rb +2 -4
- data/spec/series_identifier_spec.rb +5 -7
- data/spec/series_spec.rb +4 -6
- data/spec/set_spec.rb +32 -0
- data/spec/sl_product_spec.rb +76 -24
- data/spec/spec_helper.rb +8 -0
- data/spec/stock_spec.rb +2 -4
- data/spec/subject_spec.rb +2 -4
- data/spec/supply_detail_spec.rb +2 -4
- data/spec/title_spec.rb +2 -4
- data/spec/website_spec.rb +2 -4
- data/spec/writer_spec.rb +1 -4
- metadata +64 -28
- data/lib/onix/common.rb +0 -26
data/spec/title_spec.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require 'onix'
|
3
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
6
4
|
|
7
5
|
context "ONIX::Title" do
|
8
6
|
|
9
7
|
before(:each) do
|
10
8
|
data_path = File.join(File.dirname(__FILE__),"..","data")
|
11
9
|
file1 = File.join(data_path, "title.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/website_spec.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require 'onix'
|
3
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
6
4
|
|
7
5
|
context "ONIX::Website" do
|
8
6
|
|
9
7
|
before(:each) do
|
10
8
|
data_path = File.join(File.dirname(__FILE__),"..","data")
|
11
9
|
file1 = File.join(data_path, "website.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/writer_spec.rb
CHANGED
metadata
CHANGED
@@ -1,49 +1,77 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: milkfarm-onix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 8
|
8
|
+
- 3
|
9
|
+
version: 0.8.3
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
|
-
-
|
12
|
+
- James Healy
|
8
13
|
autorequire:
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-06-24 00:00:00 -07:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: roxml
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
|
-
- - "
|
25
|
+
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
23
|
-
|
24
|
-
|
25
|
-
-
|
26
|
-
|
27
|
+
segments:
|
28
|
+
- 3
|
29
|
+
- 1
|
30
|
+
- 1
|
31
|
+
version: 3.1.1
|
27
32
|
type: :runtime
|
28
|
-
|
29
|
-
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: andand
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
name: andand
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
version: "0"
|
37
44
|
type: :runtime
|
38
|
-
|
39
|
-
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: nokogiri
|
48
|
+
prerelease: false
|
49
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
50
|
requirements:
|
41
51
|
- - ">="
|
42
52
|
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
53
|
+
segments:
|
54
|
+
- 1
|
55
|
+
- 4
|
56
|
+
version: "1.4"
|
57
|
+
type: :runtime
|
58
|
+
version_requirements: *id003
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: activesupport
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - <=
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 2
|
68
|
+
- 9
|
69
|
+
- 9
|
70
|
+
version: 2.9.9
|
71
|
+
type: :runtime
|
72
|
+
version_requirements: *id004
|
45
73
|
description: A convient mapping between ruby objects and the ONIX XML specification
|
46
|
-
email:
|
74
|
+
email: jimmy@deefa.com
|
47
75
|
executables: []
|
48
76
|
|
49
77
|
extensions: []
|
@@ -54,12 +82,12 @@ files:
|
|
54
82
|
- lib/onix/addressee_identifier.rb
|
55
83
|
- lib/onix/apa_product.rb
|
56
84
|
- lib/onix/audience_range.rb
|
57
|
-
- lib/onix/common.rb
|
58
85
|
- lib/onix/contributor.rb
|
59
86
|
- lib/onix/header.rb
|
60
87
|
- lib/onix/imprint.rb
|
61
88
|
- lib/onix/language.rb
|
62
89
|
- lib/onix/lists/audience_code.rb
|
90
|
+
- lib/onix/lists/contributor_role.rb
|
63
91
|
- lib/onix/lists/country_code.rb
|
64
92
|
- lib/onix/lists/language_code.rb
|
65
93
|
- lib/onix/lists/language_role.rb
|
@@ -81,6 +109,7 @@ files:
|
|
81
109
|
- lib/onix/sender_identifier.rb
|
82
110
|
- lib/onix/series.rb
|
83
111
|
- lib/onix/series_identifier.rb
|
112
|
+
- lib/onix/set.rb
|
84
113
|
- lib/onix/simple_product.rb
|
85
114
|
- lib/onix/sl_product.rb
|
86
115
|
- lib/onix/stock.rb
|
@@ -93,7 +122,6 @@ files:
|
|
93
122
|
- README.markdown
|
94
123
|
- TODO
|
95
124
|
- CHANGELOG
|
96
|
-
- dtd/2.1r3
|
97
125
|
- dtd/2.1r3/iso-amsa.ent
|
98
126
|
- dtd/2.1r3/iso-amsb.ent
|
99
127
|
- dtd/2.1r3/iso-amsc.ent
|
@@ -144,7 +172,9 @@ files:
|
|
144
172
|
- spec/sender_identifier.rb
|
145
173
|
- spec/series_identifier_spec.rb
|
146
174
|
- spec/series_spec.rb
|
175
|
+
- spec/set_spec.rb
|
147
176
|
- spec/sl_product_spec.rb
|
177
|
+
- spec/spec_helper.rb
|
148
178
|
- spec/stock_spec.rb
|
149
179
|
- spec/subject_spec.rb
|
150
180
|
- spec/supply_detail_spec.rb
|
@@ -153,6 +183,8 @@ files:
|
|
153
183
|
- spec/writer_spec.rb
|
154
184
|
has_rdoc: true
|
155
185
|
homepage: http://github.com/milkfarm/onix/tree/master
|
186
|
+
licenses: []
|
187
|
+
|
156
188
|
post_install_message:
|
157
189
|
rdoc_options:
|
158
190
|
- --title
|
@@ -164,20 +196,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
164
196
|
requirements:
|
165
197
|
- - ">="
|
166
198
|
- !ruby/object:Gem::Version
|
199
|
+
segments:
|
200
|
+
- 0
|
167
201
|
version: "0"
|
168
|
-
version:
|
169
202
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
203
|
requirements:
|
171
204
|
- - ">="
|
172
205
|
- !ruby/object:Gem::Version
|
206
|
+
segments:
|
207
|
+
- 0
|
173
208
|
version: "0"
|
174
|
-
version:
|
175
209
|
requirements: []
|
176
210
|
|
177
211
|
rubyforge_project: rbook
|
178
|
-
rubygems_version: 1.3.
|
212
|
+
rubygems_version: 1.3.6
|
179
213
|
signing_key:
|
180
|
-
specification_version:
|
214
|
+
specification_version: 3
|
181
215
|
summary: A convient mapping between ruby objects and the ONIX XML specification
|
182
216
|
test_files:
|
183
217
|
- spec/apa_product_spec.rb
|
@@ -200,7 +234,9 @@ test_files:
|
|
200
234
|
- spec/sender_identifier.rb
|
201
235
|
- spec/series_identifier_spec.rb
|
202
236
|
- spec/series_spec.rb
|
237
|
+
- spec/set_spec.rb
|
203
238
|
- spec/sl_product_spec.rb
|
239
|
+
- spec/spec_helper.rb
|
204
240
|
- spec/stock_spec.rb
|
205
241
|
- spec/subject_spec.rb
|
206
242
|
- spec/supply_detail_spec.rb
|
data/lib/onix/common.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
module ONIX
|
2
|
-
# methods we want to be available on all our ROXML classes
|
3
|
-
module Common
|
4
|
-
|
5
|
-
# After an input string has been marshalled into an object,
|
6
|
-
# ROXML will automatically call this method.
|
7
|
-
#
|
8
|
-
# LibXML (and therefore ROXML) appears to forget the encoding
|
9
|
-
# of the input data, a damn shame considering the Ruby 1.9 encoding
|
10
|
-
# support can be vey useful.
|
11
|
-
#
|
12
|
-
# Since we only ever pass our ROXML objects strings we know are utf-8
|
13
|
-
# encoded, it should be safe enough to force every string attribute
|
14
|
-
# back once the marshalling is done.
|
15
|
-
#
|
16
|
-
def after_parse
|
17
|
-
self.class.roxml_attrs.each do |attr|
|
18
|
-
var = instance_variable_get("@#{attr.variable_name}")
|
19
|
-
if var && var.respond_to?(:force_encoding)
|
20
|
-
var.force_encoding("utf-8")
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|