Travis Ruby Client –

Contact

Documentation

Usage [As a Command Line Tool]


Supported Commands:
    travis repositories|repos|repo|r {optios}
    travis status|stat|s {options}

Repositories:
    travis status|stat|s
    travis repositories|repos|repo|r [--recent]
    travis repostiories --slugs={repository_slug}[,{repository_slug}[,...]]
    travis repositories --name={repository_name} --owner={owner_name}
    travis repostiories --slug={repository_slug}
    travis repositories --builds
    travis repositories --name={repository_name} --owner={owner_name} --build_id={build_id}
    travis repositories --slug={repository_slug} --build_id={build_id}

Supported Options:
    --recent                     lists the recent processed repositories.
    -B, --builds                     lists the recent builds for a repository.
    -o, --owner=                     sets the target repository owner's name.
    -n, --name=                      sets the target repository name.
    -s, --slug=                      sets the target repositorys slug.
    -S, --slugs=                     sets the target repositories slugs (comma separated).
    -b, --build_id=                  sets the target repository build id.
    -h, -H, --help                   display this help message.

The `status` command should be run from your project directory. It will try to identify and dispaly the Travis status of the target repository based on the current directory remote git urls.

Usage [As a Ruby Library]

Fetching Repositories


Travis::API::Client::Repositories.all #Collection of Repository instances

Travis::API::Client::Repositories.all! #Collection of Repository instances bypassing cache

Travis::API::Client::Repositories.owner('owner_name_here').name('name_here').fetch #Repository

Travis::API::Client::Repositories.owner('owner_name_here').name('name_here').fetch! #Repository bypassing cache

Travis::API::Client::Repositories.slug('owner_name_here/name_here').fetch #Repository

Travis::API::Client::Repositories.slug('owner_name_here/name_here').fetch! #Repository bypassing cache

Fetching Builds


Travis::API::Client::Repositories.owner('owner_name_here').name('name_here').builds #Collection of Build instances 

Travis::API::Client::Repositories.owner('owner_name_here').name('name_here').builds! #Collection of Build instances bypassing cache

Travis::API::Client::Repositories.slug('owner_name_here/name_here').builds #Collection of Build instances

Travis::API::Client::Repositories.slug('owner_name_here/name_here').builds! #Collection of Build instances bypassing cache

Travis::API::Client::Repositories.owner('owner_name_here').name('name_here').build('id_here') #Build

Travis::API::Client::Repositories.owner('owner_name_here').name('name_here').build!('id_here') #Build bypassing cache

Travis::API::Client::Repositories.slug('owner_name_here/name_here').build('id_here') #Build

Travis::API::Client::Repositories.slug('owner_name_here/name_here').build!('id_here') #Build bypassing cache

Repository methods

The main attributes from the API will be accessible via the following methods:

[:slug, :id, :status, :last_build_id, :last_build_status, :last_build_number, :last_build_finished_at]

Some relationships can be retrieved using the following methods:

repository.builds #=> Collection of Build instances
repository.last_build #=> Build

You can also update the repository information from the API usign:

repository.reload! #=> Fetch the updated repository data from the API and updates its attributes and relationships

Build methods

The main attributes from the API will be accessible via the following methods:

[:number, :commited_at, :commit, :finished_at, :config, :author_name, :log, :branch, :id, :parent_id, :started_at, :author_email, :status, :repository_id, :message, :compare_url]

Some relationships can be retrieved using the following methods:

build.parent #=> Build or nil
build.repository #=> Repository
build.matrix #=> Collection of Build instances or nil

You can also update the build information from the API usign:

build.reload! #=> Fetch the updated build data from the API and updates its attributes and relationships