Class: Veye::Github::ListPretty

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

Instance Method Summary collapse

Methods inherited from BasePretty

#after, #before

Instance Method Details

#format(results) ⇒ Object



6
7
8
# File 'lib/veye/views/github/list_pretty.rb', line 6

def format(results)
  results['repos'].each_with_index {|result, index| print_row(result, index)}
end


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/veye/views/github/list_pretty.rb', line 10

def print_row(result, index)
  printf(
    "%3d - %s\n",
    index + 1,
    "#{result['name']}".color(:green).bright
  )
  printf("\t%-15s: %s\n", "Language",   result['language'])
  printf("\t%-15s: %s\n", "Owner name", result['owner_login'])
  printf("\t%-15s: %s\n", "Owner type", result['owner_type'])
  printf("\t%-15s: %s\n", "Private",    result['private'])
  printf("\t%-15s: %s\n", "Fork",       result['fork'])
  printf("\t%-15s: %s\n", "Branches",   result['branches'].to_a.join(','))
  printf("\t%-15s: %s\n", "Description", result['description'])
  printf("\t%-15s: %s\n", "Imported", result['imported_projects'].to_a.join(','))
end