Sha256: 426eb1ffef2a131d022136cdbdcd2da40c2fd967196e745ae662e40175fdecd3

Contents?: true

Size: 545 Bytes

Versions: 6

Compression:

Stored size: 545 Bytes

Contents

module Vagrant
  module LXC
    module Action
      # XXX: Is this really needed? Should we contribute this back to Vagrant's core?
      class Message
        def initialize(app, env, msg_key, type = :info)
          @app     = app
          @msg_key = msg_key
          @type    = type
        end

        def call(env)
          machine = env[:machine]
          message = I18n.t("vagrant_lxc.messages.#{@msg_key}", name: machine.name)

          env[:ui].send @type, message

          @app.call env
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-lxc-0.8.0 lib/vagrant-lxc/action/message.rb
vagrant-lxc-0.7.0 lib/vagrant-lxc/action/message.rb
vagrant-lxc-0.6.4 lib/vagrant-lxc/action/message.rb
vagrant-lxc-0.6.3 lib/vagrant-lxc/action/message.rb
vagrant-lxc-0.6.2 lib/vagrant-lxc/action/message.rb
vagrant-lxc-0.6.1 lib/vagrant-lxc/action/message.rb