Class: GitTopic::Commands::Publish
- Inherits:
-
Object
- Object
- GitTopic::Commands::Publish
- Defined in:
- lib/git_topic/commands/publish.rb
Overview
Publish command creates pull request from description.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(client, repo, branch_name, base) ⇒ Publish
constructor
A new instance of Publish.
Constructor Details
#initialize(client, repo, branch_name, base) ⇒ Publish
Returns a new instance of Publish.
9 10 11 12 13 14 |
# File 'lib/git_topic/commands/publish.rb', line 9 def initialize(client, repo, branch_name, base) @client = client @repo = repo @branch_name = branch_name @base = base end |
Instance Method Details
#execute ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/git_topic/commands/publish.rb', line 16 def execute head = @branch_name response = create_pull_request(@repo, @base, head) puts response[:html_url] rescue StandardError => ex STDERR.puts ex. end |