lib/janky/notifier/github_status.rb
# Internal: POST the new status to the API
POST the new status to the API
POST the new status to the API
def post(path, status, url, desc, context = nil)
        http = Net::HTTP.new(@api_url.host, @api_url.port)
        post = Net::HTTP::Post.new("#{@api_url.path}#{path}")
        http.use_ssl = true
        post["Content-Type"] = "application/json"
        post["Authorization"] = "token #{@token}"
        body = {
          :state => status,
          :target_url => url,
          :description => desc,
        }
        unless context.nil?
          post["Accept"] = "application/vnd.github.she-hulk-preview+json"
          body[:context] = context
        end
        post.body = body.to_json
        http.request(post)
      end
def post ( path , status , url , desc , context = nil ) http = Net :: HTTP . new ( @api_url . host , @api_url . port ) post = Net :: HTTP :: Post . new ( "#{@api_url.path}#{path}" ) http . use_ssl = true post [ "Content-Type" ] = "application/json" post [ "Authorization" ] = "token #{@token}" body = { :state => status , :target_url => url , :description => desc , } unless context . nil? post [ "Accept" ] = "application/vnd.github.she-hulk-preview+json" body [ :context ] = context end post . body = body . to_json http . request ( post ) end
Internal: POST the new status to the API
Internal : POST the new status to the API
path
status
url
desc
context