Class: Boshify::Filesystem

Inherits:
Object
  • Object
show all
Defined in:
lib/boshify/filesystem.rb

Overview

Wrapper around filesystem operations

Instance Method Summary collapse

Instance Method Details

#copy(from, to) ⇒ Object



8
9
10
# File 'lib/boshify/filesystem.rb', line 8

def copy(from, to)
  FileUtils.copy(from, to)
end

#mkdir_p(path) ⇒ Object



12
13
14
# File 'lib/boshify/filesystem.rb', line 12

def mkdir_p(path)
  path.mkpath
end

#write_file(options) ⇒ Object



16
17
18
19
20
21
# File 'lib/boshify/filesystem.rb', line 16

def write_file(options)
  check_file_options!(options)
  file = determine_file_path(options)
  File.open(file.cleanpath, 'w') { |f| f.write(options[:content]) }
  file
end