Class: Msf::Util::DocumentGenerator::PullRequestFinder
- Inherits:
-
Object
- Object
- Msf::Util::DocumentGenerator::PullRequestFinder
- Defined in:
- lib/msf/util/document_generator/pull_request_finder.rb
Defined Under Namespace
Classes: Exception
Constant Summary collapse
- MANUAL_BASE_PATH =
File.(File.join(Msf::Config.module_directory, '..', 'documentation', 'modules' ))
- USER_MANUAL_BASE_PATH =
File.(File.join(Msf::Config.user_module_directory, '..', 'documentation', 'modules' ))
Instance Attribute Summary collapse
-
#branch ⇒ String
Metasploit Framework’s branch.
-
#git_access_token ⇒ String
Git access token.
-
#git_client ⇒ Octokit::Client
Git client.
-
#owner ⇒ String
Metasploit Framework’s repository owner.
-
#repository ⇒ String
Metasploit Framework’s repository.
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
Initializes Msf::Util::DocumenGenerator::PullRequestFinder.
-
#search(mod) ⇒ Hash
Returns pull requests associated with a particular Metasploit module.
Constructor Details
#initialize ⇒ void
Initializes Msf::Util::DocumenGenerator::PullRequestFinder
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 36 def initialize unless ENV.has_key?('GITHUB_OAUTH_TOKEN') msg = '' raise PullRequestFinder::Exception, 'GITHUB_OAUTH_TOKEN environment variable not set.' end self.owner = 'rapid7' self.repository = "#{owner}/metasploit-framework" self.branch = 'master' self.git_access_token = ENV['GITHUB_OAUTH_TOKEN'] self.git_client = Octokit::Client.new(access_token: git_access_token) end |
Instance Attribute Details
#branch ⇒ String
Returns Metasploit Framework’s branch.
23 24 25 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 23 def branch @branch end |
#git_access_token ⇒ String
Returns Git access token.
29 30 31 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 29 def git_access_token @git_access_token end |
#git_client ⇒ Octokit::Client
Returns Git client.
17 18 19 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 17 def git_client @git_client end |
#owner ⇒ String
Returns Metasploit Framework’s repository owner.
26 27 28 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 26 def owner @owner end |
#repository ⇒ String
Returns Metasploit Framework’s repository.
20 21 22 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 20 def repository @repository end |
Instance Method Details
#search(mod) ⇒ Hash
Returns pull requests associated with a particular Metasploit module.
54 55 56 57 58 |
# File 'lib/msf/util/document_generator/pull_request_finder.rb', line 54 def search(mod) file_name = get_normalized_module_name(mod) commits = get_commits_from_file(file_name) get_pull_requests_from_commits(commits) end |