Sha256: d78446b7fa42271b663a87a19400fcb89ca57d3c807837a33c6a680e58bab702

Contents?: true

Size: 496 Bytes

Versions: 8

Compression:

Stored size: 496 Bytes

Contents

module GOCD_PRE_PUSH
  module PrettyPrinter
    def colorize(text, color_code)
      "#{color_code}#{text}\e[0m"
    end

    def red(text); colorize(text, "\e[31m"); end
    def green(text); colorize(text, "\e[32m"); end
    def yellow(text); colorize(text, "\e[1m\e[33m");  end

    def print_info(msg)
      STDOUT.write yellow(msg+"\n")
    end

    def print_error(msg)
      STDOUT.write red(msg+"\n")
    end

    def print_success(msg)
      STDOUT.write green(msg+"\n")
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gocd_pre_push-2.1 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-2.0.3 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-2.0.2 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-2.0 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-1.2 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-1.1 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-1.0 lib/gocd_pre_push/pretty_printer.rb
gocd_pre_push-0.1 lib/gocd_pre_push/pretty_printer.rb