Class: AutoNetwork::PoolStorage
- Inherits:
-
YAML::Store
- Object
- YAML::Store
- AutoNetwork::PoolStorage
- Defined in:
- lib/auto_network/pool_storage.rb
Overview
This is a specialized subclass of YAML::Store
that manages data
persistence for PoolManager instances.
In addition to managing serialization, the YAML::Store
parent class also
provides facilities for synchronizing state across multiple Vagrant
processes. This subclass adds functionality for handling upgrades when the
AutoNetwork serialization format changes.
Format history:
Constant Summary collapse
- POOLFILE_VERSION =
An integer indicating the current AutoNetwork serialization format.
2
- POOLFILE_SKELETON =
The data structure that AutoNetwork::PoolManager instances expect to be available in all pool files.
{ 'poolfile_version' => POOLFILE_VERSION, 'pools' => {}, }
Class Method Summary collapse
-
.init(path) ⇒ void
Creates a new pool file at a target location and fills it with default data.
Class Method Details
.init(path) ⇒ void
This method returns an undefined value.
Creates a new pool file at a target location and fills it with default data.
53 54 55 56 57 58 59 |
# File 'lib/auto_network/pool_storage.rb', line 53 def self.init(path) path = Pathname.new(path) dir = path.dirname dir.mkpath unless dir.exist? File.write(path, POOLFILE_SKELETON.to_yaml) end |