Class: Keel::Notifier::Base
- Inherits:
-
Object
- Object
- Keel::Notifier::Base
- Defined in:
- lib/keel/notifier/base.rb
Overview
Base class to be inherited for notifiers that are used to send any notifications when a deployment is complete.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cli ⇒ Object
Returns the value of attribute cli.
-
#env ⇒ Object
Returns the value of attribute env.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(env:, sha:) ⇒ Base
constructor
A new instance of Base.
-
#notify ⇒ Object
:nodoc:.
-
#set_user ⇒ Object
Determines the user id to be sent with the nofications based on the ENV variable if set, otherwise on the system user.
Constructor Details
Instance Attribute Details
#cli ⇒ Object
Returns the value of attribute cli.
10 11 12 |
# File 'lib/keel/notifier/base.rb', line 10 def cli @cli end |
#env ⇒ Object
Returns the value of attribute env.
10 11 12 |
# File 'lib/keel/notifier/base.rb', line 10 def env @env end |
#sha ⇒ Object
Returns the value of attribute sha.
10 11 12 |
# File 'lib/keel/notifier/base.rb', line 10 def sha @sha end |
#user ⇒ Object
Returns the value of attribute user.
10 11 12 |
# File 'lib/keel/notifier/base.rb', line 10 def user @user end |
Instance Method Details
#notify ⇒ Object
:nodoc:
34 35 36 |
# File 'lib/keel/notifier/base.rb', line 34 def notify # :nodoc: raise NotImplemented end |
#set_user ⇒ Object
Determines the user id to be sent with the nofications based on the ENV variable if set, otherwise on the system user.
25 26 27 28 29 30 31 32 |
# File 'lib/keel/notifier/base.rb', line 25 def set_user unless ENV['DEPLOY_USERNAME'].nil? || ENV['DEPLOY_USERNAME'] == '' return @user = ENV['DEPLOY_USERNAME'] end whoami = @cli.execute 'whoami' @user = whoami.chomp end |