aduki 0.0.5 → 0.0.6

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.
@@ -63,7 +63,7 @@ module Aduki
63
63
  setters = split_attributes attrs
64
64
  klass = object.class
65
65
 
66
- setters.each do |setter, value|
66
+ setters.sort.each do |setter, value|
67
67
  if setter.match(/\[\d+\]/)
68
68
  setter = setter.gsub(/\[\d+\]/, '')
69
69
  array = object.send setter.to_sym
@@ -1,3 +1,3 @@
1
1
  module Aduki
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -54,7 +54,7 @@ describe Aduki::Initializer do
54
54
  "machines[1].builder.email" => "waggie@bump",
55
55
  "machines[1].builder.phone" => "4101",
56
56
  "machines[1].builder.office" => "3rd floor room 23",
57
- "machines[1].assemblies[98].name" => "second machine, first assembly", # the array index distinguishes items but does not order them
57
+ "machines[1].assemblies[98].name" => "second machine, first assembly", # the array index orders items but the position is not respected
58
58
  "machines[1].assemblies[98].colour" => "purple",
59
59
  "machines[1].assemblies[98].size" => "pretty small",
60
60
  "machines[1].assemblies[1].name" => "second machine, second assembly",
@@ -138,12 +138,12 @@ describe Aduki::Initializer do
138
138
  model.machines[1].builder.email.should == "waggie@bump"
139
139
  model.machines[1].builder.phone.should == "4101"
140
140
  model.machines[1].builder.office.should == "3rd floor room 23"
141
- model.machines[1].assemblies[0].name.should == "second machine, first assembly"
142
- model.machines[1].assemblies[0].colour.should == "purple"
143
- model.machines[1].assemblies[0].size.should == "pretty small"
144
- model.machines[1].assemblies[1].name.should == "second machine, second assembly"
145
- model.machines[1].assemblies[1].colour.should == "turquoise"
146
- model.machines[1].assemblies[1].size.should == "large-ish"
141
+ model.machines[1].assemblies[0].name.should == "second machine, second assembly"
142
+ model.machines[1].assemblies[0].colour.should == "turquoise"
143
+ model.machines[1].assemblies[0].size.should == "large-ish"
144
+ model.machines[1].assemblies[1].name.should == "second machine, first assembly"
145
+ model.machines[1].assemblies[1].colour.should == "purple"
146
+ model.machines[1].assemblies[1].size.should == "pretty small"
147
147
  model.machines[1].assemblies[2].name.should == "second machine, third assembly"
148
148
  model.machines[1].assemblies[2].colour.should == "magenta"
149
149
  model.machines[1].assemblies[2].size.should == "gigantic"
@@ -167,12 +167,12 @@ describe Aduki::Initializer do
167
167
  model.countries[4].should == "Spain"
168
168
 
169
169
  sensibly_indexed_props = props.merge({
170
- "machines[1].assemblies[0].name" => "second machine, first assembly", # the array index distinguishes items but does not order them
171
- "machines[1].assemblies[0].colour" => "purple",
172
- "machines[1].assemblies[0].size" => "pretty small",
173
- "machines[1].assemblies[1].name" => "second machine, second assembly",
174
- "machines[1].assemblies[1].colour" => "turquoise",
175
- "machines[1].assemblies[1].size" => "large-ish",
170
+ "machines[1].assemblies[0].name" => "second machine, second assembly",
171
+ "machines[1].assemblies[0].colour" => "turquoise",
172
+ "machines[1].assemblies[0].size" => "large-ish",
173
+ "machines[1].assemblies[1].name" => "second machine, first assembly", # the array index orders items but the position is not respected
174
+ "machines[1].assemblies[1].colour" => "purple",
175
+ "machines[1].assemblies[1].size" => "pretty small",
176
176
  "machines[1].assemblies[2].name" => "second machine, third assembly",
177
177
  "machines[1].assemblies[2].colour" => "magenta",
178
178
  "machines[1].assemblies[2].size" => "gigantic",
@@ -70,7 +70,7 @@ describe Aduki do
70
70
  "harpoon" => ["shonk",
71
71
  "twaddle",
72
72
  %w{alpha beta gamma},
73
- { wing: :tip, tail: :fin } ]
73
+ { :wing => :tip, :tail => :fin } ]
74
74
  } }
75
75
  props = Aduki.to_aduki hsh
76
76
  props.should == {
@@ -96,7 +96,7 @@ describe Aduki do
96
96
  "harpoon" => ["shonk",
97
97
  "twaddle",
98
98
  %w{alpha beta gamma},
99
- { wing: :tip, tail: :fin } ]
99
+ { :wing => :tip, :tail => :fin } ]
100
100
  } }
101
101
  props = Aduki.to_aduki hsh
102
102
  props.should == {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aduki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-15 00:00:00.000000000 Z
12
+ date: 2013-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec