Class: GHTUserRetriever

Inherits:
Object
  • Object
show all
Includes:
GHTorrent::Commands::FullUserRetriever, GHTorrent::Retriever
Defined in:
lib/ghtorrent/commands/ght_retrieve_users.rb

Overview

Initialize a user retrieval process

Constant Summary

Constants included from GHTorrent::Settings

GHTorrent::Settings::CONFIGKEYS, GHTorrent::Settings::DEFAULTS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GHTorrent::Commands::FullUserRetriever

#retrieve_user, #send_message

Methods included from GHTorrent::Retriever

#get_event, #get_events, #get_repo_events, #persister, #retrieve_commit, #retrieve_commit_comment, #retrieve_commit_comments, #retrieve_commits, #retrieve_fork, #retrieve_forks, #retrieve_issue, #retrieve_issue_comment, #retrieve_issue_comments, #retrieve_issue_event, #retrieve_issue_events, #retrieve_issue_labels, #retrieve_issues, #retrieve_languages, #retrieve_org, #retrieve_org_members, #retrieve_orgs, #retrieve_pull_req_comment, #retrieve_pull_req_comments, #retrieve_pull_req_commits, #retrieve_pull_request, #retrieve_pull_requests, #retrieve_repo, #retrieve_repo_collaborator, #retrieve_repo_collaborators, #retrieve_repo_label, #retrieve_repo_labels, #retrieve_user_byemail, #retrieve_user_byusername, #retrieve_user_follower, #retrieve_user_followers, #retrieve_user_following, #retrieve_watcher, #retrieve_watchers

Methods included from GHTorrent::Logging

#debug, #error, #info, #loggerr, #warn

Methods included from GHTorrent::Settings

#config, #merge, #merge_config_values, #override_config

Methods included from GHTorrent::Utils

included, #read_value, #user_type, #write_value

Methods included from GHTorrent::APIClient

#api_request, #num_pages, #paged_api_request

Constructor Details

#initialize(config, queue) ⇒ GHTUserRetriever

Returns a new instance of GHTUserRetriever.



22
23
24
25
# File 'lib/ghtorrent/commands/ght_retrieve_users.rb', line 22

def initialize(config, queue)
  @config = config
  @queue = queue
end

Instance Attribute Details

#ghtObject

Returns the value of attribute ght.



20
21
22
# File 'lib/ghtorrent/commands/ght_retrieve_users.rb', line 20

def ght
  @ght
end

Instance Method Details

#run(command) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ghtorrent/commands/ght_retrieve_users.rb', line 31

def run(command)

  processor = Proc.new do |user|
    @ght ||= TransactedGHTorrent.new(@config)

    retrieve_user(user)
  end

  command.queue_client(@queue, :after, processor)

end

#settingsObject



27
28
29
# File 'lib/ghtorrent/commands/ght_retrieve_users.rb', line 27

def settings
  @config
end

#stopObject



43
44
45
46
# File 'lib/ghtorrent/commands/ght_retrieve_users.rb', line 43

def stop
  warn('Stop flag set, waiting for operations to finish')
  @stop = true
end