module Bookshelf

Constants

ROOT

Public Class Methods

config() click to toggle source
# File lib/bookshelf.rb, line 33
def self.config
  path = Pathname.new("config/config.yml")
  content = File.read(path)
  erb = ERB.new(content).result
  YAML.load(erb).with_indifferent_access
end
logger() click to toggle source
# File lib/bookshelf.rb, line 40
def self.logger
  @logger ||= Logger.new(File.open("/tmp/bookshelf.log", "a"))
end
render_template(file, locals = {}) click to toggle source
# File lib/bookshelf.rb, line 48
def self.render_template(file, locals = {})
  ERB.new(File.read(file)).result OpenStruct.new(locals).instance_eval{ binding }
end
root_dir() click to toggle source
# File lib/bookshelf.rb, line 44
def self.root_dir
  @root_dir ||= Pathname.new(Dir.pwd)
end