Module: AppVeyor::Worker

Defined in:
lib/appveyor/worker.rb,
lib/appveyor/worker/version.rb

Defined Under Namespace

Modules: RSpec

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.env(envs) ⇒ Object



32
33
34
35
36
37
38
39
40
41
# File 'lib/appveyor/worker.rb', line 32

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

.message(msg, details = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
# File 'lib/appveyor/worker.rb', line 12

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

.skip?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/appveyor/worker.rb', line 8

def self.skip?
  !api
end

.test(info) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/appveyor/worker.rb', line 23

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