summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-10-19 11:38:43 -0700
committerdanielsdeleo <dan@opscode.com>2012-10-19 16:00:14 -0700
commit17329e3456cc0db6fffb8ef83849bb0228aaa468 (patch)
tree7e32fa078511d247fcccbb6416aee9952e75bf90
parent73859742341c45b4e539204e95c295854d50b61c (diff)
downloadchef-17329e3456cc0db6fffb8ef83849bb0228aaa468.tar.gz
[CHEF-2737] remove unused array sorting feature
-rw-r--r--chef/lib/chef/mixin/deep_merge.rb4
-rw-r--r--chef/spec/unit/mixin/deep_merge_spec.rb7
2 files changed, 0 insertions, 11 deletions
diff --git a/chef/lib/chef/mixin/deep_merge.rb b/chef/lib/chef/mixin/deep_merge.rb
index 2c82d39d2d..d443066cad 100644
--- a/chef/lib/chef/mixin/deep_merge.rb
+++ b/chef/lib/chef/mixin/deep_merge.rb
@@ -73,8 +73,6 @@ class Chef
# Set to string value to signify prefix which deletes elements from existing element
# A colon is appended when indicating a specific value, eg:
# :knockout_prefix => "dontmerge", is referenced as "dontmerge:foobar" in an array
- # :sort_merged_arrays DEFAULT: false
- # Set to true to sort all arrays that are merged together
# :merge_debug DEFAULT: false
# Set to true to get console output of merge process for debugging
#
@@ -108,7 +106,6 @@ class Chef
knockout_prefix = options[:knockout_prefix] || nil
raise InvalidParameter, "knockout_prefix cannot be an empty string in deep_merge!" if knockout_prefix == ""
# request that we sort together any arrays when they are merged
- sort_merged_arrays = options[:sort_merged_arrays] || false
di = options[:debug_indent] || ''
# do nothing if source is nil
return dest if source.nil?
@@ -169,7 +166,6 @@ class Chef
end
puts "#{di} merging arrays: #{source.inspect} :: #{dest.inspect}" if merge_debug
dest = dest | source
- dest.sort! if sort_merged_arrays
else
puts "#{di} overwriting dest: #{source.inspect} -over-> #{dest.inspect}" if merge_debug
dest = overwrite_unmergeables(source, dest, options)
diff --git a/chef/spec/unit/mixin/deep_merge_spec.rb b/chef/spec/unit/mixin/deep_merge_spec.rb
index 740fa91d77..028ce274a8 100644
--- a/chef/spec/unit/mixin/deep_merge_spec.rb
+++ b/chef/spec/unit/mixin/deep_merge_spec.rb
@@ -82,13 +82,6 @@ describe Chef::Mixin::DeepMerge, "deep_merge!" do
hash_dst.should == {"property" => ["2","4","1","3"]}
end
- it "tests hashes holding array (sorted)" do
- hash_src = {"property" => ["1","3"]}
- hash_dst = {"property" => ["2","4"]}
- @dm.deep_merge!(hash_src, hash_dst, {:sort_merged_arrays => true})
- hash_dst.should == {"property" => ["1","2","3","4"]}
- end
-
it "tests hashes holding hashes holding arrays (array with duplicate elements is merged with dest then src" do
hash_src = {"property" => {"bedroom_count" => ["1", "2"], "bathroom_count" => ["1", "4+"]}}
hash_dst = {"property" => {"bedroom_count" => ["3", "2"], "bathroom_count" => ["2"]}}