Sha256: 7d549b753d3a1ce6d321a3a8ca1cb2a813e053bc9ac8228965cfa76e457f6338

Contents?: true

Size: 1.29 KB

Versions: 25

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require "thor"

require_relative "../base"

module Neetob
  class CLI
    module Github
      module Issues
        class Create < Base
          attr_accessor :apps, :issue_title, :issue_description, :issue_assignee, :issue_labels, :sandbox

          def initialize(apps, issue_title, issue_description = "", issue_assignee = "", issue_labels = "",
sandbox = false)
            super()
            @apps = apps
            @issue_title = issue_title
            @issue_description = issue_description
            @issue_assignee = issue_assignee
            @issue_labels = issue_labels
            @sandbox = sandbox
          end

          def run
            matching_apps = find_all_matching_apps(apps, :github, sandbox)
            matching_apps.each do |app|
              ui.info("\n  Creating issue in \"#{app}\"  \n")
              begin
                issue_options = { assignee: issue_assignee, labels: issue_labels }
                issue = client.create_issue(app, issue_title, issue_description, issue_options)
                ui.success("Created the issue successfully \nLink: #{issue[:html_url]}")
              rescue StandardError => e
                ExceptionHandler.new(e).process
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
neetob-ud-1.0.59 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.8 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.6 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.4 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.3 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.2 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.1 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.0 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.1.3 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.1.2 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.1.1 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.1.0 lib/neetob/cli/github/issues/create.rb
neetob-0.2.2 lib/neetob/cli/github/issues/create.rb
neetob-0.2.1 lib/neetob/cli/github/issues/create.rb
neetob-0.2.0 lib/neetob/cli/github/issues/create.rb
neetob-0.1.5 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.14 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.13 lib/neetob/cli/github/issues/create.rb
neetob-0.1.4 lib/neetob/cli/github/issues/create.rb
neetob-ud-0.2.11 lib/neetob/cli/github/issues/create.rb