travis 1.6.4.travis.411.4 → 1.6.4.travis.413.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +50 -0
- data/assets/travis.sh +21 -14
- data/assets/travis.sh.erb +9 -5
- data/lib/travis/cli.rb +1 -0
- data/lib/travis/cli/console.rb +4 -0
- data/lib/travis/client.rb +1 -0
- data/lib/travis/client/entity.rb +6 -0
- data/lib/travis/client/repository.rb +10 -0
- data/lib/travis/client/session.rb +16 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDU4MDY3N2Q0MjI3OTg1ZjJjNWJmM2FhZjA4NTBmNTk1NjEyYzBlNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODMxYTYxYTlhNWJiOGQ3NjdkZmQ2NmE2ZjgwMjRkMWEwOTM4YWYwNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGNkZWVhZmNiZDAwMzNhMTVmNDFiYmZhODVmNDVjZTY0NzFjYmYxZmQ0MGMx
|
10
|
+
NWI0MTljYzA5NDNlZjYxZDhhMmUxYTJhYTNlMDRjZTFiOTQ0Y2Q2ZmIzNjU1
|
11
|
+
NTM0OTYzOWUzMjVkZTBlNTc0Nzg3NmFlY2ExMGVlMjU5NTk3ZDI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTU2NjY5NjIwZTRlZWI0MWNkMjRmMjk0ZThhMzQ2NDdkMDQwMjNmMjhlNDNm
|
14
|
+
NTAxYTdiZjgwZDNiYzllNTQ1NzBhZmY3MjJlNjk2MDIxZjc0MjVmZGM5Zjhh
|
15
|
+
MzE2NDY0MDc2NmEzYWRhZmMzNmQ4MjEyY2Q3ODNjOTEwYjAzMDI=
|
data/README.md
CHANGED
@@ -36,6 +36,7 @@ The [travis gem](https://rubygems.org/gems/travis) includes both a [command line
|
|
36
36
|
* [`open`](#open)
|
37
37
|
* [`pubkey`](#pubkey)
|
38
38
|
* [`restart`](#restart)
|
39
|
+
* [`settings`](#settings)
|
39
40
|
* [`setup`](#setup)
|
40
41
|
* [`show`](#show)
|
41
42
|
* [`status`](#status)
|
@@ -53,6 +54,8 @@ The [travis gem](https://rubygems.org/gems/travis) includes both a [command line
|
|
53
54
|
* [Artifacts](#artifacts)
|
54
55
|
* [Users](#users)
|
55
56
|
* [Commits](#commits)
|
57
|
+
* [Caches](#caches)
|
58
|
+
* [Repository Settings](#repository-settings)
|
56
59
|
* [Listening for Events](#listening-for-events)
|
57
60
|
* [Dealing with Sessions](#dealing-with-sessions)
|
58
61
|
* [Using Namespaces](#using-namespaces)
|
@@ -824,6 +827,37 @@ Or a single job:
|
|
824
827
|
$ travis restart 57.1
|
825
828
|
job #57.1 has been restarted
|
826
829
|
|
830
|
+
##### `settings`
|
831
|
+
|
832
|
+
Certain repository settings can be read via the CLI:
|
833
|
+
|
834
|
+
$ travis settings
|
835
|
+
Settings for travis-ci/travis:
|
836
|
+
[-] builds_only_with_travis_yml Only run builds with a .travis.yml
|
837
|
+
[+] build_pushes Build pushes
|
838
|
+
[+] build_pull_requests Build pull requests
|
839
|
+
|
840
|
+
You can also filter the settings by passing them in as arguments:
|
841
|
+
|
842
|
+
$ travis settings build_pushes build_pull_requests
|
843
|
+
Settings for travis-ci/travis:
|
844
|
+
[+] build_pushes Build pushes
|
845
|
+
[+] build_pull_requests Build pull requests
|
846
|
+
|
847
|
+
It is also possible to change these settings via `--enable` and `--disable`:
|
848
|
+
|
849
|
+
$ travis settings build_pushes --disable
|
850
|
+
Settings for travis-ci/travis:
|
851
|
+
[-] build_pushes Build pushes
|
852
|
+
|
853
|
+
Or, alternatively, you can use `-c` to configure the settings interactively:
|
854
|
+
|
855
|
+
$ travis settings -c
|
856
|
+
Settings for travis-ci/travis:
|
857
|
+
Only run builds with a .travis.yml? |yes| no
|
858
|
+
Build pushes? |no| yes
|
859
|
+
Build pull requests? |yes|
|
860
|
+
|
827
861
|
#### `setup`
|
828
862
|
|
829
863
|
Helps you configure Travis addons.
|
@@ -1313,6 +1347,22 @@ It is also possible to delete multiple caches with a single API call:
|
|
1313
1347
|
repo.delete_caches(branch: "master", match: "rbx")
|
1314
1348
|
```
|
1315
1349
|
|
1350
|
+
#### Repository Settings
|
1351
|
+
|
1352
|
+
You can access a repositories settings.
|
1353
|
+
|
1354
|
+
``` ruby
|
1355
|
+
require 'travis'
|
1356
|
+
|
1357
|
+
Travis.access_token = "MY SECRET TOKEN"
|
1358
|
+
settings = Travis::Repository.find('my/repo').settings
|
1359
|
+
|
1360
|
+
if settings.build_pushes?
|
1361
|
+
settings.build_pushes = false
|
1362
|
+
settings.save
|
1363
|
+
end
|
1364
|
+
```
|
1365
|
+
|
1316
1366
|
### Dealing with Sessions
|
1317
1367
|
|
1318
1368
|
Under the hood the session is where the fun is happening. Most methods on the constants and entities just wrap methods on your session, so you don't have to pass the session around all the time or even see it if you don't want to.
|
data/assets/travis.sh
CHANGED
@@ -7,10 +7,11 @@ _travis_complete() {
|
|
7
7
|
2)
|
8
8
|
case "$2" in
|
9
9
|
# commands with smart completions (in addition to command line flags)
|
10
|
-
help)
|
11
|
-
setup)
|
12
|
-
|
13
|
-
|
10
|
+
help) _travis_commands;;
|
11
|
+
setup) _travis_setup;;
|
12
|
+
settings) _travis_settings;;
|
13
|
+
init) _travis_init;;
|
14
|
+
*) _travis_option;;
|
14
15
|
esac;;
|
15
16
|
*) _travis_option;;
|
16
17
|
esac
|
@@ -19,8 +20,9 @@ _travis_complete() {
|
|
19
20
|
if type compdef 1>/dev/null 2>/dev/null; then
|
20
21
|
compdef _travis travis
|
21
22
|
_travis() { _travis_complete $((${#words} - 1)) "${words[2]}"; }
|
22
|
-
_travis_commands() { list=(accounts:"displays accounts and their subscription status" branches:"displays the most recent build for each branch" cache:"lists or deletes repository caches" cancel:"cancels a job or build" console:"interactive shell" disable:"disables a project" enable:"enables a project" encrypt:"encrypts values for the .travis.yml" endpoint:"displays or changes the API endpoint" help:"helps you out when in dire need of information" history:"displays a projects build history" init:"generates a .travis.yml and enables the project" login:"authenticates against the API and stores the token" logout:"deletes the stored API token" logs:"streams test logs" monitor:"live monitor for what's going on" open:"opens a build or job in the browser" pubkey:"prints out a repository's public key" raw:"makes an (authenticated) API call and prints out the result" report:"generates a report useful for filing issues" repos:"lists repositories the user has certain permissions on" restart:"restarts a build or job" setup:"sets up an addon or deploy target" show:"displays a build or job" status:"checks status of the latest build" sync:"triggers a new sync with GitHub" token:"outputs the secret API token" version:"outputs the client version" whatsup:"lists most recent builds" whoami:"outputs the current user") _describe -t common-commands 'common commands' list; }
|
23
|
-
_travis_setup() { list=(appfog:"automatic deployment to Appfog" cloudcontrol:"automatic deployment to cloudControl" cloudfiles:"automatic pushing to Rackspace Cloud Files" cloudfoundry:"automatic deployment to Cloud Foundry" divshot:"deployment to Divshot.io" engineyard:"automatic deployment to Engine Yard" heroku:"automatic deployment to Heroku" npm:"automatic release to NPM" nodejitsu:"automatic deployment to Nodejitsu" openshift:"automatic deployment to OpenShfit" pypi:"automatic deployment to PyPI" rubygems:"automatic release to RubyGems" s:"automatic pushing to S3" sauce_connect:"Sauce Connet addon for Sauce Labs integration") _describe -t common-commands 'common commands' list; }
|
23
|
+
_travis_commands() { list=(accounts:"displays accounts and their subscription status" branches:"displays the most recent build for each branch" cache:"lists or deletes repository caches" cancel:"cancels a job or build" console:"interactive shell" disable:"disables a project" enable:"enables a project" encrypt:"encrypts values for the .travis.yml" endpoint:"displays or changes the API endpoint" help:"helps you out when in dire need of information" history:"displays a projects build history" init:"generates a .travis.yml and enables the project" login:"authenticates against the API and stores the token" logout:"deletes the stored API token" logs:"streams test logs" monitor:"live monitor for what's going on" open:"opens a build or job in the browser" pubkey:"prints out a repository's public key" raw:"makes an (authenticated) API call and prints out the result" report:"generates a report useful for filing issues" repos:"lists repositories the user has certain permissions on" restart:"restarts a build or job" settings:"access repository settings" setup:"sets up an addon or deploy target" show:"displays a build or job" status:"checks status of the latest build" sync:"triggers a new sync with GitHub" token:"outputs the secret API token" version:"outputs the client version" whatsup:"lists most recent builds" whoami:"outputs the current user") _describe -t common-commands 'common commands' list; }
|
24
|
+
_travis_setup() { list=(appfog:"automatic deployment to Appfog" cloudcontrol:"automatic deployment to cloudControl" cloudfiles:"automatic pushing to Rackspace Cloud Files" cloudfoundry:"automatic deployment to Cloud Foundry" divshot:"deployment to Divshot.io" engineyard:"automatic deployment to Engine Yard" heroku:"automatic deployment to Heroku" npm:"automatic release to NPM" nodejitsu:"automatic deployment to Nodejitsu" openshift:"automatic deployment to OpenShfit" opsworks:"deployment to OpsWorks" pypi:"automatic deployment to PyPI" rubygems:"automatic release to RubyGems" s:"automatic pushing to S3" sauce_connect:"Sauce Connet addon for Sauce Labs integration") _describe -t common-commands 'common commands' list; }
|
25
|
+
_travis_settings() { list=(builds_only_with_travis_yml:"Only run builds with a .travis.yml" build_pushes:"Build pushes" build_pull_requests:"Build pull requests") _describe -t common-commands 'common commands' list; }
|
24
26
|
_travis_init() { list=(c:'initialize c project' clojure:'initialize clojure project' cpp:'initialize cpp project' erlang:'initialize erlang project' go:'initialize go project' groovy:'initialize groovy project' haskell:'initialize haskell project' java:'initialize java project' node_js:'initialize node_js project' objective-c:'initialize objective-c project' perl:'initialize perl project' php:'initialize php project' python:'initialize python project' ruby:'initialize ruby project' scala:'initialize scala project') _describe -t common-commands 'common commands' list; }
|
25
27
|
_travis_option() {
|
26
28
|
case "${words[2]}" in
|
@@ -28,7 +30,7 @@ if type compdef 1>/dev/null 2>/dev/null; then
|
|
28
30
|
branches) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
|
29
31
|
cache) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-d[delete listed caches]" "--delete[delete listed caches]" "-b[only list/delete caches on given branch]" "--branch[only list/delete caches on given branch]" "-m[only list/delete caches where slug matches given string]" "--match[only list/delete caches where slug matches given string]" "-f[do not ask user to confirm deleting the caches]" "--force[do not ask user to confirm deleting the caches]" '*:file:_files' && return 0;;
|
30
32
|
cancel) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
|
31
|
-
console) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" '*:file:_files' && return 0;;
|
33
|
+
console) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-x[run line of ruby]" "--eval[run line of ruby]" '*:file:_files' && return 0;;
|
32
34
|
disable) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
|
33
35
|
enable) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-s[don't trigger a sync if the repo is unknown]" "--skip-sync[don't trigger a sync if the repo is unknown]" '*:file:_files' && return 0;;
|
34
36
|
encrypt) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-a[adds it to .travis.yml under KEY (default: env.global)]" "--add[adds it to .travis.yml under KEY (default: env.global)]" "-s[treat each line as a separate input]" "--split[treat each line as a separate input]" "--no-split[treat each line as a separate input]" "-p[don't override existing values, instead treat as list]" "--append[don't override existing values, instead treat as list]" "-x[override existing value]" "--override[override existing value]" '*:file:_files' && return 0;;
|
@@ -46,6 +48,7 @@ if type compdef 1>/dev/null 2>/dev/null; then
|
|
46
48
|
report) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[include repositories in report]" "--known-repos[include repositories in report]" '*:file:_files' && return 0;;
|
47
49
|
repos) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-m[only list repositories matching the given pattern (shell style)]" "--match[only list repositories matching the given pattern (shell style)]" "-o[only list repos for a certain owner]" "--owner[only list repos for a certain owner]" "-n[only list repos with a given name]" "--name[only list repos with a given name]" "-a[only list active repositories]" "--active[only list active repositories]" "-A[only list inactive repositories]" "--inactive[only list inactive repositories]" "-d[only list repos with (or without) admin access]" "--admin[only list repos with (or without) admin access]" "-D[only list repos without admin access]" "--no-admin[only list repos without admin access]" '*:file:_files' && return 0;;
|
48
50
|
restart) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
|
51
|
+
settings) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "--keys[always use setting key instead of description]" "--enable[enable the setting(s)]" "-f[disable the setting(s)]" "--disable[disable the setting(s)]" "-c[change settings interactively]" "--configure[change settings interactively]" '*:file:_files' && return 0;;
|
49
52
|
setup) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-f[override config section if it already exists]" "--force[override config section if it already exists]" '*:file:_files' && return 0;;
|
50
53
|
show) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" '*:file:_files' && return 0;;
|
51
54
|
status) _arguments -s -S "-h[Display help]" "--help[Display help]" "-i[be interactive and colorful]" "--interactive[be interactive and colorful]" "--no-interactive[be interactive and colorful]" "-E[don't rescue exceptions]" "--explode[don't rescue exceptions]" "--no-explode[don't rescue exceptions]" "--skip-version-check[don't check if travis client is up to date]" "--skip-completion-check[don't check if auto-completion is set up]" "-e[Travis API server to talk to]" "--api-endpoint[Travis API server to talk to]" "-I[do not verify SSL certificate of API endpoint]" "--insecure[do not verify SSL certificate of API endpoint]" "--no-insecure[do not verify SSL certificate of API endpoint]" "--pro[short-cut for --api-endpoint 'https://api.travis-ci.com/']" "--org[short-cut for --api-endpoint 'https://api.travis-ci.org/']" "--staging[talks to staging system]" "-t[access token to use]" "--token[access token to use]" "--debug[show API requests]" "-X[use enterprise setup (optionally takes name for multiple setups)]" "--enterprise[use enterprise setup (optionally takes name for multiple setups)]" "--adapter[Faraday adapter to use for HTTP requests]" "-r[repository to use (will try to detect from current git clone)]" "--repo[repository to use (will try to detect from current git clone)]" "-x[sets the exit code to 1 if the build failed]" "--exit-code[sets the exit code to 1 if the build failed]" "--no-exit-code[sets the exit code to 1 if the build failed]" "-q[does not print anything]" "--quiet[does not print anything]" "--no-quiet[does not print anything]" "-p[sets the status code to 1 if the build is pending]" "--fail-pending[sets the status code to 1 if the build is pending]" "--no-fail-pending[sets the status code to 1 if the build is pending]" '*:file:_files' && return 0;;
|
@@ -59,8 +62,9 @@ if type compdef 1>/dev/null 2>/dev/null; then
|
|
59
62
|
elif type compctl 1>/dev/null 2>/dev/null; then
|
60
63
|
compctl -K _travis travis
|
61
64
|
_travis() { read -cA words && _travis_complete $((${#words} - 1)) "${words[2]}"; }
|
62
|
-
_travis_commands() { reply=("accounts" "branches" "cache" "cancel" "console" "disable" "enable" "encrypt" "endpoint" "help" "history" "init" "login" "logout" "logs" "monitor" "open" "pubkey" "raw" "report" "repos" "restart" "setup" "show" "status" "sync" "token" "version" "whatsup" "whoami"); }
|
63
|
-
_travis_setup() { reply=("appfog" "cloudcontrol" "cloudfiles" "cloudfoundry" "divshot" "engineyard" "heroku" "npm" "nodejitsu" "openshift" "pypi" "rubygems" "s" "sauce_connect"); }
|
65
|
+
_travis_commands() { reply=("accounts" "branches" "cache" "cancel" "console" "disable" "enable" "encrypt" "endpoint" "help" "history" "init" "login" "logout" "logs" "monitor" "open" "pubkey" "raw" "report" "repos" "restart" "settings" "setup" "show" "status" "sync" "token" "version" "whatsup" "whoami"); }
|
66
|
+
_travis_setup() { reply=("appfog" "cloudcontrol" "cloudfiles" "cloudfoundry" "divshot" "engineyard" "heroku" "npm" "nodejitsu" "openshift" "opsworks" "pypi" "rubygems" "s" "sauce_connect"); }
|
67
|
+
_travis_settings() { reply=(builds_only_with_travis_yml build_pushes build_pull_requests); }
|
64
68
|
_travis_init() { reply=("c" "clojure" "cpp" "erlang" "go" "groovy" "haskell" "java" "node_js" "objective-c" "perl" "php" "python" "ruby" "scala"); }
|
65
69
|
_travis_option() {
|
66
70
|
case "${words[2]}" in
|
@@ -68,7 +72,7 @@ elif type compctl 1>/dev/null 2>/dev/null; then
|
|
68
72
|
branches) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
|
69
73
|
cache) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--delete" "-d" "--branch" "-b" "--match" "-m" "--force" "-f");;
|
70
74
|
cancel) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
|
71
|
-
console) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter");;
|
75
|
+
console) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--eval" "-x");;
|
72
76
|
disable) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
|
73
77
|
enable) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--skip-sync" "-s");;
|
74
78
|
encrypt) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--add" "-a" "--split" "--no-split" "-s" "--append" "-p" "--override" "-x");;
|
@@ -86,6 +90,7 @@ elif type compctl 1>/dev/null 2>/dev/null; then
|
|
86
90
|
report) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--known-repos" "-r");;
|
87
91
|
repos) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--match" "-m" "--owner" "-o" "--name" "-n" "--active" "-a" "--inactive" "-A" "--admin" "-d" "--no-admin" "-D");;
|
88
92
|
restart) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
|
93
|
+
settings) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--keys" "--enable" "--disable" "-f" "--configure" "-c");;
|
89
94
|
setup) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--force" "-f");;
|
90
95
|
show) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r");;
|
91
96
|
status) reply=("--help" "-h" "--interactive" "--no-interactive" "-i" "--explode" "--no-explode" "-E" "--skip-version-check" "--skip-completion-check" "--api-endpoint" "-e" "--insecure" "--no-insecure" "-I" "--pro" "--org" "--staging" "--token" "-t" "--debug" "--enterprise" "-X" "--adapter" "--repo" "-r" "--exit-code" "--no-exit-code" "-x" "--quiet" "--no-quiet" "-q" "--fail-pending" "--no-fail-pending" "-p");;
|
@@ -99,9 +104,10 @@ elif type compctl 1>/dev/null 2>/dev/null; then
|
|
99
104
|
elif type complete 1>/dev/null 2>/dev/null; then
|
100
105
|
complete -F _travis travis
|
101
106
|
_travis() { _travis_complete "$COMP_CWORD" "${COMP_WORDS[1]}"; }
|
102
|
-
_travis_commands() { COMPREPLY=( $(compgen -W "accounts branches cache cancel console disable enable encrypt endpoint help history init login logout logs monitor open pubkey raw report repos restart setup show status sync token version whatsup whoami" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
103
|
-
_travis_setup() { COMPREPLY=( $(compgen -W "appfog cloudcontrol cloudfiles cloudfoundry divshot engineyard heroku npm nodejitsu openshift pypi rubygems s sauce_connect" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
104
|
-
|
107
|
+
_travis_commands() { COMPREPLY=( $(compgen -W "accounts branches cache cancel console disable enable encrypt endpoint help history init login logout logs monitor open pubkey raw report repos restart settings setup show status sync token version whatsup whoami" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
108
|
+
_travis_setup() { COMPREPLY=( $(compgen -W "appfog cloudcontrol cloudfiles cloudfoundry divshot engineyard heroku npm nodejitsu openshift opsworks pypi rubygems s sauce_connect" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
109
|
+
_travis_settings() { COMPREPLY=( $(compgen -W "builds_only_with_travis_yml build_pushes build_pull_requests" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
110
|
+
_travis_init() { COMPREPLY=( $(compgen -W ""c" "clojure" "cpp" "erlang" "go" "groovy" "haskell" "java" "node_js" "objective-c" "perl" "php" "python" "ruby" "scala"" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
105
111
|
_travis_option() {
|
106
112
|
local options
|
107
113
|
case "${COMP_WORDS[1]}" in
|
@@ -109,7 +115,7 @@ elif type complete 1>/dev/null 2>/dev/null; then
|
|
109
115
|
branches) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
|
110
116
|
cache) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --delete -d --branch -b --match -m --force -f";;
|
111
117
|
cancel) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
|
112
|
-
console) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter";;
|
118
|
+
console) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --eval -x";;
|
113
119
|
disable) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
|
114
120
|
enable) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --skip-sync -s";;
|
115
121
|
encrypt) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --add -a --split --no-split -s --append -p --override -x";;
|
@@ -127,6 +133,7 @@ elif type complete 1>/dev/null 2>/dev/null; then
|
|
127
133
|
report) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --known-repos -r";;
|
128
134
|
repos) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --match -m --owner -o --name -n --active -a --inactive -A --admin -d --no-admin -D";;
|
129
135
|
restart) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
|
136
|
+
settings) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --keys --enable --disable -f --configure -c";;
|
130
137
|
setup) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --force -f";;
|
131
138
|
show) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r";;
|
132
139
|
status) options="--help -h --interactive --no-interactive -i --explode --no-explode -E --skip-version-check --skip-completion-check --api-endpoint -e --insecure --no-insecure -I --pro --org --staging --token -t --debug --enterprise -X --adapter --repo -r --exit-code --no-exit-code -x --quiet --no-quiet -q --fail-pending --no-fail-pending -p";;
|
data/assets/travis.sh.erb
CHANGED
@@ -7,10 +7,11 @@ _travis_complete() {
|
|
7
7
|
2)
|
8
8
|
case "$2" in
|
9
9
|
# commands with smart completions (in addition to command line flags)
|
10
|
-
help)
|
11
|
-
setup)
|
12
|
-
|
13
|
-
|
10
|
+
help) _travis_commands;;
|
11
|
+
setup) _travis_setup;;
|
12
|
+
settings) _travis_settings;;
|
13
|
+
init) _travis_init;;
|
14
|
+
*) _travis_option;;
|
14
15
|
esac;;
|
15
16
|
*) _travis_option;;
|
16
17
|
esac
|
@@ -21,6 +22,7 @@ if type compdef 1>/dev/null 2>/dev/null; then
|
|
21
22
|
_travis() { _travis_complete $((${#words} - 1)) "${words[2]}"; }
|
22
23
|
_travis_commands() { list=(<%= commands.map { |c| "%s:%p" % [c.command_name, c.description] }.join(" ") %>) _describe -t common-commands 'common commands' list; }
|
23
24
|
_travis_setup() { list=(<%= Travis::CLI::Setup.services.map { |s| "%s:%p" % [s.service_name, s.description] }.join(" ") %>) _describe -t common-commands 'common commands' list; }
|
25
|
+
_travis_settings() { list=(<%= Travis::CLI::Settings::DESCRIPTIONS.map { |k,v| "%s:%p" % [k, v] }.join(" ") %>) _describe -t common-commands 'common commands' list; }
|
24
26
|
_travis_init() { list=(<%= Travis::CLI::Init.languages.map { |l| "#{l}:'initialize #{l} project'" }.join(" ") %>) _describe -t common-commands 'common commands' list; }
|
25
27
|
_travis_option() {
|
26
28
|
case "${words[2]}" in
|
@@ -34,6 +36,7 @@ elif type compctl 1>/dev/null 2>/dev/null; then
|
|
34
36
|
_travis() { read -cA words && _travis_complete $((${#words} - 1)) "${words[2]}"; }
|
35
37
|
_travis_commands() { reply=(<%= commands.map(&:command_name).map(&:inspect).join(" ") %>); }
|
36
38
|
_travis_setup() { reply=(<%= Travis::CLI::Setup.services.map(&:service_name).map(&:inspect).join(" ") %>); }
|
39
|
+
_travis_settings() { reply=(<%= Travis::CLI::Settings::DESCRIPTIONS.keys.join(" ") %>); }
|
37
40
|
_travis_init() { reply=(<%= Travis::CLI::Init.languages.map(&:inspect).join(" ") %>); }
|
38
41
|
_travis_option() {
|
39
42
|
case "${words[2]}" in
|
@@ -47,7 +50,8 @@ elif type complete 1>/dev/null 2>/dev/null; then
|
|
47
50
|
_travis() { _travis_complete "$COMP_CWORD" "${COMP_WORDS[1]}"; }
|
48
51
|
_travis_commands() { COMPREPLY=( $(compgen -W "<%= commands.map(&:command_name).join(" ") %>" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
49
52
|
_travis_setup() { COMPREPLY=( $(compgen -W "<%= Travis::CLI::Setup.services.map(&:service_name).join(" ") %>" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
50
|
-
|
53
|
+
_travis_settings() { COMPREPLY=( $(compgen -W "<%= Travis::CLI::Settings::DESCRIPTIONS.keys.join(" ") %>" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
54
|
+
_travis_init() { COMPREPLY=( $(compgen -W "<%= Travis::CLI::Init.languages.map(&:inspect).join(" ") %>" -- "${COMP_WORDS[COMP_CWORD]}") ); }
|
51
55
|
_travis_option() {
|
52
56
|
local options
|
53
57
|
case "${COMP_WORDS[1]}" in
|
data/lib/travis/cli.rb
CHANGED
@@ -40,6 +40,7 @@ module Travis
|
|
40
40
|
autoload :Report, 'travis/cli/report'
|
41
41
|
autoload :Repos, 'travis/cli/repos'
|
42
42
|
autoload :Restart, 'travis/cli/restart'
|
43
|
+
autoload :Settings, 'travis/cli/settings'
|
43
44
|
autoload :Setup, 'travis/cli/setup'
|
44
45
|
autoload :Show, 'travis/cli/show'
|
45
46
|
autoload :Status, 'travis/cli/status'
|
data/lib/travis/cli/console.rb
CHANGED
data/lib/travis/client.rb
CHANGED
data/lib/travis/client/entity.rb
CHANGED
@@ -115,11 +115,17 @@ module Travis
|
|
115
115
|
self.class.attributes
|
116
116
|
end
|
117
117
|
|
118
|
+
def to_h
|
119
|
+
Hash[attribute_names.map { |n| [n, self[n]] }]
|
120
|
+
end
|
121
|
+
|
118
122
|
def [](key)
|
123
|
+
key = key.to_s
|
119
124
|
send(key) if include? key
|
120
125
|
end
|
121
126
|
|
122
127
|
def []=(key, value)
|
128
|
+
key = key.to_s
|
123
129
|
send("#{key}=", value) if include? key
|
124
130
|
end
|
125
131
|
|
@@ -184,6 +184,16 @@ module Travis
|
|
184
184
|
session.account(owner_name)
|
185
185
|
end
|
186
186
|
|
187
|
+
def settings
|
188
|
+
attributes['settings'] ||= begin
|
189
|
+
settings = session.get("/repos/#{id}/settings")['settings']
|
190
|
+
settings.repository = self
|
191
|
+
settings
|
192
|
+
end
|
193
|
+
rescue Travis::Client::NotFound
|
194
|
+
raise Travis::Client::Error, "not allowed to access settings"
|
195
|
+
end
|
196
|
+
|
187
197
|
def caches(params = {})
|
188
198
|
session.get("/repos/#{id}/caches", params)['caches']
|
189
199
|
end
|
@@ -160,6 +160,18 @@ module Travis
|
|
160
160
|
load delete_raw(*args)
|
161
161
|
end
|
162
162
|
|
163
|
+
def patch(*args)
|
164
|
+
load patch_raw(*args)
|
165
|
+
end
|
166
|
+
|
167
|
+
def post(*args)
|
168
|
+
load post_raw(*args)
|
169
|
+
end
|
170
|
+
|
171
|
+
def put(*args)
|
172
|
+
load put_raw(*args)
|
173
|
+
end
|
174
|
+
|
163
175
|
def get_raw(*args)
|
164
176
|
raw(:get, *args)
|
165
177
|
end
|
@@ -172,11 +184,14 @@ module Travis
|
|
172
184
|
raw(:put, *args)
|
173
185
|
end
|
174
186
|
|
187
|
+
def patch_raw(*args)
|
188
|
+
raw(:patch, *args)
|
189
|
+
end
|
190
|
+
|
175
191
|
def delete_raw(*args)
|
176
192
|
raw(:delete, *args)
|
177
193
|
end
|
178
194
|
|
179
|
-
|
180
195
|
def raw(verb, url, *args)
|
181
196
|
url = url.sub(/^\//, '')
|
182
197
|
result = instrumented(verb.to_s.upcase, url, *args) do
|