Module: Squib::Args::DirValidator Private

Included in:
SaveBatch, Sheet, ShowcaseSpecial
Defined in:
lib/squib/args/dir_validator.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#ensure_dir_created(dir) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



6
7
8
9
10
11
12
# File 'lib/squib/args/dir_validator.rb', line 6

def ensure_dir_created(dir)
  unless Dir.exists?(dir)
    Squib.logger.warn "Dir '#{dir}' does not exist, creating it."
    FileUtils.mkdir_p dir
  end
  return dir
end