Method: GhIssues::CLI#all

Defined in:
lib/gh_issues/cli.rb

#allObject



42
43
44
45
46
47
48
49
50
51
52
# File 'lib/gh_issues/cli.rb', line 42

def all
  ENV['GH_ISSUES_COLORIZE'] = '1' if options[:color]
  sort_by = ['name', 'count'].include?(options[:sort_by]) ? options[:sort_by] : 'name'
  sort_order = ['asc', 'desc'].include?(options[:sort_order]) ? options[:sort_order] : 'asc'
  all_issues = GhIssues.all_issues
  if all_issues.count > 0
    puts print_issue_list(all_issues, sort_by: sort_by, sort_order: sort_order)
  else
    puts "Hooray! You have no issue to display..."
  end
end