Class: Veye::Github::SearchPretty

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

Instance Method Summary collapse

Methods inherited from BasePretty

#after, #before

Instance Method Details

#format(results) ⇒ Object



6
7
8
9
10
# File 'lib/veye/views/github/search_pretty.rb', line 6

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


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/veye/views/github/search_pretty.rb', line 12

def print_row(result, index)
  printf(
    "%3d - %s\n",
    index + 1,
    "#{result["name"]}".color(:green)
  )
  printf("\t%-15s: %s\n", 'language', result['language'])
  printf("\t%-15s: %s\n", 'owner_name', result['owner_name'])
  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", 'watchers', result['watchers'])
  printf("\t%-15s: %s\n", 'forks', result['forks'])
  printf("\t%-15s: %s\n", 'git_url', result['git_url'])

end