Class: Reviewr::CLI::Request
Instance Attribute Summary
Attributes inherited from Command
#arguments, #input, #output, #project
Instance Method Summary
collapse
Methods inherited from Command
#call, #initialize, #prompt_for_user, #read_template
Instance Method Details
#commit_msg ⇒ Object
23
24
25
|
# File 'lib/reviewr/cli/request.rb', line 23
def commit_msg
read_template('commit_msg.erb')
end
|
#compare_url ⇒ Object
18
19
20
21
|
# File 'lib/reviewr/cli/request.rb', line 18
def compare_url
repo = project.origin_location.split(':')[1].gsub(/.git$/, "/compare")
"http://github.com/#{repo}/#{project.master_sha}...#{project.review_sha}"
end
|
#email_body ⇒ Object
27
28
29
|
# File 'lib/reviewr/cli/request.rb', line 27
def email_body
read_template('request_email.erb')
end
|
#execute ⇒ Object
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/reviewr/cli/request.rb', line 7
def execute
project.to = arguments.first
prompt_for_user
original_branch = project.current_branch
project.create_review_branch(original_branch)
project.create_review_commit(commit_msg)
project.push_review_branch
Mailer.new(project).send(email_body)
project.change_branch(original_branch)
end
|