4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/tping.rb', line 4
def self.request_build(opts)
= ["Content-Type: application/json",
"Accept: application/json",
"Travis-API-Version: 3",
"Authorization: token #{opts[:token]}"].flat_map do ||
["-H", ]
end
command = %w(curl -v -s -X POST)
command +=
command += ["-d", %Q|{ "request": { "branch": "#{opts[:branch]}" }}|]
command << "https://api.travis-ci.#{opts[:pro] ? "com" : "org"}/repo/#{opts[:user]}%2F#{opts[:repo]}/requests"
p command
system(*command)
end
|