Class: LazyPr::CreatePr
- Inherits:
-
Object
- Object
- LazyPr::CreatePr
- Defined in:
- lib/lazy_pr.rb
Instance Method Summary collapse
- #create_pull_request ⇒ Object
-
#initialize ⇒ CreatePr
constructor
A new instance of CreatePr.
- #login_user ⇒ Object
Constructor Details
#initialize ⇒ CreatePr
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_request ⇒ Object
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_user ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lazy_pr.rb', line 12 def login_user if access_token.nil? login_using_credentials else login_using_access_token end end |