Class: Capistrano::Blaze::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/blaze/message.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, exception = nil) ⇒ Message

Returns a new instance of Message.


23
24
25
# File 'lib/capistrano/blaze/message.rb', line 23

def initialize(context, exception = nil)
  @context, @exception = context, exception
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context


21
22
23
# File 'lib/capistrano/blaze/message.rb', line 21

def context
  @context
end

#exceptionObject (readonly)

Returns the value of attribute exception


21
22
23
# File 'lib/capistrano/blaze/message.rb', line 21

def exception
  @exception
end

Class Method Details

.failure(context, exception) ⇒ Object


9
10
11
# File 'lib/capistrano/blaze/message.rb', line 9

def self.failure(context, exception)
  new(context, exception).failure
end

.start(context) ⇒ Object


5
6
7
# File 'lib/capistrano/blaze/message.rb', line 5

def self.start(context)
  new(context).start
end

.success(context) ⇒ Object


13
14
15
# File 'lib/capistrano/blaze/message.rb', line 13

def self.success(context)
  new(context).success
end

.test(context) ⇒ Object


17
18
19
# File 'lib/capistrano/blaze/message.rb', line 17

def self.test(context)
  new(context).test
end

Instance Method Details

#failureObject


31
32
33
# File 'lib/capistrano/blaze/message.rb', line 31

def failure
  speak ":warning: #{user} failed to deploy #{what}, via `#{command}`: #{exception_message}"
end

#startObject


27
28
29
# File 'lib/capistrano/blaze/message.rb', line 27

def start
  speak "#{user} is deploying #{what}, via `#{command}`"
end

#successObject


35
36
37
# File 'lib/capistrano/blaze/message.rb', line 35

def success
  speak "#{user} succesfully deployed #{what}, via `#{command}`"
end

#testObject


39
40
41
# File 'lib/capistrano/blaze/message.rb', line 39

def test
  speak ":heart: #{context.application}!"
end