Module: GitBundle::Console

Included in:
CLI, GitBundle::Commands::Generic, GitBundle::Commands::Push
Defined in:
lib/git_bundle/console.rb

Constant Summary collapse

COLORS =
{error: 31,
attention: 32,
prompt: 33,
heading: 34,
highlight: 36}

Instance Method Summary collapse

Instance Method Details

#clear_lineObject



9
10
11
12
# File 'lib/git_bundle/console.rb', line 9

def clear_line
  STDOUT.print "\r\e[0K"
  STDOUT.flush
end

#puts_attention(text) ⇒ Object



22
23
24
# File 'lib/git_bundle/console.rb', line 22

def puts_attention(text)
  puts colorize(text, COLORS[:attention])
end

#puts_error(text) ⇒ Object



30
31
32
# File 'lib/git_bundle/console.rb', line 30

def puts_error(text)
  puts colorize(text, COLORS[:error])
end

#puts_heading(text) ⇒ Object



18
19
20
# File 'lib/git_bundle/console.rb', line 18

def puts_heading(text)
  puts colorize("\n=== #{text}", COLORS[:heading])
end

#puts_prompt(text) ⇒ Object



26
27
28
# File 'lib/git_bundle/console.rb', line 26

def puts_prompt(text)
  puts colorize(text, COLORS[:prompt])
end

#puts_repo_heading(repo) ⇒ Object



14
15
16
# File 'lib/git_bundle/console.rb', line 14

def puts_repo_heading(repo)
  puts colorize("\n=== #{repo.name} (#{repo.branch})", COLORS[:heading], true)
end