Sha256: 6bb5b8ccb67a71a054d7b7a8bac741a8463b9ee4f5656199e5ca347494751a0b

Contents?: true

Size: 1.7 KB

Versions: 9

Compression:

Stored size: 1.7 KB

Contents

require 'paratrooper/notifier'

module Paratrooper
  module Notifiers

    # Public: Default notifier for outputting messages to screen.
    #
    class ScreenNotifier < Notifier
      attr_reader :output

      # Public: Initializes ScreenNotifier
      #
      # output - IO object (default: STDOUT)
      def initialize(output = STDOUT)
        @output = output
      end

      # Public: Displays message with decoration
      #
      # message - String message to be displayed
      #
      # Examples
      #
      #   display("Excellent Message")
      #   # =>
      #   # => ==========================================================================
      #   # => >> Excellent Message
      #   # => ==========================================================================
      #   # =>
      def display(message)
        output.puts
        output.puts "=" * 80
        output.puts ">> #{message}"
        output.puts "=" * 80
        output.puts
      end

      def activate_maintenance_mode(options = {})
        display("Activating Maintenance Mode")
      end

      def deactivate_maintenance_mode(options = {})
        display("Deactivating Maintenance Mode")
      end

      def update_repo_tag(options = {})
        display("Updating Repo Tag: #{options[:tag_name]}")
      end

      def push_repo(options = {})
        display("Pushing #{options[:reference_point]} to Heroku")
      end

      def run_migrations(options = {})
        display("Running database migrations")
      end

      def app_restart(options = {})
        display("Restarting application")
      end

      def warm_instance(options = {})
        display("Accessing #{options[:app_url]} to warm up your application")
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
paratrooper-2.0.0.beta1 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.4.2 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.4.1 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.4.0 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.3.2 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.3.1 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.2.2 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.2.1 lib/paratrooper/notifiers/screen_notifier.rb
paratrooper-1.2.0 lib/paratrooper/notifiers/screen_notifier.rb