Sha256: f0975c8d8005750cb006e36c0401326569467ce4d0b089997f0a6a50a18388fb
Contents?: true
Size: 539 Bytes
Versions: 6
Compression:
Stored size: 539 Bytes
Contents
require 'rest_client' require 'json' module Socialcast module Github def create_pull_request(username, password, branch, repo) payload = {:title => branch, :base => 'master', :head => branch}.to_json response = RestClient::Request.new(:url => "https://api.github.com/repos/#{repo}/pulls", :method => "POST", :user => username, :password => password, :payload => payload, :headers => {:accept => :json, :content_type => :json}).execute data = JSON.parse response.body url = data['html_url'] end end end
Version data entries
6 entries across 6 versions & 1 rubygems