Sha256: 05e8de3da7f2d3ac65c13a1d13ce0f8b839b699646a3209eb9a4017aedd9f3dd

Contents?: true

Size: 434 Bytes

Versions: 5

Compression:

Stored size: 434 Bytes

Contents

module Phase
  module Util
    module Console

      # Prompts user for input.
      def ask(str)
        print "[phase] ".blue.on_cyan + "#{str}".black.on_cyan + " "
        STDIN.gets.chomp
      end

      # Prints a message.
      def log(str)
        puts "[phase]".green + " #{ str }"
      end

      # Prints a message and then exits.
      def fail(str)
        abort "[phase]".red + " #{ str }"
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
phase-1.0.2 lib/phase/util/console.rb
phase-1.0.1 lib/phase/util/console.rb
phase-1.0.0 lib/phase/util/console.rb
phase-1.0.0.rc2 lib/phase/util/console.rb
phase-1.0.0.rc1 lib/phase/util/console.rb