Class: Vagrant::Action::Builtin::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant/action/builtin/message.rb

Overview

This middleware simply outputs a message to the UI.

Instance Method Summary collapse

Constructor Details

#initialize(app, env, message, **opts) ⇒ Message

Returns a new instance of Message.



9
10
11
12
13
# File 'lib/vagrant/action/builtin/message.rb', line 9

def initialize(app, env, message, **opts)
  @app     = app
  @message = message
  @opts    = opts
end

Instance Method Details

#call(env) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/vagrant/action/builtin/message.rb', line 15

def call(env)
  if !@opts[:post]
    env[:ui].output(@message)
  end

  @app.call(env)

  if @opts[:post]
    env[:ui].output(@message)
  end
end