Sha256: b178dc572dacf780e1b2009ff2b945e483220f586fb7af5ea9229e312f7d2597
Contents?: true
Size: 666 Bytes
Versions: 11
Compression:
Stored size: 666 Bytes
Contents
require "bait/version" require 'moneta' require 'fileutils' module Bait def self.storage_dir path = File.join("#{self.home}", "#{self.env}") FileUtils.mkdir_p path path end def self.db_dir db_dir = File.join self.storage_dir, "databases" FileUtils.mkdir_p db_dir db_dir end def self.db_file name yaml_file = File.join self.db_dir, "#{name}.yaml" FileUtils.touch yaml_file yaml_file end def self.store @store ||= begin Moneta.new :YAML, :file => db_file("main") end end def self.env ENV['RACK_ENV'] ||= 'production' end def self.home File.join Etc.getpwuid.dir, '.bait' end end
Version data entries
11 entries across 11 versions & 1 rubygems