module Madhouse

Constants

VERSION

Public Class Methods

create(namespace) click to toggle source
# File lib/madhouse.rb, line 21
def self.create(namespace)
  location = DataFile.new(namespace).location
  FileUtils.mkdir_p(File.dirname(location))
end
load(namespace) click to toggle source
# File lib/madhouse.rb, line 6
def self.load(namespace)
  DataFile.new(namespace).content
end
save(namespace, data) click to toggle source
# File lib/madhouse.rb, line 15
def self.save(namespace, data)
  data_file = DataFile.new(namespace)
  create(namespace) unless data_file.exist?
  data_file.update data
end
secure(namespace) click to toggle source
# File lib/madhouse.rb, line 10
def self.secure(namespace)
  location = DataFile.new(namespace).location
  File.chmod(0600, location)
end