Sha256: 20e7d1a59834914073eaeabc6231206264e2b2771bdbdb2284f4d5b061717365

Contents?: true

Size: 630 Bytes

Versions: 124

Compression:

Stored size: 630 Bytes

Contents

module CC
  module CLI
    module Output
      def success(message)
        terminal.say colorize(message, :green)
      end

      def say(message)
        terminal.say message
      end

      def warn(message)
        terminal.say colorize("WARNING: #{message}", :yellow)
      end

      def fatal(message)
        $stderr.puts colorize(message, :red)
        exit 1
      end

      def colorize(string, *args)
        rainbow.wrap(string).color(*args)
      end

      def rainbow
        @rainbow ||= Rainbow.new
      end

      def terminal
        @terminal ||= HighLine.new($stdin, $stdout)
      end
    end
  end
end

Version data entries

124 entries across 124 versions & 2 rubygems

Version Path
codeclimate-0.66.0 lib/cc/cli/output.rb
codeclimate-0.65.0 lib/cc/cli/output.rb
codeclimate-0.64.0 lib/cc/cli/output.rb
codeclimate-0.63.7 lib/cc/cli/output.rb
codeclimate-0.63.6 lib/cc/cli/output.rb
codeclimate-0.63.5 lib/cc/cli/output.rb
codeclimate-0.63.4 lib/cc/cli/output.rb
codeclimate-0.63.3 lib/cc/cli/output.rb
codeclimate-0.63.2 lib/cc/cli/output.rb
codeclimate-0.63.1 lib/cc/cli/output.rb
codeclimate-0.63.0 lib/cc/cli/output.rb
codeclimate-0.62.0 lib/cc/cli/output.rb
codeclimate-0.61.1 lib/cc/cli/output.rb
codeclimate-0.61.0 lib/cc/cli/output.rb
codeclimate-0.60.1 lib/cc/cli/output.rb
codeclimate-0.60.0 lib/cc/cli/output.rb
codeclimate-0.59.1 lib/cc/cli/output.rb
codeclimate-0.59.0 lib/cc/cli/output.rb
codeclimate-0.58.0 lib/cc/cli/output.rb
codeclimate-0.57.0 lib/cc/cli/output.rb