Skip to content

Commit

Permalink
Merge pull request #9411 from chef/lcg/remove-core-dsl
Browse files Browse the repository at this point in the history
Remove the "Core" DSL for Chef-16
  • Loading branch information
lamont-granquist committed Feb 28, 2020
2 parents 36a7276 + 3539130 commit 8a47d92
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 77 deletions.
52 changes: 0 additions & 52 deletions lib/chef/dsl/core.rb

This file was deleted.

21 changes: 8 additions & 13 deletions lib/chef/dsl/recipe.rb
@@ -1,7 +1,7 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
# Copyright:: Copyright 2008-2019, Chef Software Inc.
# Copyright:: Copyright 2008-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -22,31 +22,29 @@
require_relative "definitions"
require_relative "include_recipe"
require_relative "reboot_pending"
require_relative "core"
require_relative "universal"
require_relative "declare_resource"
require_relative "../mixin/notifying_block"
require_relative "../mixin/lazy_module_include"

class Chef
module DSL
# Part of a family of DSL mixins.
#
# Chef::DSL::Recipe mixes into Recipes and LWRP Providers.
# - this does not target core chef resources and providers.
# Chef::DSL::Recipe mixes into Recipes and Providers.
# - this is restricted to recipe/resource/provider context where a resource collection exists.
# - cookbook authors should typically include modules into here.
#
# Chef::DSL::Core mixes into Recipes, LWRP Providers and Core Providers
# - this adds cores providers on top of the Recipe DSL.
# - this is restricted to recipe/resource/provider context where a resource collection exists.
# - core chef authors should typically include modules into here.
#
# Chef::DSL::Universal mixes into Recipes, LWRP Resources+Providers, Core Resources+Providers, and Attributes files.
# - this adds resources and attributes files.
# - do not add helpers which manipulate the resource collection.
# - this is for general-purpose stuff that is useful nearly everywhere.
# - it also pollutes the namespace of nearly every context, watch out.
#
module Recipe
include Chef::DSL::Core
include Chef::DSL::Universal
include Chef::DSL::DeclareResource
include Chef::Mixin::NotifyingBlock
include Chef::DSL::IncludeRecipe
include Chef::DSL::RebootPending
include Chef::DSL::Resources
Expand All @@ -69,6 +67,3 @@ def exec(args)
end
end
end

# Avoid circular references for things that are only used in instance methods
require_relative "../resource"
10 changes: 2 additions & 8 deletions lib/chef/dsl/universal.rb
@@ -1,7 +1,7 @@
#--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: Christopher Walters (<cw@chef.io>)
# Copyright:: Copyright 2008-2019, Chef Software Inc.
# Copyright:: Copyright 2008-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -30,16 +30,10 @@ class Chef
module DSL
# Part of a family of DSL mixins.
#
# Chef::DSL::Recipe mixes into Recipes and LWRP Providers.
# - this does not target core chef resources and providers.
# Chef::DSL::Recipe mixes into Recipes and Providers.
# - this is restricted to recipe/resource/provider context where a resource collection exists.
# - cookbook authors should typically include modules into here.
#
# Chef::DSL::Core mixes into Recipes, LWRP Providers and Core Providers
# - this adds cores providers on top of the Recipe DSL.
# - this is restricted to recipe/resource/provider context where a resource collection exists.
# - core chef authors should typically include modules into here.
#
# Chef::DSL::Universal mixes into Recipes, LWRP Resources+Providers, Core Resources+Providers, and Attributes files.
# - this adds resources and attributes files.
# - do not add helpers which manipulate the resource collection.
Expand Down
5 changes: 2 additions & 3 deletions lib/chef/provider.rb
Expand Up @@ -23,7 +23,7 @@
require_relative "mixin/why_run"
require_relative "mixin/shell_out"
require_relative "mixin/provides"
require_relative "dsl/core"
require_relative "dsl/recipe"
require_relative "platform/service_helpers"
require_relative "node_map"
require "forwardable" unless defined?(Forwardable)
Expand All @@ -44,8 +44,7 @@ class Provider
extend Chef::Mixin::Provides
extend Forwardable

# includes the "core" DSL and not the "recipe" DSL by design
include Chef::DSL::Core
include Chef::DSL::Recipe
# the class only gets the Universal DSL (no resource_collection at class parsing time)
extend Chef::DSL::Universal

Expand Down
2 changes: 1 addition & 1 deletion lib/chef/resource/action_class.rb
@@ -1,6 +1,6 @@
#
# Author:: John Keiser (<jkeiser@chef.io)
# Copyright:: Copyright 2015-2019, Chef Software Inc.
# Copyright:: Copyright 2015-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 8a47d92

Please sign in to comment.