Method: PEROBS::FlatFileDB#initialize
- Defined in:
- lib/perobs/FlatFileDB.rb
#initialize(db_name, options = {}) ⇒ FlatFileDB
Create a new FlatFileDB object.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/perobs/FlatFileDB.rb', line 57 def initialize(db_name, = {}) super() @db_dir = db_name # Create the database directory if it doesn't exist yet. ensure_dir_exists(@db_dir) PEROBS.log.level = [:log_level] if [:log_level] PEROBS.log.open([:log] || File.join(@db_dir, 'log')) check_version_and_upgrade # Read the existing DB config. @config = get_hash('config') check_option('serializer') put_hash('config', @config) end |