lib/galileo.rb in galileo-0.1.1 vs lib/galileo.rb in galileo-0.2.0
- old
+ new
@@ -34,22 +34,22 @@
puts "" # \n
puts "Searching the stars..."
# GET
- Octokit.starred(Octokit.user.login).each do |repo|
+ Octokit.starred(Octokit.user.login).concat(Octokit.repos(Octokit.user.login)).each do |repo|
repos << [
repo.name || '',
repo.description || '',
repo.language || '',
repo.owner.login || '',
repo.stargazers_count || '',
repo.updated_at || ''
]
- end
+ end
- repos
+ repos.uniq
end
if repos.any?
if query.any?
languages = []
@@ -88,22 +88,22 @@
repos.map! do |repo|
repo[0] = repo[0].yellow
# Language color-coating
case repo[2]
- when 'Clojur' then repo[2] = repo[2].colorize(:light_red)
- when 'Ruby' then repo[2] = repo[2].red
- when 'CSS', 'CoffeeScript', 'Python' then repo[2] = repo[2].blue
- when 'Perl', 'Shell', 'Objective-C' then repo[2] = repo[2].colorize(:light_blue)
- when 'PHP', 'C#' then repo[2] = repo[2].magenta
- when 'Emacs Lisp', 'C++' then repo[2] = repo[2].colorize(:light_magenta)
- when 'Smalltalk' then repo[2] = repo[2].green
- when 'VimL', 'Scala' then repo[2] = repo[2].colorize(:light_green)
- when 'C' then repo[2] = repo[2].black
- when 'Go' then repo[2] = repo[2].yellow
+ when 'Clojur' then repo[2] = repo[2].colorize(:light_red)
+ when 'Ruby' then repo[2] = repo[2].red
+ when 'CSS', 'CoffeeScript', 'Python' then repo[2] = repo[2].blue
+ when 'Perl', 'Shell', 'Objective-C' then repo[2] = repo[2].colorize(:light_blue)
+ when 'PHP', 'C#' then repo[2] = repo[2].magenta
+ when 'Emacs Lisp', 'C++' then repo[2] = repo[2].colorize(:light_magenta)
+ when 'Smalltalk', 'TeX' then repo[2] = repo[2].green
+ when 'VimL', 'Scala' then repo[2] = repo[2].colorize(:light_green)
+ when 'C' then repo[2] = repo[2].black
+ when 'Go' then repo[2] = repo[2].yellow
when 'Assembly', 'Java', 'JavaScript' then repo[2] = repo[2].colorize(:light_yellow)
- when 'Common Lisp' then repo[2] = repo[2].cyan
+ when 'Common Lisp' then repo[2] = repo[2].cyan
end
repo[4] = repo[4].to_s.blue
repo[3] = repo[3].red
repo[5] = repo[5].time_ago_in_words
@@ -114,10 +114,10 @@
# Add separators
repos = repos.product([:separator]).flatten(1)[0...-1]
# Construct the table
table = Terminal::Table.new
- table.headings = ['Name', 'Description', 'Language', 'Author', 'Stars', 'Last Updated', 'Link (⌘ + Click)']
+ table.headings = ['Name', 'Description', 'Language', 'Author', 'Stars', 'Last Updated', ENV['_system_name'] == 'OSX' ? 'Link (⌘ + Click)' : 'Link']
table.rows = repos[0..20]
table.style = { width: `/usr/bin/env tput cols`.to_i }
# Print the table
puts "\n#{table}\n\n"