Class: Trendhub::Commands::Repo
- Inherits:
-
Object
- Object
- Trendhub::Commands::Repo
- Defined in:
- lib/trendhub/commands/repo.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options) ⇒ Repo
constructor
A new instance of Repo.
Constructor Details
#initialize(options) ⇒ Repo
Returns a new instance of Repo.
9 10 11 |
# File 'lib/trendhub/commands/repo.rb', line 9 def initialize() = end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/trendhub/commands/repo.rb', line 13 def execute repositories = Trendhub::Repositories.new.fetch([:for], [:language]) repositories.each do |repo| $stdout.puts "-" * 100 $stdout.puts "#{colorizer.decorate(repo.name, :bold)} has #{colorizer.decorate(repo.added_stars, :bold, :red)} stars added #{repo.time_period}" $stdout.puts repo.desc repo_info = blank?(repo.language) ? "" : "#{repo.language} " repo_info += "★ #{repo.stars} " repo_info += "#{repo.forks} forks" $stdout.puts repo_info $stdout.puts "URL: #{repo.url}" end end |