Class: LazyPr::CreatePr

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

Instance Method Summary collapse

Constructor Details

#initializeCreatePr

Returns a new instance of CreatePr.



6
7
8
9
10
# File 'lib/lazy_pr.rb', line 6

def initialize
	@head_branch = ARGV[0]
	@pull_request_title = ARGV[1]
	check_params
end

Instance Method Details

#create_pull_requestObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/lazy_pr.rb', line 20

def create_pull_request
	begin
		@client.create_pull_request(repo, @head_branch, base, pull_request_title)
		puts "Successfully created PR...!"
	rescue Octokit::UnprocessableEntity => e
		puts e.errors[0][:message]
	rescue
		puts "Failed to  create PR. Please ensure you have required authorization."
	end
end

#login_userObject



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

def 
	if access_token.nil?
		
	else
		
	end
end