module Bobkit::FileHelpers

Public Instance Methods

copy_entry(source, target)
Alias for: copy_file
copy_file(source, target) click to toggle source
# File lib/bobkit/file_helpers.rb, line 16
def copy_file(source, target)
  create_folder_for target
  FileUtils.copy_entry source, target
end
Also aliased as: copy_folder, copy_entry
copy_folder(source, target)
Alias for: copy_file
create_file(path, content) click to toggle source
# File lib/bobkit/file_helpers.rb, line 11
def create_file(path, content)
  create_folder_for path
  File.write path, content
end
create_folder(path) click to toggle source
# File lib/bobkit/file_helpers.rb, line 3
def create_folder(path)
  FileUtils.mkdir_p(path) unless File.directory?(path)
end
create_folder_for(path) click to toggle source
# File lib/bobkit/file_helpers.rb, line 7
def create_folder_for(path)
  create_folder File.dirname(path)
end