class Paratrooper::Notifiers::ScreenNotifier

Public: Default notifier for outputting messages to screen.

Attributes

output[R]

Public Class Methods

new(output = STDOUT) click to toggle source

Public: Initializes ScreenNotifier

output - IO object (default: STDOUT)

# File lib/paratrooper/notifiers/screen_notifier.rb, line 14
def initialize(output = STDOUT)
  @output = output
end

Public Instance Methods

activate_maintenance_mode(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 38
def activate_maintenance_mode(options = {})
  display("Activating Maintenance Mode - Enabled due to pending migrations")
end
app_restart(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 63
def app_restart(options = {})
  display("Restarting application")
end
deactivate_maintenance_mode(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 42
def deactivate_maintenance_mode(options = {})
  display("Deactivating Maintenance Mode")
end
deploy_finished(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 67
def deploy_finished(options = {})
  display("Deploy finished")
end
display(message) click to toggle source

Public: Displays message with decoration

message - String message to be displayed

Examples

display("Excellent Message")
# =>
# => =============================================================
# => >> Excellent Message
# => =============================================================
# =>
# File lib/paratrooper/notifiers/screen_notifier.rb, line 30
def display(message)
  output.puts
  output.puts "=" * 60
  output.puts ">> #{message}"
  output.puts "=" * 60
  output.puts
end
push_repo(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 50
def push_repo(options = {})
  desc = "#{options[:reference_point]} to #{options[:app_name]} on Heroku"
  if options[:force]
    display("Force pushing #{desc}")
  else
    display("Pushing #{desc}")
  end
end
run_migrations(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 59
def run_migrations(options = {})
  display("Running database migrations")
end
update_repo_tag(options = {}) click to toggle source
# File lib/paratrooper/notifiers/screen_notifier.rb, line 46
def update_repo_tag(options = {})
  display("Updating Repo Tag: #{options[:reference_point]}")
end