Method: EasyType::SourceDir#initialize

Defined in:
lib/easy_type/source_dir.rb

#initialize(options = {}) ⇒ SourceDir

Returns a new instance of SourceDir.



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/easy_type/source_dir.rb', line 130

def initialize(options = {})
  if defined?(@@to_cleanup).nil?
    @@to_cleanup = []
    at_exit do
      Puppet.debug "Cleaning files created by source_dir attributes."
      @@to_cleanup.each do |file| 
        Puppet.debug "cleaning file/directory #{file}..."
        FileUtils.rm_rf(file)
      end
    end
  end
  @@fetched_files ||= {}
  super(**options)
  self
end