Sha256: d3d22b34803d06a6f3cb6ba7a777ee9af03bfac443311599b1be311533ca7a18

Contents?: true

Size: 486 Bytes

Versions: 32

Compression:

Stored size: 486 Bytes

Contents

require 'log4r'

module Vagrant
  module Action
    module VM
      class DefaultName
        def initialize(app, env)
          @logger = Log4r::Logger.new("vagrant::action::vm::defaultname")
          @app = app
        end

        def call(env)
          @logger.info("Setting the default name of the VM")
          name = env[:root_path].basename.to_s + "_#{Time.now.to_i}"
          env[:vm].driver.set_name(name)

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

32 entries across 32 versions & 6 rubygems

Version Path
bmhatfield-vagrant-1.0.10 lib/vagrant/action/vm/default_name.rb
bmhatfield-vagrant-1.0.9 lib/vagrant/action/vm/default_name.rb
bmhatfield-vagrant-1.0.8 lib/vagrant/action/vm/default_name.rb
bmhatfield-vagrant-1.0.7 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.7 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.6 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.5 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.4 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.3 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.2 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.1 lib/vagrant/action/vm/default_name.rb
vagrantup-1.0.0 lib/vagrant/action/vm/default_name.rb
vagrantup-0.9.99.2 lib/vagrant/action/vm/default_name.rb
vagrantup-0.9.99.1 lib/vagrant/action/vm/default_name.rb
vagrantup-0.9.7 lib/vagrant/action/vm/default_name.rb
vagrantup-0.9.6 lib/vagrant/action/vm/default_name.rb
vagrantup-0.9.5 lib/vagrant/action/vm/default_name.rb
vagrantup-0.9.4 lib/vagrant/action/vm/default_name.rb
vagrant-fixed-ssh-1.0.7 lib/vagrant/action/vm/default_name.rb
vagrant-1.0.7 lib/vagrant/action/vm/default_name.rb