Sha256: ce6304fe288b4e95885cccd05fbc76cbcdf6fed8879afd4f6bc218c26c94e842
Contents?: true
Size: 740 Bytes
Versions: 18
Compression:
Stored size: 740 Bytes
Contents
# encoding: utf-8 module ProxyTester module Actions class CreateDirectory private attr_reader :fs_engine, :path, :options public def initialize(path, options = {}, fs_engine = FileUtils) @path =::File.expand_path(path) @options = options @fs_engine = fs_engine end def run if need_to_run? || options[:force] == true ProxyTester.ui_logger.warn "Creating directory \"#{path}\"." fs_engine.mkdir_p(path) else ProxyTester.ui_logger.warn "Directory \"#{path}\" already exists. Do not create it again!." end end private def need_to_run? !::File.exists?(path) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems