Awesome
TravisKit
Full unofficial native block based Travis CI API Wrapper for iOS / OS X based on AFNetworking 2.x and JSONModel mapping.
Installation
The easiest way to setup TravisKit is with CocoaPods.
pod TravisKit, '~> 1.0'
Alternatively, you can drag & drop the TravisKit
folder into your project. Note that you need to install AFNetworking
and JSONModel
as well, as TravisKit
will not work without them.
Authentication
Travis CI uses authentication tokens from GitHub, which can be obtained with:
Or a personal access token can be generated on user's specific page. Note that OctoKit uses AFNetworking 1.x, which is incompatible with TravisKit.
Usage
To use TravisKit, we must first create a client and specify to which server we will connect to (open source or private). After our client is initialized, we must authenticate to Travis with GitHub.
TKClient* client = [[TKClient alloc] initWithServer:TKOpenSourceServer];
[client authenticateWithGitHubToken:@"<GITHUB_TOKEN>" success:nil failure:nil;
After our client is authenticated, we can create requests for specific data:
[client recentRepositoriesWithSuccess:^(NSArray* repositories)
{
// Do something with repositories here
}
failure:^(NSError* error)
{
// Handle error
}];
See Demo project for more example calls and check out the header file for expressive documentation. Travis CI API documentation can also help.
Subspecs
TravisKit is divided into two Subspecs on CocoaPods:
- Model contains all Travis CI models (
TravisKit/Model
) and routines to get them - Log contains all functionality to stream build logs in realtime (
TravisKit/Log
)
You may use both or each of them separately.
Contact
Dal Rupnik
- legoless on GitHub
- @thelegoless on Twitter
- legoless@arvystate.net
License
TravisKit is available under the MIT license. See LICENSE file for more information.