22 lines
459 B
Ruby
22 lines
459 B
Ruby
module Vagrant
|
|
module LXC
|
|
module Action
|
|
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
|