Skip to content

Commit

Permalink
Add support to pass in repo_slug
Browse files Browse the repository at this point in the history
  • Loading branch information
chessbyte committed May 4, 2020
1 parent eb9f5c3 commit 6e36abd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions prs_per_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ def initialize(opts)
@config = YAML.load_file(config_file)

@output_file = opts[:output_file] || "prs_per_repo.csv"
@github_org = "ManageIQ"

repo_given = opts[:repo_slug_given] ? opts[:repo_slug] : config[:repo_slug]
@repos = repo_given ? Array(repo_given) : stats.default_repos.sort
@github_org = repo_given ? "" : "ManageIQ"
@sprint = get_sprint(opts)
end

Expand Down Expand Up @@ -131,7 +134,7 @@ def process_repo(repo)
end

def process_repos
results = stats.default_repos.sort.collect do |repo|
results = @repos.collect do |repo|
process_repo(repo)
end

Expand All @@ -152,6 +155,13 @@ def self.parse(args)
:type => :string,
:required => false

opt :repo_slug,
"Repo Slug Name (e.g. ManageIQ/manageiq)",
:short => "r",
:default => nil,
:type => :string,
:required => false

opt :config_file,
"Config file name",
:short => "c",
Expand Down

0 comments on commit 6e36abd

Please sign in to comment.