Class: Nugrant::Vagrant::V2::Action::AutoExport
- Inherits:
-
Object
- Object
- Nugrant::Vagrant::V2::Action::AutoExport
- Defined in:
- lib/nugrant/vagrant/v2/action/auto_export.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, env) ⇒ AutoExport
constructor
A new instance of AutoExport.
Constructor Details
#initialize(app, env) ⇒ AutoExport
Returns a new instance of AutoExport.
12 13 14 15 |
# File 'lib/nugrant/vagrant/v2/action/auto_export.rb', line 12 def initialize(app, env) @app = app @config = env[:machine].env.vagrantfile.config end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/nugrant/vagrant/v2/action/auto_export.rb', line 17 def call(env) return @app.call(env) if not @config.user.auto_export = { :type => :export, :script_path => @config.user.auto_export_script_path } Array(@config.user.auto_export).each do |exporter| if exporter == :terminal or not EnvExporter.valid?(exporter) env[:ui].warn("ERROR: Invalid config.user.auto_export value '#{exporter}'", :prefix => false) next end env[:ui].info("Configuration exported '#{exporter}'", :prefix => false) case when exporter == :script EnvExporter.script_exporter(@config.user.__all, ) when exporter == :autoenv EnvExporter.autoenv_exporter(@config.user.__all, ) end end end |