Sha256: 24bace0b12d45bd40f8ddbcd178e1d2bf32c9e44acd924ede325637d5276f091

Contents?: true

Size: 962 Bytes

Versions: 10

Compression:

Stored size: 962 Bytes

Contents

# encoding: utf-8

module GithubCLI
  class UI
    attr_writer :shell

    def initialize(shell)
      @shell = shell
      @quite = false
      @debug = ENV['DEBUG']
    end

    def confirm(message, newline=nil)
      @shell.say message, :green, newline
    end

    def info(message, newline=nil)
      @shell.say message, nil, newline
    end

    def warn(message, newline=nil)
      @shell.say message, :yellow, newline
    end

    def error(message, newline=nil)
      @shell.say message, :red, newline
    end

    def debug(message, newline=nil)
      @shell.say message, nil, newline
    end

    def quite!
      @quite = true
    end

    def debug!
      @debug = true
    end

    def print_table(table, options={})
      @shell.print_table table, options
    end

    def print_wrapped(message, options={})
      @shell.print_wrapped message, options
    end

    def terminal_width
      @shell.terminal_width
    end
  end # UI
end # GithubCLI

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
github_cli-0.6.1 lib/github_cli/ui.rb
github_cli-0.6.0 lib/github_cli/ui.rb
github_cli-0.5.9 lib/github_cli/ui.rb
github_cli-0.5.8 lib/github_cli/ui.rb
github_cli-0.5.7 lib/github_cli/ui.rb
github_cli-0.5.6 lib/github_cli/ui.rb
github_cli-0.5.5 lib/github_cli/ui.rb
github_cli-0.5.4 lib/github_cli/ui.rb
github_cli-0.5.3 lib/github_cli/ui.rb
github_cli-0.5.2 lib/github_cli/ui.rb