Top Level Namespace
Defined Under Namespace
Modules: Configuration, Veyor Classes: CustomErrors
Instance Method Summary collapse
-
#check_provider(x) ⇒ Object
:nodoc:.
-
#get_account(x) ⇒ Object
:nodoc:.
-
#make_ua ⇒ Object
:nodoc:.
-
#prep_args(limit, start_build, branch) ⇒ Object
:nodoc:.
-
#prep_route(route, account, project, branch, version) ⇒ Object
:nodoc:.
Instance Method Details
#check_provider(x) ⇒ Object
:nodoc:
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/veyor/utils.rb', line 35 def check_provider(x) #:nodoc: appveyor_providers = ["gitHub", "bitBucket", "vso", "gitLab", "kiln", "stash", "git", "mercurial", "subversion"] if appveyor_providers.include? x return x else raise 'provider must be one of: %s' % appveyor_providers.join(', ') end end |
#get_account(x) ⇒ Object
:nodoc:
13 14 15 16 17 18 19 20 21 |
# File 'lib/veyor/utils.rb', line 13 def get_account(x) #:nodoc: if x.nil? x = Veyor.account_name if x.nil? raise 'could not find env var APPVEYOR_ACCOUNT_NAME; please set it' end end return x end |
#make_ua ⇒ Object
:nodoc:
1 2 3 4 5 |
# File 'lib/veyor/utils.rb', line 1 def make_ua #:nodoc: requa = 'Faraday/v' + Faraday::VERSION habua = 'Veyor/v' + Veyor::VERSION return requa + ' ' + habua end |
#prep_args(limit, start_build, branch) ⇒ Object
:nodoc:
7 8 9 10 11 |
# File 'lib/veyor/utils.rb', line 7 def prep_args(limit, start_build, branch) #:nodoc: 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
:nodoc:
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) #:nodoc: 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 |