milkfarm-onix 0.8.3 → 0.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/lib/onix.rb +1 -1
- data/lib/onix/normaliser.rb +1 -1
- data/lib/onix/product.rb +1 -0
- data/lib/onix/sl_product.rb +1 -0
- data/spec/apa_product_spec.rb +2 -2
- data/spec/audience_range_spec.rb +2 -2
- data/spec/contributor_spec.rb +2 -2
- data/spec/header_spec.rb +2 -2
- data/spec/imprint_spec.rb +2 -2
- data/spec/language_spec.rb +2 -2
- data/spec/market_representation_spec.rb +2 -2
- data/spec/measure_spec.rb +2 -2
- data/spec/media_file_spec.rb +2 -2
- data/spec/other_text_spec.rb +2 -2
- data/spec/price_spec.rb +2 -2
- data/spec/product_identifier_spec.rb +2 -2
- data/spec/product_spec.rb +2 -2
- data/spec/publisher_spec.rb +2 -2
- data/spec/sales_restriction_spec.rb +2 -2
- data/spec/sender_identifier.rb +2 -2
- data/spec/series_identifier_spec.rb +2 -2
- data/spec/series_spec.rb +2 -2
- data/spec/set_spec.rb +2 -2
- data/spec/sl_product_spec.rb +4 -4
- data/spec/spec_helper.rb +0 -1
- data/spec/stock_spec.rb +2 -2
- data/spec/subject_spec.rb +2 -2
- data/spec/supply_detail_spec.rb +2 -2
- data/spec/title_spec.rb +2 -2
- data/spec/website_spec.rb +2 -2
- metadata +18 -21
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
v0.8.3 (9th September 2010)
|
2
|
+
- Fix for race condition in ONIX::Normaliser
|
3
|
+
- thanks to pixelvixen for reporting
|
4
|
+
- force roxml to be 3.1.6 or higher. Earlier versions misbehaved when monkey
|
5
|
+
patching nokogiri
|
6
|
+
|
1
7
|
v0.8.2 (6th May 2010)
|
2
8
|
- fix APAProduct#series and APAProduct#series=
|
3
9
|
|
data/lib/onix.rb
CHANGED
data/lib/onix/normaliser.rb
CHANGED
data/lib/onix/product.rb
CHANGED
@@ -19,6 +19,7 @@ module ONIX
|
|
19
19
|
xml_accessor :edition_number, :from => "EditionNumber", :as => Fixnum
|
20
20
|
xml_accessor :languages, :from => "Language", :as => [ONIX::Language]
|
21
21
|
xml_accessor :number_of_pages, :from => "NumberOfPages", :as => Fixnum
|
22
|
+
xml_accessor :basic_main_subject, :from => "BASICMainSubject"
|
22
23
|
xml_accessor :bic_main_subject, :from => "BICMainSubject"
|
23
24
|
xml_accessor :subjects, :from => "Subject", :as => [ONIX::Subject]
|
24
25
|
xml_accessor :audience_code, :from => "AudienceCode", :to_xml => ONIX::Formatters.two_digit
|
data/lib/onix/sl_product.rb
CHANGED
@@ -6,6 +6,7 @@ module ONIX
|
|
6
6
|
delegate :audience_code, :audience_code=
|
7
7
|
delegate :copyright_year, :copyright_year=
|
8
8
|
delegate :product_form_detail, :product_form_detail=
|
9
|
+
delegate :basic_main_subject, :basic_main_subject=
|
9
10
|
|
10
11
|
# retrieve the value of a particular ID
|
11
12
|
def series(str)
|
data/spec/apa_product_spec.rb
CHANGED
@@ -12,7 +12,7 @@ context "ONIX::APAProduct" do
|
|
12
12
|
@product_node = @doc.root
|
13
13
|
end
|
14
14
|
|
15
|
-
specify "should provide read access to
|
15
|
+
specify "should provide read access to attributes" do
|
16
16
|
@product = ONIX::Product.from_xml(@product_node.to_s)
|
17
17
|
@apa = ONIX::APAProduct.new(@product)
|
18
18
|
|
@@ -26,7 +26,7 @@ context "ONIX::APAProduct" do
|
|
26
26
|
@apa.pack_quantity.should eql(12)
|
27
27
|
end
|
28
28
|
|
29
|
-
specify "should provide write access to
|
29
|
+
specify "should provide write access to attributes" do
|
30
30
|
apa = ONIX::APAProduct.new
|
31
31
|
|
32
32
|
apa.notification_type = 3
|
data/spec/audience_range_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::AudienceRange" do
|
|
16
16
|
aud.to_xml.to_s[0,15].should eql("<AudienceRange>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
aud = ONIX::AudienceRange.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
aud.audience_range_qualifier.should eql(11)
|
@@ -28,7 +28,7 @@ context "ONIX::AudienceRange" do
|
|
28
28
|
aud.audience_range_values[1].should eql(5)
|
29
29
|
end
|
30
30
|
|
31
|
-
specify "should provide write access to first level
|
31
|
+
specify "should provide write access to first level attributes" do
|
32
32
|
aud = ONIX::AudienceRange.new
|
33
33
|
|
34
34
|
aud.audience_range_qualifier = 12
|
data/spec/contributor_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::Contributor" do
|
|
16
16
|
header.to_xml.to_s[0,13].should eql("<Contributor>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
contrib = ONIX::Contributor.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
contrib.contributor_role.should eql("A01")
|
@@ -24,7 +24,7 @@ context "ONIX::Contributor" do
|
|
24
24
|
contrib.sequence_number.should eql(1)
|
25
25
|
end
|
26
26
|
|
27
|
-
specify "should provide write access to first level
|
27
|
+
specify "should provide write access to first level attributes" do
|
28
28
|
contrib = ONIX::Contributor.new
|
29
29
|
|
30
30
|
contrib.contributor_role = "A02"
|
data/spec/header_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::Header" do
|
|
16
16
|
header.to_xml.to_s[0,8].should eql("<Header>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
header = ONIX::Header.from_xml(@header_node.to_s)
|
21
21
|
|
22
22
|
header.from_ean_number.should eql("1111111111111")
|
@@ -42,7 +42,7 @@ context "ONIX::Header" do
|
|
42
42
|
header.default_class_of_trade.should eql("f")
|
43
43
|
end
|
44
44
|
|
45
|
-
specify "should provide write access to first level
|
45
|
+
specify "should provide write access to first level attributes" do
|
46
46
|
header = ONIX::Header.new
|
47
47
|
|
48
48
|
header.from_ean_number = "1111111111111"
|
data/spec/imprint_spec.rb
CHANGED
@@ -16,13 +16,13 @@ context "ONIX::Imprint" do
|
|
16
16
|
imp.to_xml.to_s[0,9].should eql("<Imprint>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
imp = ONIX::Imprint.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
imp.imprint_name.should eql("Oxford University Press UK")
|
23
23
|
end
|
24
24
|
|
25
|
-
specify "should provide write access to first level
|
25
|
+
specify "should provide write access to first level attributes" do
|
26
26
|
imp = ONIX::Imprint.new
|
27
27
|
|
28
28
|
imp.imprint_name = "Paulist Press"
|
data/spec/language_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::Language" do
|
|
16
16
|
lan.to_xml.to_s[0,10].should eql("<Language>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
lan = ONIX::Language.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
lan.language_role.should eql(1)
|
@@ -24,7 +24,7 @@ context "ONIX::Language" do
|
|
24
24
|
lan.country_code.should eql("US")
|
25
25
|
end
|
26
26
|
|
27
|
-
specify "should provide write access to first level
|
27
|
+
specify "should provide write access to first level attributes" do
|
28
28
|
lan = ONIX::Language.new
|
29
29
|
|
30
30
|
lan.language_role = 2
|
@@ -16,14 +16,14 @@ context "ONIX::MarketRepresentation" do
|
|
16
16
|
rep.to_xml.to_s[0,22].should eql("<MarketRepresentation>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
rep = ONIX::MarketRepresentation.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
rep.agent_name.should eql("Allen & Unwin")
|
23
23
|
rep.agent_role.should eql(7)
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
rep = ONIX::MarketRepresentation.new
|
28
28
|
|
29
29
|
rep.agent_name = "Rainbow Book Agencies"
|
data/spec/measure_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::Measure" do
|
|
16
16
|
m.to_xml.to_s[0,9].should eql("<Measure>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
m = ONIX::Measure.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
m.measure_type_code.should eql(1)
|
@@ -24,7 +24,7 @@ context "ONIX::Measure" do
|
|
24
24
|
m.measure_unit_code.should eql("mm")
|
25
25
|
end
|
26
26
|
|
27
|
-
specify "should provide write access to first level
|
27
|
+
specify "should provide write access to first level attributes" do
|
28
28
|
m = ONIX::Measure.new
|
29
29
|
|
30
30
|
m.measure_type_code = 1
|
data/spec/media_file_spec.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::MediaFile" do
|
|
16
16
|
mf.to_xml.to_s[0,11].should eql("<MediaFile>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
mf = ONIX::MediaFile.from_xml(@root.to_s)
|
21
21
|
mf.media_file_type_code.should eql(4)
|
22
22
|
mf.media_file_link_type_code.should eql(1)
|
23
23
|
mf.media_file_link.should eql("http://www.allenandunwin.com/BookCovers/resized_9788888028729_224_297_FitSquare.jpg")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
mf = ONIX::MediaFile.new
|
28
28
|
|
29
29
|
mf.media_file_type_code = 2
|
data/spec/other_text_spec.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::OtherText" do
|
|
16
16
|
ot.to_xml.to_s[0,11].should eql("<OtherText>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
ot = ONIX::OtherText.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
ot.text_type_code.should eql(2)
|
23
23
|
ot.text[0,7].should eql("A woman")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
ot = ONIX::OtherText.new
|
28
28
|
|
29
29
|
ot.text_type_code = 2
|
data/spec/price_spec.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::Price" do
|
|
16
16
|
p.to_xml.to_s[0,7].should eql("<Price>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
p = ONIX::Price.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
p.price_type_code.should eql(2)
|
23
23
|
p.price_amount.should eql(BigDecimal.new("7.5"))
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
p = ONIX::Price.new
|
28
28
|
|
29
29
|
p.price_type_code = 1
|
@@ -16,14 +16,14 @@ context "ONIX::ProductIdentifier" do
|
|
16
16
|
id.to_xml.to_s[0,19].should eql("<ProductIdentifier>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
id = ONIX::ProductIdentifier.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
id.product_id_type.should eql(2)
|
23
23
|
id.id_value.should eql("0858198363")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
id = ONIX::ProductIdentifier.new
|
28
28
|
|
29
29
|
id.product_id_type = 2
|
data/spec/product_spec.rb
CHANGED
@@ -11,7 +11,7 @@ context "ONIX::Product" do
|
|
11
11
|
@product_node = @doc.root
|
12
12
|
end
|
13
13
|
|
14
|
-
specify "should provide read access to first level
|
14
|
+
specify "should provide read access to first level attributes" do
|
15
15
|
product = ONIX::Product.from_xml(@product_node.to_s)
|
16
16
|
|
17
17
|
product.record_reference.should eql("365-9780194351898")
|
@@ -52,7 +52,7 @@ context "ONIX::Product" do
|
|
52
52
|
product.measurements.size.should eql(1)
|
53
53
|
end
|
54
54
|
|
55
|
-
specify "should provide write access to first level
|
55
|
+
specify "should provide write access to first level attributes" do
|
56
56
|
product = ONIX::Product.new
|
57
57
|
|
58
58
|
product.notification_type = 3
|
data/spec/publisher_spec.rb
CHANGED
@@ -16,13 +16,13 @@ context "ONIX::Publisher" do
|
|
16
16
|
pub.to_xml.to_s[0,11].should eql("<Publisher>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
pub = ONIX::Publisher.from_xml(@root.to_s)
|
21
21
|
pub.publishing_role.should eql(1)
|
22
22
|
pub.publisher_name.should eql("Desbooks Publishing")
|
23
23
|
end
|
24
24
|
|
25
|
-
specify "should provide write access to first level
|
25
|
+
specify "should provide write access to first level attributes" do
|
26
26
|
pub = ONIX::Publisher.new
|
27
27
|
|
28
28
|
pub.publisher_name = "Paulist Press"
|
@@ -16,13 +16,13 @@ context "ONIX::SalesRestriction" do
|
|
16
16
|
sr.to_xml.to_s[0,18].should eql("<SalesRestriction>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
sr = ONIX::SalesRestriction.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
sr.sales_restriction_type.should eql(0)
|
23
23
|
end
|
24
24
|
|
25
|
-
specify "should provide write access to first level
|
25
|
+
specify "should provide write access to first level attributes" do
|
26
26
|
sr = ONIX::SalesRestriction.new
|
27
27
|
|
28
28
|
sr.sales_restriction_type = 1
|
data/spec/sender_identifier.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::SenderIdentifier" do
|
|
16
16
|
id.to_xml.to_s[0,18].should eql("<SenderIdentifier>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
id = ONIX::SenderIdentifier.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
id.sender_id_type.should eql(1)
|
23
23
|
id.id_value.should eql("123456")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
id = ONIX::SenderIdentifier.new
|
28
28
|
|
29
29
|
id.sender_id_type = 1
|
@@ -16,14 +16,14 @@ context "ONIX::SeriesIdentifier" do
|
|
16
16
|
series.to_xml.to_s[0,18].should eql("<SeriesIdentifier>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
series = ONIX::SeriesIdentifier.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
series.series_id_type.should eql(1)
|
23
23
|
series.id_value.should eql("10001")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
series = ONIX::SeriesIdentifier.new
|
28
28
|
|
29
29
|
series.series_id_type = 9
|
data/spec/series_spec.rb
CHANGED
@@ -16,13 +16,13 @@ context "ONIX::Series" do
|
|
16
16
|
series.to_xml.to_s[0,8].should eql("<Series>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
series = ONIX::Series.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
series.title_of_series.should eql("Citizens and Their Governments")
|
23
23
|
end
|
24
24
|
|
25
|
-
specify "should provide write access to first level
|
25
|
+
specify "should provide write access to first level attributes" do
|
26
26
|
series = ONIX::Series.new
|
27
27
|
|
28
28
|
series.title_of_series = "Cool Science Careers"
|
data/spec/set_spec.rb
CHANGED
@@ -16,13 +16,13 @@ context "ONIX::Set" do
|
|
16
16
|
set.to_xml.to_s[0,5].should eql("<Set>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
set = ONIX::Set.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
set.title_of_set.should eql("Citizens and Their Governments")
|
23
23
|
end
|
24
24
|
|
25
|
-
specify "should provide write access to first level
|
25
|
+
specify "should provide write access to first level attributes" do
|
26
26
|
set = ONIX::Set.new
|
27
27
|
|
28
28
|
set.title_of_set = "Cool Science Careers"
|
data/spec/sl_product_spec.rb
CHANGED
@@ -12,7 +12,7 @@ context "ONIX::SLProduct" do
|
|
12
12
|
@product_node = @doc.root
|
13
13
|
end
|
14
14
|
|
15
|
-
specify "should provide read access to
|
15
|
+
specify "should provide read access to attributes" do
|
16
16
|
@product = ONIX::Product.from_xml(@product_node.to_s)
|
17
17
|
@sl = ONIX::SLProduct.new(@product)
|
18
18
|
|
@@ -26,7 +26,7 @@ context "ONIX::SLProduct" do
|
|
26
26
|
@sl.pack_quantity.should eql(12)
|
27
27
|
end
|
28
28
|
|
29
|
-
specify "should provide write access to
|
29
|
+
specify "should provide write access to attributes" do
|
30
30
|
sl = ONIX::SLProduct.new
|
31
31
|
|
32
32
|
sl.notification_type = 3
|
@@ -41,8 +41,8 @@ context "ONIX::SLProduct" do
|
|
41
41
|
sl.number_of_pages = 100
|
42
42
|
sl.to_xml.to_s.include?("<NumberOfPages>100</NumberOfPages>").should be_true
|
43
43
|
|
44
|
-
sl.
|
45
|
-
sl.to_xml.to_s.include?("<
|
44
|
+
sl.basic_main_subject = "JNF053090"
|
45
|
+
sl.to_xml.to_s.include?("<BASICMainSubject>JNF053090</BASICMainSubject>").should be_true
|
46
46
|
|
47
47
|
sl.publishing_status = 4
|
48
48
|
sl.to_xml.to_s.include?("<PublishingStatus>04</PublishingStatus>").should be_true
|
data/spec/spec_helper.rb
CHANGED
data/spec/stock_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::Stock" do
|
|
16
16
|
s.to_xml.to_s[0,7].should eql("<Stock>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
s = ONIX::Stock.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
# note that these fields *should* be numeric according to the ONIX spec,
|
@@ -25,7 +25,7 @@ context "ONIX::Stock" do
|
|
25
25
|
s.on_order.should eql("0")
|
26
26
|
end
|
27
27
|
|
28
|
-
specify "should provide write access to first level
|
28
|
+
specify "should provide write access to first level attributes" do
|
29
29
|
s = ONIX::Stock.new
|
30
30
|
|
31
31
|
s.on_hand = "123"
|
data/spec/subject_spec.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::Subject" do
|
|
16
16
|
sub.to_xml.to_s[0,9].should eql("<Subject>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
sub = ONIX::Subject.from_xml(@root.to_s)
|
21
21
|
sub.subject_scheme_id.should eql(3)
|
22
22
|
sub.subject_scheme_name.should eql("RBA Subjects")
|
23
23
|
sub.subject_code.should eql("AABB")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
sub = ONIX::Subject.new
|
28
28
|
|
29
29
|
sub.subject_scheme_id = 2
|
data/spec/supply_detail_spec.rb
CHANGED
@@ -16,7 +16,7 @@ context "ONIX::SupplyDetail" do
|
|
16
16
|
sd.to_xml.to_s[0,14].should eql("<SupplyDetail>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
sd = ONIX::SupplyDetail.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
sd.supplier_name.should eql("Rainbow Book Agencies")
|
@@ -28,7 +28,7 @@ context "ONIX::SupplyDetail" do
|
|
28
28
|
sd.prices.size.should eql(1)
|
29
29
|
end
|
30
30
|
|
31
|
-
specify "should provide write access to first level
|
31
|
+
specify "should provide write access to first level attributes" do
|
32
32
|
sd = ONIX::SupplyDetail.new
|
33
33
|
|
34
34
|
sd.supplier_name = "RBA"
|
data/spec/title_spec.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::Title" do
|
|
16
16
|
t.to_xml.to_s[0,7].should eql("<Title>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
t = ONIX::Title.from_xml(@root.to_s)
|
21
21
|
t.title_type.should eql(1)
|
22
22
|
t.title_text.should eql("Good Grief")
|
23
23
|
t.subtitle.should eql("A Constructive Approach to the Problem of Loss")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
t = ONIX::Title.new
|
28
28
|
|
29
29
|
t.title_type = 1
|
data/spec/website_spec.rb
CHANGED
@@ -16,14 +16,14 @@ context "ONIX::Website" do
|
|
16
16
|
web.to_xml.to_s[0,9].should eql("<Website>")
|
17
17
|
end
|
18
18
|
|
19
|
-
specify "should provide read access to first level
|
19
|
+
specify "should provide read access to first level attributes" do
|
20
20
|
web = ONIX::Website.from_xml(@root.to_s)
|
21
21
|
|
22
22
|
web.website_role.should eql(1)
|
23
23
|
web.website_link.should eql("http://www.rainbowbooks.com.au")
|
24
24
|
end
|
25
25
|
|
26
|
-
specify "should provide write access to first level
|
26
|
+
specify "should provide write access to first level attributes" do
|
27
27
|
web = ONIX::Website.new
|
28
28
|
|
29
29
|
web.website_role = 2
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: milkfarm-onix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 53
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 8
|
8
|
-
-
|
9
|
-
version: 0.8.
|
9
|
+
- 5
|
10
|
+
version: 0.8.5
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- James Healy
|
@@ -14,30 +15,34 @@ autorequire:
|
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
18
|
+
date: 2010-10-17 00:00:00 -07:00
|
18
19
|
default_executable:
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
|
-
name: roxml
|
22
|
+
name: yob-roxml
|
22
23
|
prerelease: false
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
24
26
|
requirements:
|
25
27
|
- - ">="
|
26
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 15
|
27
30
|
segments:
|
28
31
|
- 3
|
29
32
|
- 1
|
30
|
-
-
|
31
|
-
version: 3.1.
|
33
|
+
- 6
|
34
|
+
version: 3.1.6
|
32
35
|
type: :runtime
|
33
36
|
version_requirements: *id001
|
34
37
|
- !ruby/object:Gem::Dependency
|
35
38
|
name: andand
|
36
39
|
prerelease: false
|
37
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
38
42
|
requirements:
|
39
43
|
- - ">="
|
40
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
41
46
|
segments:
|
42
47
|
- 0
|
43
48
|
version: "0"
|
@@ -47,29 +52,17 @@ dependencies:
|
|
47
52
|
name: nokogiri
|
48
53
|
prerelease: false
|
49
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
50
56
|
requirements:
|
51
57
|
- - ">="
|
52
58
|
- !ruby/object:Gem::Version
|
59
|
+
hash: 7
|
53
60
|
segments:
|
54
61
|
- 1
|
55
62
|
- 4
|
56
63
|
version: "1.4"
|
57
64
|
type: :runtime
|
58
65
|
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
|
73
66
|
description: A convient mapping between ruby objects and the ONIX XML specification
|
74
67
|
email: jimmy@deefa.com
|
75
68
|
executables: []
|
@@ -193,23 +186,27 @@ rdoc_options:
|
|
193
186
|
require_paths:
|
194
187
|
- lib
|
195
188
|
required_ruby_version: !ruby/object:Gem::Requirement
|
189
|
+
none: false
|
196
190
|
requirements:
|
197
191
|
- - ">="
|
198
192
|
- !ruby/object:Gem::Version
|
193
|
+
hash: 3
|
199
194
|
segments:
|
200
195
|
- 0
|
201
196
|
version: "0"
|
202
197
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
|
+
none: false
|
203
199
|
requirements:
|
204
200
|
- - ">="
|
205
201
|
- !ruby/object:Gem::Version
|
202
|
+
hash: 3
|
206
203
|
segments:
|
207
204
|
- 0
|
208
205
|
version: "0"
|
209
206
|
requirements: []
|
210
207
|
|
211
208
|
rubyforge_project: rbook
|
212
|
-
rubygems_version: 1.3.
|
209
|
+
rubygems_version: 1.3.7
|
213
210
|
signing_key:
|
214
211
|
specification_version: 3
|
215
212
|
summary: A convient mapping between ruby objects and the ONIX XML specification
|