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
-
#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
- #warm_instance(options = {}) ⇒ Object
Methods inherited from Paratrooper::Notifier
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
58 59 60 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 58 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 |
#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 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 50 def push_repo( = {}) display("Pushing #{[:reference_point]} to Heroku") end |
#run_migrations(options = {}) ⇒ Object
54 55 56 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 54 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: #{[:tag_name]}") end |
#warm_instance(options = {}) ⇒ Object
62 63 64 |
# File 'lib/paratrooper/notifiers/screen_notifier.rb', line 62 def warm_instance( = {}) display("Accessing #{[:app_url]} to warm up your application") end |