onix 0.7.8 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +14 -0
- data/lib/onix.rb +2 -16
- data/lib/onix/addressee_identifier.rb +0 -1
- data/lib/onix/apa_product.rb +5 -1
- data/lib/onix/audience_range.rb +0 -1
- 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/market_representation.rb +0 -1
- data/lib/onix/measure.rb +0 -1
- data/lib/onix/media_file.rb +0 -1
- data/lib/onix/other_text.rb +0 -1
- data/lib/onix/price.rb +0 -1
- data/lib/onix/product.rb +0 -1
- data/lib/onix/product_identifier.rb +0 -1
- data/lib/onix/publisher.rb +0 -1
- data/lib/onix/reader.rb +24 -99
- data/lib/onix/sales_restriction.rb +0 -1
- data/lib/onix/sender_identifier.rb +0 -1
- data/lib/onix/series.rb +0 -1
- data/lib/onix/series_identifier.rb +0 -1
- 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/spec/apa_product_spec.rb +34 -4
- data/spec/audience_range_spec.rb +2 -4
- 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 +2 -4
- 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 -3
- 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 +3 -5
- data/spec/sales_restriction_spec.rb +2 -4
- data/spec/sender_identifier.rb +2 -4
- data/spec/series_identifier_spec.rb +2 -4
- data/spec/series_spec.rb +2 -4
- data/spec/spec_helper.rb +7 -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 +93 -92
- data/lib/onix/common.rb +0 -26
data/spec/audience_range_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::AudienceRange" 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, "audience_range.xml")
|
12
|
-
@doc =
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/contributor_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::Contributor" 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, "contributor.xml")
|
12
|
-
@doc =
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/header_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::Header" 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, "header.xml")
|
12
|
-
@doc =
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@header_node = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/imprint_spec.rb
CHANGED
@@ -1,16 +1,14 @@
|
|
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::Imprint" do
|
8
6
|
|
9
7
|
before(:each) do
|
10
8
|
data_path = File.join(File.dirname(__FILE__),"..","data")
|
11
|
-
file1
|
12
|
-
@doc
|
13
|
-
@root
|
9
|
+
file1 = File.join(data_path, "imprint.xml")
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
11
|
+
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
16
14
|
specify "should correctly convert to a string" do
|
data/spec/language_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::Language" 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, "language.xml")
|
12
|
-
@doc =
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
@@ -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::MarketRepresentation" 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, "market_representation.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/measure_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::Measure" 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, "measure.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/media_file_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::MediaFile" 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, "media_file.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/normaliser_spec.rb
CHANGED
data/spec/other_text_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::OtherText" 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, "other_text.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/price_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::Price" 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, "price.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
@@ -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::ProductIdentifier" 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, "product_identifier.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/product_spec.rb
CHANGED
@@ -1,16 +1,13 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require 'onix'
|
6
|
-
require 'date'
|
3
|
+
require File.dirname(__FILE__) + '/spec_helper.rb'
|
7
4
|
|
8
5
|
context "ONIX::Product" do
|
9
6
|
|
10
7
|
before(:each) do
|
11
8
|
@data_path = File.join(File.dirname(__FILE__),"..","data")
|
12
9
|
file1 = File.join(@data_path, "product.xml")
|
13
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
14
11
|
@product_node = @doc.root
|
15
12
|
end
|
16
13
|
|
data/spec/publisher_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::Publisher" 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, "publisher.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/reader_spec.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
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::Reader" do
|
8
6
|
|
@@ -18,13 +16,13 @@ context "ONIX::Reader" do
|
|
18
16
|
|
19
17
|
specify "should initialize with a filename" do
|
20
18
|
reader = ONIX::Reader.new(@file1)
|
21
|
-
reader.instance_variable_get("@reader").should be_a_kind_of(
|
19
|
+
reader.instance_variable_get("@reader").should be_a_kind_of(Nokogiri::XML::Reader)
|
22
20
|
end
|
23
21
|
|
24
22
|
specify "should initialize with an IO object" do
|
25
23
|
File.open(@file1,"rb") do |f|
|
26
24
|
reader = ONIX::Reader.new(f)
|
27
|
-
reader.instance_variable_get("@reader").should be_a_kind_of(
|
25
|
+
reader.instance_variable_get("@reader").should be_a_kind_of(Nokogiri::XML::Reader)
|
28
26
|
end
|
29
27
|
end
|
30
28
|
|
@@ -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::SalesRestriction" 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, "sales_restriction.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/sender_identifier.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::SenderIdentifier" 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, "sender_identifier.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
@@ -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::SeriesIdentifier" 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, "series_identifier.xml")
|
12
|
-
@doc =
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/series_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::Series" 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, "series.xml")
|
12
|
-
@doc =
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/spec_helper.rb
ADDED
data/spec/stock_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::Stock" 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, "stock.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/subject_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::Subject" 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, "subject.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
data/spec/supply_detail_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::SupplyDetail" 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, "supply_detail.xml")
|
12
|
-
@doc
|
10
|
+
@doc = Nokogiri::XML::Document.parse(File.read(file1))
|
13
11
|
@root = @doc.root
|
14
12
|
end
|
15
13
|
|
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
|
|