summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-04-05 23:18:57 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-04-05 23:18:57 -0700
commitab21f587242c428940907ec28838aeeb5b7752d6 (patch)
treecbcfcd467b61f1f763df3a6ec7708ef6a6e57541
parent0537474a7c576011b12149725f65da617b3e1ef0 (diff)
downloadchef-lcg/unused-resource-collection-apis.tar.gz
remove completely unused resource collection APIslcg/unused-resource-collection-apis
deprecated, no specs to delete Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/resource_collection.rb23
-rw-r--r--lib/chef/resource_collection/resource_list.rb7
-rw-r--r--lib/chef/resource_collection/resource_set.rb3
3 files changed, 3 insertions, 30 deletions
diff --git a/lib/chef/resource_collection.rb b/lib/chef/resource_collection.rb
index e450f4f19e..e4941c0e7e 100644
--- a/lib/chef/resource_collection.rb
+++ b/lib/chef/resource_collection.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
-# Copyright:: Copyright 2008-2016, Chef Software Inc.
+# Copyright:: Copyright 2008-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,9 +48,7 @@ class Chef
# @param instance_name [String] If known, the recource name as used in the recipe, IE `vim` in `package 'vim'`
# This method is meant to be the 1 insert method necessary in the future. It should support all known use cases
# for writing into the ResourceCollection.
- def insert(resource, opts = {})
- resource_type ||= opts[:resource_type] # Would rather use Ruby 2.x syntax, but oh well
- instance_name ||= opts[:instance_name]
+ def insert(resource, resource_type: nil, instance_name: nil)
resource_list.insert(resource)
if !(resource_type.nil? && instance_name.nil?)
resource_set.insert_as(resource, resource_type, instance_name)
@@ -64,23 +62,6 @@ class Chef
resource_set.delete(key)
end
- # @deprecated
- def []=(index, resource)
- Chef::Log.warn("`[]=` is deprecated, use `insert` (which only inserts at the end)")
- resource_list[index] = resource
- resource_set.insert_as(resource)
- end
-
- # @deprecated
- def push(*resources)
- Chef::Log.warn("`push` is deprecated, use `insert`")
- resources.flatten.each do |res|
- insert(res)
- end
- self
- end
-
- # @deprecated
alias_method :<<, :insert
# Read-only methods are simple to delegate - doing that below
diff --git a/lib/chef/resource_collection/resource_list.rb b/lib/chef/resource_collection/resource_list.rb
index 75305f63a6..dfc8393b0e 100644
--- a/lib/chef/resource_collection/resource_list.rb
+++ b/lib/chef/resource_collection/resource_list.rb
@@ -1,6 +1,6 @@
#
# Author:: Tyler Ball (<tball@chef.io>)
-# Copyright:: Copyright 2014-2016, Chef Software, Inc.
+# Copyright:: Copyright 2014-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -77,11 +77,6 @@ class Chef
ret
end
- # @deprecated - can be removed when it is removed from resource_collection.rb
- def []=(index, resource)
- @resources[index] = resource
- end
-
def all_resources
@resources
end
diff --git a/lib/chef/resource_collection/resource_set.rb b/lib/chef/resource_collection/resource_set.rb
index 6ff29247a0..9dc4477efc 100644
--- a/lib/chef/resource_collection/resource_set.rb
+++ b/lib/chef/resource_collection/resource_set.rb
@@ -101,9 +101,6 @@ class Chef
flat_results.length == 1 ? flat_results[0] : flat_results
end
- # @deprecated
- # resources is a poorly named, but we have to maintain it for back
- # compat.
alias_method :resources, :find
# Returns true if +query_object+ is a valid string for looking up a