Class: Wheelbarrow::Bucketeer
- Inherits:
-
Object
- Object
- Wheelbarrow::Bucketeer
- Includes:
- Singleton
- Defined in:
- lib/wheelbarrow/bucketeer.rb
Instance Method Summary collapse
-
#initialize ⇒ Bucketeer
constructor
A new instance of Bucketeer.
- #send_pull_request!(options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Bucketeer
Returns a new instance of Bucketeer.
10 11 12 |
# File 'lib/wheelbarrow/bucketeer.rb', line 10 def initialize @bb_client = Authenticator.instance.oauth_client end |
Instance Method Details
#send_pull_request!(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/wheelbarrow/bucketeer.rb', line 14 def send_pull_request!( = {}) target_branch = [:target_branch] || 'master' title = [:target_title] || Utils. description = [:description] payload = pull_request_body(target_branch, title, description).to_json res = @bb_client.post pull_request_url, payload, 'Content-Type' => 'application/json' JSON.parse res.body end |