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.


6
7
8
9
10
# File 'lib/vagrant/action/builtin/message.rb', line 6

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

Instance Method Details

#call(env) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
# File 'lib/vagrant/action/builtin/message.rb', line 12

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

  @app.call(env)

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