Class: RightBranch::Updater

Inherits:
Object
  • Object
show all
Defined in:
lib/right_branch/updater.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Updater

Returns a new instance of Updater.



7
8
9
10
# File 'lib/right_branch/updater.rb', line 7

def initialize(options)
  @repository = options[:repository]
  @credentials = options[:credentials]
end

Instance Attribute Details

#credentialsObject (readonly)

Returns the value of attribute credentials.



5
6
7
# File 'lib/right_branch/updater.rb', line 5

def credentials
  @credentials
end

#repositoryObject (readonly)

Returns the value of attribute repository.



5
6
7
# File 'lib/right_branch/updater.rb', line 5

def repository
  @repository
end

Instance Method Details

#run!(old_pr_number, new_branch) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/right_branch/updater.rb', line 12

def run!(old_pr_number, new_branch)
  new_pr = resubmit_pr(old_pr_number, new_branch)

  update_pr(old_pr_number, state: 'closed')

  comment_on_issue old_pr_number ,
    "Reopened against `#{new_branch}` (##{new_pr.number})"
end