Sha256: 25547f3d46d363a674e4b4f9e591b788e5c8249520adab7e5a6d9e88abd14723
Contents?: true
Size: 982 Bytes
Versions: 3
Compression:
Stored size: 982 Bytes
Contents
module Reponaut module Application class Command class << self def subclasses @subclasses ||= [] end def inherited(base) subclasses << base super end end attr_reader :username, :client, :repos def initialize(prog); end def process(options, args) raise ArgumentError.new('You must specify a username') if args.empty? @username = args.first @client = Reponaut::GitHub::Client.new(username) @repos = client.repos.reject { |r| r.language.nil? } @repos = @repos.find_all { |r| r.source? } if options['ignore_forks'] rescue Reponaut::GitHub::NoSuchUserError quit 4, "No such user: #{username}" rescue Reponaut::GitHub::RateLimitExceededError quit 5, 'GitHub rate limit exceeded. Try your request again later.' end def quit(code, msg) $stderr.puts msg exit code end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
reponaut-2.1.1 | lib/reponaut/command.rb |
reponaut-2.1.0 | lib/reponaut/command.rb |
reponaut-2.0.0 | lib/reponaut/command.rb |