Sha256: de971c62e602acd27ab28403e722b8fb7f0fa8a033a881a39200909573e67ac5

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

module VagrantPlugins
  module DockerProvider
    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("docker_provider.messages.#{@msg_key}", name: machine.name)

          env[:ui].send @type, message

          @app.call env
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
docker-provider-0.1.0 lib/docker-provider/action/message.rb
docker-provider-0.0.2 lib/docker-provider/action/message.rb
docker-provider-0.0.1 lib/docker-provider/action/message.rb