Class: Chef::Resource::RemoteDirectory
- Inherits:
-
Directory
- Object
- Chef::Resource
- Directory
- Chef::Resource::RemoteDirectory
- Includes:
- Mixin::Securable
- Defined in:
- lib/chef/resource/remote_directory.rb
Constant Summary
Constants inherited from Chef::Resource
Instance Attribute Summary
Attributes inherited from Chef::Resource
#allowed_actions, #cookbook_name, #delayed_notifications, #enclosing_provider, #immediate_notifications, #not_if_args, #only_if_args, #params, #provider, #recipe_name, #resource_name, #retries, #retry_delay, #run_context, #source_line, #updated
Instance Method Summary collapse
- #cookbook(args = nil) ⇒ Object
- #files_backup(arg = nil) ⇒ Object
- #files_group(arg = nil) ⇒ Object
- #files_mode(arg = nil) ⇒ Object
- #files_owner(arg = nil) ⇒ Object
-
#initialize(name, run_context = nil) ⇒ RemoteDirectory
constructor
A new instance of RemoteDirectory.
- #overwrite(arg = nil) ⇒ Object
- #purge(arg = nil) ⇒ Object
- #source(args = nil) ⇒ Object
Methods included from Mixin::Securable
#group, #inherits, #mode, #owner, rights_attribute
Methods inherited from Directory
Methods inherited from Chef::Resource
#action, #add_notification, #after_created, #as_json, attribute, build_from_file, #defined_at, #epic_fail, #ignore_failure, #inspect, #is, json_create, #load_prior_resource, #method_missing, #name, #node, #noop, #not_if, #notifies, #notifies_delayed, #notifies_immediately, #only_if, platform_map, provider_base, provides, #resolve_notification_references, resource_for_node, resource_for_platform, #resources, #run_action, #should_skip?, #subscribes, #supports, #to_hash, #to_json, #to_s, #to_text, #updated?, #updated_by_last_action, #updated_by_last_action?
Methods included from Mixin::ConvertToClassName
#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename
Methods included from Mixin::Deprecation
Methods included from Mixin::Language
#data_bag, #data_bag_item, #platform?, #platform_family?, #search, #value_for_platform, #value_for_platform_family
Methods included from Mixin::ParamsValidate
Methods included from Mixin::CheckHelper
Constructor Details
#initialize(name, run_context = nil) ⇒ RemoteDirectory
Returns a new instance of RemoteDirectory.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/chef/resource/remote_directory.rb', line 30 def initialize(name, run_context=nil) super @resource_name = :remote_directory @path = name @source = ::File.basename(name) @delete = false @action = :create @recursive = true @purge = false @files_backup = 5 @files_owner = nil @files_group = nil @files_mode = 0644 unless Chef::Platform.windows? @overwrite = true @allowed_actions.push(:create, :create_if_missing, :delete) @cookbook = nil @provider = Chef::Provider::RemoteDirectory end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Chef::Resource
Instance Method Details
#cookbook(args = nil) ⇒ Object
110 111 112 113 114 115 116 |
# File 'lib/chef/resource/remote_directory.rb', line 110 def cookbook(args=nil) set_or_return( :cookbook, args, :kind_of => String ) end |
#files_backup(arg = nil) ⇒ Object
57 58 59 60 61 62 63 |
# File 'lib/chef/resource/remote_directory.rb', line 57 def files_backup(arg=nil) set_or_return( :files_backup, arg, :kind_of => [ Integer, FalseClass ] ) end |
#files_group(arg = nil) ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/chef/resource/remote_directory.rb', line 73 def files_group(arg=nil) set_or_return( :files_group, arg, :regex => Chef::Config[:group_valid_regex] ) end |
#files_mode(arg = nil) ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/chef/resource/remote_directory.rb', line 86 def files_mode(arg=nil) set_or_return( :files_mode, arg, :regex => /^\d{3,4}$/ ) end |
#files_owner(arg = nil) ⇒ Object
94 95 96 97 98 99 100 |
# File 'lib/chef/resource/remote_directory.rb', line 94 def files_owner(arg=nil) set_or_return( :files_owner, arg, :regex => Chef::Config[:user_valid_regex] ) end |
#overwrite(arg = nil) ⇒ Object
102 103 104 105 106 107 108 |
# File 'lib/chef/resource/remote_directory.rb', line 102 def overwrite(arg=nil) set_or_return( :overwrite, arg, :kind_of => [ TrueClass, FalseClass ] ) end |
#purge(arg = nil) ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/chef/resource/remote_directory.rb', line 65 def purge(arg=nil) set_or_return( :purge, arg, :kind_of => [ TrueClass, FalseClass ] ) end |