Class: Terminalwire::Client::Resource::Directory

Inherits:
Base
  • Object
show all
Defined in:
lib/terminalwire/client/resource.rb

Constant Summary collapse

File =
::File

Instance Method Summary collapse

Methods inherited from Base

#command, #initialize

Constructor Details

This class inherits a constructor from Terminalwire::Client::Resource::Base

Instance Method Details

#create(path:) ⇒ Object



169
170
171
172
173
# File 'lib/terminalwire/client/resource.rb', line 169

def create(path:)
  FileUtils.mkdir_p File.expand_path(path)
rescue Errno::EEXIST
  # Do nothing
end

#delete(path:) ⇒ Object



179
180
181
# File 'lib/terminalwire/client/resource.rb', line 179

def delete(path:)
  Dir.delete path
end

#exist(path:) ⇒ Object



175
176
177
# File 'lib/terminalwire/client/resource.rb', line 175

def exist(path:)
  Dir.exist? path
end

#list(path:) ⇒ Object



165
166
167
# File 'lib/terminalwire/client/resource.rb', line 165

def list(path:)
  Dir.glob path
end