Top Level Namespace

Defined Under Namespace

Modules: Configuration, FaradayMiddleware, Veyor

Instance Method Summary collapse

Instance Method Details

#get_account(x) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/veyor/utils.rb', line 13

def (x)
	if x.nil?
	  x = Veyor.
	  if x.nil?
	  	raise 'no account name found - one must be supplied'
	  end
	end
	return x
end

#make_uaObject



1
2
3
4
5
# File 'lib/veyor/utils.rb', line 1

def make_ua
	requa = 'Faraday/v' + Faraday::VERSION
  habua = 'Veyor/v' + Veyor::VERSION
  return requa + ' ' + habua
end

#prep_args(limit, start_build, branch) ⇒ Object



7
8
9
10
11
# File 'lib/veyor/utils.rb', line 7

def prep_args(limit, start_build, branch)
	args = { recordsNumber: limit, startBuildId: start_build, branch: branch }
  opts = args.delete_if { |k, v| v.nil? }
  return opts
end

#prep_route(route, account, project, branch, version) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'lib/veyor/utils.rb', line 23

def prep_route(route, , project, branch, version)
  if branch.nil? && version.nil?
    route = sprintf('%s/%s/%s', route, , project)
  elsif !branch.nil? && version.nil?
    route = sprintf('%s/%s/%s/branch/%s', route, , project, branch)
  elsif branch.nil? && !version.nil?
    route = sprintf('%s/%s/%s/build/%s', route, , project, version)
  end
  return route
end