Class: GitOrgFileScanner::Scanner
- Inherits:
-
Object
- Object
- GitOrgFileScanner::Scanner
- Defined in:
- lib/git_org_file_scanner.rb
Overview
Scans all repos in a Github org for a specified file
Instance Attribute Summary collapse
-
#org ⇒ Object
Returns the value of attribute org.
Instance Method Summary collapse
- #contain_file(file) ⇒ Object
-
#initialize(access_token, org) ⇒ Scanner
constructor
A new instance of Scanner.
- #missing_file(file) ⇒ Object
Constructor Details
#initialize(access_token, org) ⇒ Scanner
Returns a new instance of Scanner.
9 10 11 12 13 |
# File 'lib/git_org_file_scanner.rb', line 9 def initialize(access_token, org) @octokit_client = Octokit::Client.new(access_token: access_token) @org = org @org_repositories = org_repositories end |
Instance Attribute Details
#org ⇒ Object
Returns the value of attribute org.
7 8 9 |
# File 'lib/git_org_file_scanner.rb', line 7 def org @org end |
Instance Method Details
#contain_file(file) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/git_org_file_scanner.rb', line 15 def contain_file(file) repos = [] @org_repositories.each do |repo| repos << repo[:full_name] if contains_file?(repo[:full_name], file) next end repos end |
#missing_file(file) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/git_org_file_scanner.rb', line 26 def missing_file(file) repos = [] @org_repositories.each do |repo| next if contains_file?(repo[:full_name], file) repos << repo[:full_name] end repos end |