class Olib::App

Constants

APP_DIR
FOLDER

Public Class Methods

app_file(path) click to toggle source
# File lib/Olib/storage/app_data.rb, line 12
def self.app_file(path)
  File.join APP_DIR, path
end
open(file) click to toggle source
# File lib/Olib/storage/app_data.rb, line 16
def self.open(file)
  File.open(app_file(file), 'a', &block)
end
read(file) { || ... } click to toggle source
# File lib/Olib/storage/app_data.rb, line 26
def self.read(file, &block)
  open(file) do |file|
    yield
  end
end
write_json(file, data) click to toggle source
# File lib/Olib/storage/app_data.rb, line 20
def self.write_json(file, data)
  open(file) do |f|
    JSON.dump(data)
  end
end