module StupidFileWriter

Constants

VERSION

Public Class Methods

create(path) click to toggle source
# File lib/stupid_file_writer.rb, line 12
def self.create(path)
  path = path.split('/')[0..-2].join('/')
  FileUtils.mkdir_p(path)
end
is_path?(path) click to toggle source
# File lib/stupid_file_writer.rb, line 17
def self.is_path?(path)
  path.include?('/')
end
write(path, content) click to toggle source
# File lib/stupid_file_writer.rb, line 5
def self.write(path, content)
  create(path) if is_path?(path) && !File.exist?(path)
  file = File.open(path, 'w')
  file.print content
  file.close
end