Class: ChefWorkflow::DatabaseSupport

Inherits:
SQLite3::Database
  • Object
show all
Includes:
Singleton
Defined in:
lib/chef-workflow/support/db.rb,
lib/chef-workflow/support/db/basic.rb,
lib/chef-workflow/support/db/group.rb

Defined Under Namespace

Classes: Collection, Generic, List, Map, Object, Set, VMGroup

Instance Method Summary collapse

Constructor Details

#initializeDatabaseSupport

Returns a new instance of DatabaseSupport.



11
12
13
# File 'lib/chef-workflow/support/db.rb', line 11

def initialize
  super(connect)
end

Instance Method Details

#connectObject



20
21
22
23
24
# File 'lib/chef-workflow/support/db.rb', line 20

def connect
  vm_file = ChefWorkflow::GeneralSupport.vm_file
  FileUtils.mkdir_p(File.dirname(vm_file))
  SQLite3::Database.new(vm_file)
end

#reconnectObject



15
16
17
18
# File 'lib/chef-workflow/support/db.rb', line 15

def reconnect
  close rescue nil
  __setobj__(connect)
end