Sha256: 5d2c6f85cff7813a4ba3bebd43d2277a03202d5f245ae8444d854ca6166384a2
Contents?: true
Size: 1.22 KB
Versions: 1
Compression:
Stored size: 1.22 KB
Contents
require 'json' require 'net/http' require_relative "worker/version" require_relative "worker/rspec" if defined? RSpec module AppVeyor::Worker def self.skip? !api end def self.message msg, details=nil x = api or return body = JSON.generate category: 'info', message: msg, details: details x.post '/api/build/messages', body, 'Content-Length'=>body.length.to_s, 'Content-Type'=>'application/json' end def self.test info x = api or return body = JSON.generate info x.post '/api/tests', body, 'Content-Length'=>body.length.to_s, 'Content-Type'=>'application/json' end def self.env envs x = api or return envs.each do |k, v| body = JSON.generate name: k, value: v x.post '/api/build/variables', body, 'Content-Length'=>body.length.to_s, 'Content-Type'=>'application/json' end end private def self.api return if false===@http return @http if @http unless z = ENV['APPVEYOR_API_URL'] @http = false return end z = URI z @http = x = Net::HTTP.start z.host, z.port x.use_ssl='https'==z.scheme x end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
appveyor-worker-0.2.1 | lib/appveyor/worker.rb |