om 1.6.0.rc1 → 1.6.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
data/History.textile CHANGED
@@ -1,5 +1,6 @@
1
1
  h3. 1.6.0
2
2
  Delegate all methods on the dynamic node to the found values
3
+ Allow arrays to be set on dynamic nodes
3
4
 
4
5
  h3. 1.5.3
5
6
 
data/lib/om/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Om
2
- VERSION = "1.6.0.rc1"
2
+ VERSION = "1.6.0.rc2"
3
3
  end
@@ -73,7 +73,8 @@ module OM
73
73
  z = new_values[y]
74
74
  ## If we pass something that already has an index on it, we should be able to add it.
75
75
  if @document.find_by_xpath(xpath)[y.to_i].nil? || y.to_i == -1
76
- @document.term_values_append(:parent_select=> parent.to_pointer,:parent_index=>0,:template=>to_pointer,:values=>z)
76
+ parent_pointer = parent ? parent.to_pointer : nil
77
+ @document.term_values_append(:parent_select=> parent_pointer,:parent_index=>0,:template=>to_pointer,:values=>z)
77
78
  else
78
79
  @document.term_value_update(xpath, y.to_i, z)
79
80
  end
@@ -22,6 +22,11 @@ describe "OM::XML::DynamicNode" do
22
22
  @article.abstract.should == ["My Abstract"]
23
23
  end
24
24
 
25
+ it "should be able to set first level elements that are arrays" do
26
+ @article.abstract = ["My Abstract", "two"]
27
+ @article.abstract.should == ["My Abstract", 'two']
28
+ end
29
+
25
30
  it "should delegate all methods (i.e. to_s, first, etc.) to the found array" do
26
31
  @article.person.last_name.to_s.should == ["FAMILY NAME", "Gautama"].to_s
27
32
  @article.person.last_name.first.should == "FAMILY NAME"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: om
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0.rc1
4
+ version: 1.6.0.rc2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-26 00:00:00.000000000 Z
12
+ date: 2012-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &70128708883620 !ruby/object:Gem::Requirement
16
+ requirement: &70144026489500 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.4.2
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70128708883620
24
+ version_requirements: *70144026489500
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mediashelf-loggable
27
- requirement: &70128708883180 !ruby/object:Gem::Requirement
27
+ requirement: &70144026489060 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70128708883180
35
+ version_requirements: *70144026489060
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec
38
- requirement: &70128708882600 !ruby/object:Gem::Requirement
38
+ requirement: &70144026488480 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '2.0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70128708882600
46
+ version_requirements: *70144026488480
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: mocha
49
- requirement: &70128708882080 !ruby/object:Gem::Requirement
49
+ requirement: &70144026487960 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 0.9.8
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70128708882080
57
+ version_requirements: *70144026487960
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: equivalent-xml
60
- requirement: &70128708881580 !ruby/object:Gem::Requirement
60
+ requirement: &70144026487460 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: 0.2.4
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70128708881580
68
+ version_requirements: *70144026487460
69
69
  description: ! 'OM (Opinionated Metadata): A library to help you tame sprawling XML
70
70
  schemas like MODS. Wraps Nokogiri documents in objects with miscellaneous helper
71
71
  methods for doing things like retrieve generated xpath queries or look up properties