Class: Neetob::CLI::Github::Issues::CreateProductSubIssues
- Defined in:
- lib/neetob/cli/github/issues/create_product_sub_issues.rb
Constant Summary collapse
- SOURCE_REPO =
"bigbinary/neeto-engineering-web"
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(issue_number, sandbox = false) ⇒ CreateProductSubIssues
constructor
A new instance of CreateProductSubIssues.
- #run ⇒ Object
Methods included from Utils
#camel_case_to_slug, #is_upper?, #symbolize_keys
Constructor Details
#initialize(issue_number, sandbox = false) ⇒ CreateProductSubIssues
Returns a new instance of CreateProductSubIssues.
12 13 14 15 16 |
# File 'lib/neetob/cli/github/issues/create_product_sub_issues.rb', line 12 def initialize(issue_number, sandbox = false) super() @issue_number = issue_number @target_repos = find_all_matching_apps_or_repos(["products"], :github, sandbox) end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/neetob/cli/github/issues/create_product_sub_issues.rb', line 18 def run ui.info("Fetching issue ##{@issue_number} from #{SOURCE_REPO}") begin source_issue = fetch_issue ui.info("Creating sub-issues in product repos...") body = source_issue[:body] @target_repos.each do |repo| created_issue = create_issue_in(repo, source_issue, body) link_sub_issue( parent_issue_number: @issue_number, child_issue_id: created_issue[:id] ) ui.success("✔️ Created issue ##{created_issue[:number]} in #{repo}") end rescue StandardError => e ExceptionHandler.new(e).process end end |