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
vagrant-1.0.6 lib/vagrant/action/vm/default_name.rb
boxcar-0.10005.1 lib/vagrant/action/vm/default_name.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/default_name.rb
vagrant-1.0.5 lib/vagrant/action/vm/default_name.rb
vagrant-1.0.4 lib/vagrant/action/vm/default_name.rb
vagrant-1.0.3 lib/vagrant/action/vm/default_name.rb
vagrant-1.0.2 lib/vagrant/action/vm/default_name.rb
vagrant-1.0.1 lib/vagrant/action/vm/default_name.rb
vagrant-1.0.0 lib/vagrant/action/vm/default_name.rb
vagrant-0.9.7 lib/vagrant/action/vm/default_name.rb
vagrant-0.9.5 lib/vagrant/action/vm/default_name.rb
vagrant-0.9.4 lib/vagrant/action/vm/default_name.rb