Class: Capistrano::Blaze::Message
- Inherits:
-
Object
- Object
- Capistrano::Blaze::Message
- Defined in:
- lib/capistrano/blaze/message.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#exception ⇒ Object
readonly
Returns the value of attribute exception.
Class Method Summary collapse
- .failure(context, exception) ⇒ Object
- .start(context) ⇒ Object
- .success(context) ⇒ Object
- .test(context) ⇒ Object
Instance Method Summary collapse
- #failure ⇒ Object
-
#initialize(context, exception = nil) ⇒ Message
constructor
A new instance of Message.
- #start ⇒ Object
- #success ⇒ Object
- #test ⇒ Object
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
#context ⇒ Object (readonly)
Returns the value of attribute context.
21 22 23 |
# File 'lib/capistrano/blaze/message.rb', line 21 def context @context end |
#exception ⇒ Object (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
#failure ⇒ Object
31 32 33 |
# File 'lib/capistrano/blaze/message.rb', line 31 def failure speak ":warning: #{user} failed to deploy #{what}, via `#{command}`: #{}" end |
#start ⇒ Object
27 28 29 |
# File 'lib/capistrano/blaze/message.rb', line 27 def start speak "#{user} is deploying #{what}, via `#{command}`" end |
#success ⇒ Object
35 36 37 |
# File 'lib/capistrano/blaze/message.rb', line 35 def success speak "#{user} succesfully deployed #{what}, via `#{command}`" end |
#test ⇒ Object
39 40 41 |
# File 'lib/capistrano/blaze/message.rb', line 39 def test speak ":heart: #{context.application}!" end |