Class: TestServer::Actions::CreateDirectory
- Inherits:
-
Object
- Object
- TestServer::Actions::CreateDirectory
- Defined in:
- lib/test_server/actions/create_directory.rb
Instance Method Summary collapse
-
#initialize(path, options = {}, fs_engine = FileUtils) ⇒ CreateDirectory
constructor
A new instance of CreateDirectory.
- #run ⇒ Object
Constructor Details
#initialize(path, options = {}, fs_engine = FileUtils) ⇒ CreateDirectory
Returns a new instance of CreateDirectory.
11 12 13 14 15 |
# File 'lib/test_server/actions/create_directory.rb', line 11 def initialize(path, = {}, fs_engine = FileUtils) @path =::File.(path) @options = @fs_engine = fs_engine end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/test_server/actions/create_directory.rb', line 17 def run if need_to_run? || [:force] == true TestServer.ui_logger.warn "Creating directory \"#{path}\"." fs_engine.mkdir_p(path) else TestServer.ui_logger.warn "Directory \"#{path}\" already exists. Do not create it again!." end end |