class GHTRetrieveOne
Public Instance Methods
ght()
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 41 def ght @ght ||= TransactedGHTorrent.new(settings) @ght end
go()
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 46 def go ght.get_db case ARGV[0] when /pullreq/ retrieve_pullreq(ARGV[1..-1]) when /issue/ retrieve_issue(ARGV[1..-1]) else Trollop::die "Don't know how to retrieve #{ARGV[0]}" end end
logger()
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 32 def logger ght.logger end
persister()
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 36 def persister @persister ||= connect(:mongo, settings) @persister end
prepare_options(options)
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 15 def prepare_options(options) options.banner <<-BANNER Retrieve just one item #{command_name} [options] <what> options... what can have the following values and arguments * pullreq <owner> <repo> <github_id> * issue <owner> <repo> <github_id> BANNER end
retrieve_issue(args)
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 67 def retrieve_issue(args) owner = args[0] repo = args[1] issue_id = args[2] ght.ensure_issue(wner, repo, issue_id) end
retrieve_pullreq(args)
click to toggle source
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 59 def retrieve_pullreq(args) owner = args[0] repo = args[1] pull_req_id = args[2] ght.ensure_pull_request(owner, repo, pull_req_id) end
validate()
click to toggle source
Calls superclass method
GHTorrent::Command#validate
# File lib/ghtorrent/commands/ght_retrieve_one.rb, line 27 def validate super Trollop::die 'One argument required' unless args[0] && !args[0].empty? end