Sha256: d903ba269b1bac15bfa986398b4e0c2379d67ad65bcc756aed37fc30d14b5d5c

Contents?: true

Size: 761 Bytes

Versions: 13

Compression:

Stored size: 761 Bytes

Contents

module VagrantPlugins
  module Parallels
    module Action
      class RegisterTemplate
        def initialize(app, env)
          @app = app
        end

        def call(env)
          pvm_glob = Pathname.glob(env[:machine].box.directory.join('*.pvm')).first
          # TODO: Handle error cases better, throw a Vagrant error and not a stack trace etc.
          pvm_file = File.realpath pvm_glob.to_s

          unless env[:machine].provider.driver.registered?(pvm_file)
            env[:machine].provider.driver.register(pvm_file.to_s)
          end
          # Call the next if we have one (but we shouldn't, since this
          # middleware is built to run with the Call-type middlewares)
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vagrant-parallels-0.2.1 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.2.0 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.1.3 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.1.2 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.1.1 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.1.0 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.9 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.8 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.7 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.6 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.5 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.4 lib/vagrant-parallels/action/register_template.rb
vagrant-parallels-0.0.3 lib/vagrant-parallels/action/register_template.rb