Class: HerokuFeatureDeployments::PullRequestCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/heroku_feature_deployments/pull_request_creator.rb

Instance Method Summary collapse

Constructor Details

#initialize(app_name, ticket_id, branch_name) ⇒ PullRequestCreator

Returns a new instance of PullRequestCreator.



4
5
6
7
8
# File 'lib/heroku_feature_deployments/pull_request_creator.rb', line 4

def initialize(app_name, ticket_id, branch_name)
  @app_name = app_name
  @ticket_id = ticket_id
  @branch_name = branch_name
end

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
# File 'lib/heroku_feature_deployments/pull_request_creator.rb', line 10

def create
  client.create_pull_request(
    HerokuFeatureDeployments.configuration.github_repo,
    'master', @branch_name, title, body
  )
rescue Octokit::UnprocessableEntity => e
  config.logger.info "An error occurred when creating the pull request: #{e.message}"
end