Class: Paratrooper::Notifiers::ScreenNotifier
- Inherits:
-
Paratrooper::Notifier
- Object
- Paratrooper::Notifier
- Paratrooper::Notifiers::ScreenNotifier
- Defined in:
- lib/paratrooper/notifiers/screen_notifier.rb
Overview
Public: Default notifier for outputting messages to screen.
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #activate_maintenance_mode(options = {}) ⇒ Object
- #app_restart(options = {}) ⇒ Object
- #deactivate_maintenance_mode(options = {}) ⇒ Object
- #deploy_finished(options = {}) ⇒ Object
-
#display(message) ⇒ Object
Public: Displays message with decoration.
-
#initialize(output = STDOUT) ⇒ ScreenNotifier
constructor
Public: Initializes ScreenNotifier.
- #push_repo(options = {}) ⇒ Object
- #run_migrations(options = {}) ⇒ Object
- #update_repo_tag(options = {}) ⇒ Object
Methods inherited from Paratrooper::Notifier
#notify, #setup, #teardown, #warm_instance
Constructor Details
#initialize(output = STDOUT) ⇒ ScreenNotifier
Public: Initializes ScreenNotifier
output - IO object (default: STDOUT)
14 15 16 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 14 def initialize(output = STDOUT) @output = output end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
9 10 11 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 9 def output @output end |
Instance Method Details
#activate_maintenance_mode(options = {}) ⇒ Object
38 39 40 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 38 def activate_maintenance_mode( = {}) display("Activating Maintenance Mode - Enabled due to pending migrations") end |
#app_restart(options = {}) ⇒ Object
63 64 65 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 63 def app_restart( = {}) display("Restarting application") end |
#deactivate_maintenance_mode(options = {}) ⇒ Object
42 43 44 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 42 def deactivate_maintenance_mode( = {}) display("Deactivating Maintenance Mode") end |
#deploy_finished(options = {}) ⇒ Object
67 68 69 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 67 def deploy_finished( = {}) display("Deploy finished") end |
#display(message) ⇒ Object
Public: Displays message with decoration
message - String message to be displayed
Examples
display("Excellent Message")
# =>
# => =============================================================
# => >> Excellent Message
# => =============================================================
# =>
30 31 32 33 34 35 36 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 30 def display() output.puts output.puts "=" * 60 output.puts ">> #{}" output.puts "=" * 60 output.puts end |
#push_repo(options = {}) ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 50 def push_repo( = {}) desc = "#{[:reference_point]} to #{[:app_name]} on Heroku" if [:force] display("Force pushing #{desc}") else display("Pushing #{desc}") end end |
#run_migrations(options = {}) ⇒ Object
59 60 61 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 59 def run_migrations( = {}) display("Running database migrations") end |
#update_repo_tag(options = {}) ⇒ Object
46 47 48 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 46 def update_repo_tag( = {}) display("Updating Repo Tag: #{[:reference_point]}") end |