From 2cd379b12eac02246ecc12b5e3cbb51069c9cedc Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Mon, 1 Jan 2018 10:39:22 -0800 Subject: Remove previously deprecated mixins and Chef::DSL::Recipe::FullDSL We wired these up previously with deprecations. They've been deprecated for a long time and are pretty rarely used on the Supermarket. Additionally we have Foodcritic rules to detect their usage: FC102: Deprecated Chef::DSL::Recipe::FullDSL class used FC100: Deprecated Chef::Mixin::Language mixin used FC099: Deprecated Chef::Mixin::LanguageIncludeRecipe mixin used FC098: Deprecated Chef::Mixin::RecipeDefinitionDSLCore mixin used FC097: Deprecated Chef::Mixin::LanguageIncludeAttribute mixin used Signed-off-by: Tim Smith --- lib/chef/dsl/data_query.rb | 6 +--- lib/chef/dsl/include_attribute.rb | 6 +--- lib/chef/dsl/include_recipe.rb | 6 +--- lib/chef/dsl/platform_introspection.rb | 6 +--- lib/chef/dsl/recipe.rb | 14 ++------ lib/chef/mixin/language.rb | 48 ---------------------------- lib/chef/mixin/language_include_attribute.rb | 34 -------------------- lib/chef/mixin/language_include_recipe.rb | 31 ------------------ lib/chef/mixin/recipe_definition_dsl_core.rb | 35 -------------------- lib/chef/shell/model_wrapper.rb | 2 +- spec/unit/dsl/recipe_spec.rb | 13 -------- 11 files changed, 7 insertions(+), 194 deletions(-) delete mode 100644 lib/chef/mixin/language.rb delete mode 100644 lib/chef/mixin/language_include_attribute.rb delete mode 100644 lib/chef/mixin/language_include_recipe.rb delete mode 100644 lib/chef/mixin/recipe_definition_dsl_core.rb diff --git a/lib/chef/dsl/data_query.rb b/lib/chef/dsl/data_query.rb index b966885724..8ec466ea35 100644 --- a/lib/chef/dsl/data_query.rb +++ b/lib/chef/dsl/data_query.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -83,7 +83,3 @@ class Chef end end end - -# **DEPRECATED** -# This used to be part of chef/mixin/language. Load the file to activate the deprecation code. -require "chef/mixin/language" diff --git a/lib/chef/dsl/include_attribute.rb b/lib/chef/dsl/include_attribute.rb index 6d27fefc25..9f73143722 100644 --- a/lib/chef/dsl/include_attribute.rb +++ b/lib/chef/dsl/include_attribute.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -55,7 +55,3 @@ class Chef end end end - -# **DEPRECATED** -# This used to be part of chef/mixin/language_include_attribute. Load the file to activate the deprecation code. -require "chef/mixin/language_include_attribute" diff --git a/lib/chef/dsl/include_recipe.rb b/lib/chef/dsl/include_recipe.rb index 9abd7d135b..d217c91d4b 100644 --- a/lib/chef/dsl/include_recipe.rb +++ b/lib/chef/dsl/include_recipe.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,7 +38,3 @@ class Chef end end end - -# **DEPRECATED** -# This used to be part of chef/mixin/language_include_recipe. Load the file to activate the deprecation code. -require "chef/mixin/language_include_recipe" diff --git a/lib/chef/dsl/platform_introspection.rb b/lib/chef/dsl/platform_introspection.rb index dc309f9acb..2e31e0b95b 100644 --- a/lib/chef/dsl/platform_introspection.rb +++ b/lib/chef/dsl/platform_introspection.rb @@ -1,6 +1,6 @@ # # Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -262,7 +262,3 @@ class Chef end end end - -# **DEPRECATED** -# This used to be part of chef/mixin/language. Load the file to activate the deprecation code. -require "chef/mixin/language" diff --git a/lib/chef/dsl/recipe.rb b/lib/chef/dsl/recipe.rb index dedf291857..9da812cec0 100644 --- a/lib/chef/dsl/recipe.rb +++ b/lib/chef/dsl/recipe.rb @@ -1,7 +1,7 @@ -#-- +# # Author:: Adam Jacob () # Author:: Christopher Walters () -# Copyright:: Copyright 2008-2017, Chef Software Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -74,19 +74,9 @@ class Chef def exec(args) raise Chef::Exceptions::ResourceNotFound, "exec was called, but you probably meant to use an execute resource. If not, please call Kernel#exec explicitly. The exec block called was \"#{args}\"" end - - # @deprecated Use Chef::DSL::Recipe instead, will be removed in Chef 13 - module FullDSL - include Chef::DSL::Recipe - extend Chef::Mixin::LazyModuleInclude - end end end end # Avoid circular references for things that are only used in instance methods require "chef/resource" - -# **DEPRECATED** -# This used to be part of chef/mixin/recipe_definition_dsl_core. Load the file to activate the deprecation code. -require "chef/mixin/recipe_definition_dsl_core" diff --git a/lib/chef/mixin/language.rb b/lib/chef/mixin/language.rb deleted file mode 100644 index 3f53645a55..0000000000 --- a/lib/chef/mixin/language.rb +++ /dev/null @@ -1,48 +0,0 @@ -# -# Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. -# License:: Apache License, Version 2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require "chef/dsl/platform_introspection" -require "chef/dsl/data_query" -require "chef/mixin/deprecation" - -class Chef - module Mixin - - # == [DEPRECATED] Chef::Mixin::DeprecatedLanguageModule - # This module is a temporary replacement for the previous - # Chef::Mixin::Language. That module's functionality was split into two - # modules, Chef::DSL::PlatformIntrospection, and Chef::DSL::DataQuery. - # - # This module includes both PlatformIntrospection and DataQuery to provide - # the same interfaces and behavior as the prior Mixin::Language. - # - # This module is loaded via const_missing hook when Chef::Mixin::Language - # is accessed. See chef/mixin/deprecation for details. - module DeprecatedLanguageModule - - include Chef::DSL::PlatformIntrospection - include Chef::DSL::DataQuery - - end - - deprecate_constant(:Language, DeprecatedLanguageModule, <<-EOM) -Chef::Mixin::Language is deprecated. Use either (or both) -Chef::DSL::PlatformIntrospection or Chef::DSL::DataQuery instead. -EOM - end -end diff --git a/lib/chef/mixin/language_include_attribute.rb b/lib/chef/mixin/language_include_attribute.rb deleted file mode 100644 index 7cb66dc272..0000000000 --- a/lib/chef/mixin/language_include_attribute.rb +++ /dev/null @@ -1,34 +0,0 @@ -# -# Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. -# License:: Apache License, Version 2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require "chef/dsl/include_attribute" -require "chef/mixin/deprecation" - -class Chef - module Mixin - - # DEPRECATED: This is just here for compatibility, use - # Chef::DSL::IncludeAttribute instead. - - deprecate_constant(:LanguageIncludeAttribute, Chef::DSL::IncludeAttribute, <<-EOM) -Chef::Mixin::LanguageIncludeAttribute is deprecated. Use -Chef::DSL::IncludeAttribute instead. -EOM - - end -end diff --git a/lib/chef/mixin/language_include_recipe.rb b/lib/chef/mixin/language_include_recipe.rb deleted file mode 100644 index 97e384c7c4..0000000000 --- a/lib/chef/mixin/language_include_recipe.rb +++ /dev/null @@ -1,31 +0,0 @@ -# -# Author:: Adam Jacob () -# Copyright:: Copyright 2008-2016, Chef Software Inc. -# License:: Apache License, Version 2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require "chef/dsl/include_recipe" -require "chef/mixin/deprecation" - -class Chef - module Mixin - - deprecate_constant(:LanguageIncludeRecipe, Chef::DSL::IncludeRecipe, <<-EOM) -Chef::Mixin::LanguageIncludeRecipe is deprecated, use Chef::DSL::IncludeRecipe -instead. -EOM - - end -end diff --git a/lib/chef/mixin/recipe_definition_dsl_core.rb b/lib/chef/mixin/recipe_definition_dsl_core.rb deleted file mode 100644 index 6a9b12d31a..0000000000 --- a/lib/chef/mixin/recipe_definition_dsl_core.rb +++ /dev/null @@ -1,35 +0,0 @@ -#-- -# Author:: Adam Jacob () -# Author:: Christopher Walters () -# Copyright:: Copyright 2008-2016, Chef Software Inc. -# License:: Apache License, Version 2.0 -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -### -# NOTE: This file and constant are here only for backwards compatibility. -# New code should use Chef::DSL::Recipe instead. -# -# This constant (module name) will eventually be deprecated and then removed. -### - -require "chef/mixin/deprecation" - -class Chef - module Mixin - deprecate_constant(:RecipeDefinitionDSLCore, Chef::DSL::Recipe, <<-EOM) -Chef::Mixin::RecipeDefinitionDSLCore is deprecated. Use Chef::DSL::Recipe instead. -EOM - end -end diff --git a/lib/chef/shell/model_wrapper.rb b/lib/chef/shell/model_wrapper.rb index 8c3e456a9b..4394caa395 100644 --- a/lib/chef/shell/model_wrapper.rb +++ b/lib/chef/shell/model_wrapper.rb @@ -17,7 +17,7 @@ # require "chef/mixin/convert_to_class_name" -require "chef/mixin/language" +require "chef/dsl/data_query" module Shell class ModelWrapper diff --git a/spec/unit/dsl/recipe_spec.rb b/spec/unit/dsl/recipe_spec.rb index bc97ecc029..cd01079c15 100644 --- a/spec/unit/dsl/recipe_spec.rb +++ b/spec/unit/dsl/recipe_spec.rb @@ -24,11 +24,6 @@ class RecipeDSLExampleClass include Chef::DSL::Recipe end -FullRecipeDSLExampleClass = Struct.new(:cookbook_name, :recipe_name) -class FullRecipeDSLExampleClass - include Chef::DSL::Recipe::FullDSL -end - RecipeDSLBaseAPI = Struct.new(:cookbook_name, :recipe_name) class RecipeDSLExampleSubclass < RecipeDSLBaseAPI include Chef::DSL::Recipe @@ -41,14 +36,6 @@ describe Chef::DSL::Recipe do let(:cookbook_name) { "example_cb" } let(:recipe_name) { "example_recipe" } - it "tracks when it is included via FullDSL" do - expect(Chef::DSL::Recipe::FullDSL.descendants).to include(FullRecipeDSLExampleClass) - end - - it "doesn't track what is included via only the recipe DSL" do - expect(Chef::DSL::Recipe::FullDSL.descendants).not_to include(RecipeDSLExampleClass) - end - shared_examples_for "A Recipe DSL Implementation" do it "responds to cookbook_name" do -- cgit v1.2.1