Class: Bosh::Director::CompiledPackageManifest
- Defined in:
- lib/bosh/director/compiled_package_manifest.rb
Instance Method Summary collapse
-
#initialize(group) ⇒ CompiledPackageManifest
constructor
A new instance of CompiledPackageManifest.
- #to_h ⇒ Object
- #write(dest_path) ⇒ Object
Constructor Details
#initialize(group) ⇒ CompiledPackageManifest
Returns a new instance of CompiledPackageManifest.
6 7 8 |
# File 'lib/bosh/director/compiled_package_manifest.rb', line 6 def initialize(group) @compiled_package_group = group end |
Instance Method Details
#to_h ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/bosh/director/compiled_package_manifest.rb', line 10 def to_h { 'release_name' => @compiled_package_group.release_version.release.name, 'release_version' => @compiled_package_group.release_version.version, 'release_commit_hash' => @compiled_package_group.release_version.commit_hash, 'compiled_packages' => @compiled_package_group.compiled_packages.map do |compiled_package| { 'package_name' => compiled_package.package.name, 'package_fingerprint' => compiled_package.package.fingerprint, 'compiled_package_sha1' => compiled_package.sha1, 'stemcell_sha1' => @compiled_package_group.stemcell_sha1, 'blobstore_id' => compiled_package.blobstore_id, } end } end |
#write(dest_path) ⇒ Object
27 28 29 |
# File 'lib/bosh/director/compiled_package_manifest.rb', line 27 def write(dest_path) File.open(dest_path, 'w') { |f| f.write(YAML.dump(to_h)) } end |