Class: CiHelper::Functions::PullRequest

Inherits:
Base
  • Object
show all
Defined in:
lib/ci_helper/functions/pull_request.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#bit_bucket_client, #config, #issue_monitor, #redmine_client, #user_cli

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from CiHelper::Functions::Base

Instance Attribute Details

#branch_nameObject

This class is responsible for creating pull request for user



8
9
10
# File 'lib/ci_helper/functions/pull_request.rb', line 8

def branch_name
  @branch_name
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ci_helper/functions/pull_request.rb', line 10

def run
  bit_bucket_client.branch_name = branch_name || user_cli.get_branch_name

  if bit_bucket_client.multiple_issues?
    bit_bucket_client.pf_title = user_cli.customize_title
  else
    redmine_client.issue_no = bit_bucket_client.issue_numbers.first
    bit_bucket_client.pf_title = redmine_client.issue.description
    user_cli.print_target(redmine_client.issue.target_branch)
  end

  create_pull_request
  update_issue_status
end