Class: VagrantPlugins::PackageVMware::Action::PackageMetadata
- Inherits:
-
Object
- Object
- VagrantPlugins::PackageVMware::Action::PackageMetadata
- Defined in:
- lib/vagrant-package-vmware/action/package_metadata.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
- #create_metadata ⇒ Object
-
#initialize(app, env) ⇒ PackageMetadata
constructor
A new instance of PackageMetadata.
Constructor Details
#initialize(app, env) ⇒ PackageMetadata
Returns a new instance of PackageMetadata.
6 7 8 |
# File 'lib/vagrant-package-vmware/action/package_metadata.rb', line 6 def initialize(app, env) @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 |
# File 'lib/vagrant-package-vmware/action/package_metadata.rb', line 10 def call(env) @env = env @app.call(env) end |
#create_metadata ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/vagrant-package-vmware/action/package_metadata.rb', line 16 def File.open(File.join(@env['package.directory'], "metadata.json"), "w") do |f| f.write(JSON.generate({ provider: @env[:machine].provider_name })) end end |