ruby_vsts
An unofficial Microsoft Visual Studio Team Services (VSTS) API client in Ruby
About
This will be a Ruby gem to connect to the Microsoft Visual Studio online (VSTS) Rest API.
It may also work with recent versions of TFS too. Work is heavily in progress!
Install
Easy way
gem install ruby_vsts
Secure way
Add the public signing key to verify signature:
gem cert --add <(curl -Ls https://raw.github.com/prodexity/ruby_vsts/master/certs/ruby_vsts-gem-public_cert.pem)
Install with checking signatures:
gem install ruby_vsts -P HighSecurity
Usage
Setup
require 'ruby_vsts'
VSTS.configure do |config|
config.personal_access_token = "YOUR_PERSONAL_ACCESS_TOKEN"
config.base_url = "https://YOUR_INSTANCE.visualstudio.com/"
end
Finding changesets
VSTS::Changeset.find(72300)
VSTS::Changeset.find_all(author: "fabrikam13@hotmail.com")
VSTS::Changeset.find_all(fromId: 1000, toId: 1200)
VSTS::Changeset.find_all(fromDate: "03-01-2017", toDate: "03-18-2017-2:00PM")
VSTS::Changeset.find_all(itemPath: "$/Fabrikam-Fiber-TFVC/Program.cs")
VSTS::Changeset.find_all(top: 20, skip: 100)
Getting changes in a changeset
changeset = VSTS::Changeset.find(72300)
changes = changeset.changes
Getting change items
item = changes[0]
file_contents = item.get
Please see specs and the source code for further examples.