Top Level Namespace
Defined Under Namespace
Modules: Configuration, FaradayMiddleware, Veyor
Instance Method Summary collapse
- #get_account(x) ⇒ Object
- #make_ua ⇒ Object
- #prep_args(limit, start_build, branch) ⇒ Object
- #prep_route(route, account, project, branch, version) ⇒ Object
Instance Method Details
#get_account(x) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/veyor/utils.rb', line 13 def get_account(x) if x.nil? x = Veyor.account_name if x.nil? raise 'no account name found - one must be supplied' end end return x end |
#make_ua ⇒ Object
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, account, project, branch, version) if branch.nil? && version.nil? route = sprintf('%s/%s/%s', route, account, project) elsif !branch.nil? && version.nil? route = sprintf('%s/%s/%s/branch/%s', route, account, project, branch) elsif branch.nil? && !version.nil? route = sprintf('%s/%s/%s/build/%s', route, account, project, version) end return route end |