Class: Veye::Github::InfoPretty

Inherits:
BasePretty show all
Defined in:
lib/veye/views/github/info_pretty.rb

Instance Method Summary collapse

Methods inherited from BasePretty

#after, #before

Instance Method Details

#format(result) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/veye/views/github/info_pretty.rb', line 7

def format(result)
  return if result.nil?
  repo = result['repo']
  projects = result['imported_projects']
  if projects
    project_names = projects.map {|x| x['id']}
  else
    project_names = []
  end

  printf(
    "\t%15s - %s\n",
    "#{repo['fullname']}".color(:green),
    "#{repo['language']}".bright
  )
  printf("\t%-15s: %s\n", "Description", repo['description'])
  printf("\t%-15s: %s\n", "Owner login", repo['owner_login'])
  printf("\t%-15s: %s\n", "Owner type", repo['owner_type'])
  printf("\t%-15s: %s\n", "Private", repo['private'])
  printf("\t%-15s: %s\n", "Fork", repo['fork'])
  printf("\t%-15s: %s\n", "Branches", repo['branches'].to_a.join(', '))
  printf("\t%-15s: %s\n", "Imported", project_names.join(', '))
  printf("\t%-15s: %s\n", "Html url", repo['html_url'])
  printf("\t%-15s: %s\n", "Git url", repo['git_url'])
end