diff options
-rw-r--r-- | lib/chef/resource/directory.rb | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/lib/chef/resource/directory.rb b/lib/chef/resource/directory.rb index faad659668..b989b3ecde 100644 --- a/lib/chef/resource/directory.rb +++ b/lib/chef/resource/directory.rb @@ -2,7 +2,7 @@ # Author:: Adam Jacob (<adam@chef.io>) # Author:: Seth Chisamore (<schisamo@chef.io>) # Author:: Tyler Cloke (<tyler@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"); @@ -19,14 +19,16 @@ # require "chef/resource" -require "chef/provider/directory" require "chef/mixin/securable" class Chef class Resource + # Use the directory resource to manage a directory, which is a hierarchy of folders that comprises all of the + # information stored on a computer. The root directory is the top-level, under which the rest of the directory + # is organized. The directory resource uses the name property to specify the path to a location in a directory. + # Typically, permission to access that location in the directory is required. class Directory < Chef::Resource - - identity_attr :path + resource_name :directory state_attrs :group, :mode, :owner @@ -35,28 +37,8 @@ class Chef default_action :create allowed_actions :create, :delete - def initialize(name, run_context = nil) - super - @path = name - @recursive = false - end - - def recursive(arg = nil) - set_or_return( - :recursive, - arg, - :kind_of => [ TrueClass, FalseClass ] - ) - end - - def path(arg = nil) - set_or_return( - :path, - arg, - :kind_of => String - ) - end - + property :path, String, name_property: true, identity: true + property :recursive, [ TrueClass, FalseClass ], default: false end end end |