Class: Wheelbarrow::Bucketeer

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/wheelbarrow/bucketeer.rb

Instance Method Summary collapse

Constructor Details

#initializeBucketeer

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!(options = {})
  target_branch = options[:target_branch] || 'master'
  title = options[:target_title] || Utils.last_commit_message
  description = options[: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