Sha256: 9126188365f3ab784da42c554c4eb49d694c6540ad3274df8cf5e7d359e47af9

Contents?: true

Size: 800 Bytes

Versions: 312

Compression:

Stored size: 800 Bytes

Contents

require 'travis/pro'
require 'travis/tools/github'
require 'highline/import' # so we can hide the password

# Set up GitHub tool for doing the login handshake.
github = Travis::Tools::Github.new(drop_token: true) do |g|
  g.ask_login    = -> { ask("GitHub login: ") }
  g.ask_password = -> { ask("Password: ") { |q| q.echo = "*" } }
  g.ask_otp      = -> { ask("Two-factor token: ") }
end

# Create temporary GitHub token and use it to authenticate against Travis CI.
github.with_token do |token|
  Travis::Pro.github_auth(token)
end

# Look up the current user.
user = Travis::Pro::User.current
puts "Hello #{user.name}!"

# Display repositories the user is a member of.
repos = Travis::Pro::Repository.find_all(member: user.login)
repos.each { |repo| puts "#{repo.slug} #{repo.last_build_state}" }

Version data entries

312 entries across 312 versions & 3 rubygems

Version Path
travis-1.10.1.travis.1341.9 examples/pro_auth.rb
travis-1.10.1.travis.1321.9 examples/pro_auth.rb
travis-1.10.1.travis.1312.9 examples/pro_auth.rb
travis-1.10.1.travis.1311.9 examples/pro_auth.rb
travis-1.10.1.travis.1305.9 examples/pro_auth.rb
travis-1.10.0 examples/pro_auth.rb
travis-1.9.2.travis.1304.9 examples/pro_auth.rb
travis-1.9.2.travis.1303.9 examples/pro_auth.rb
travis-1.10.0.pre.rc4 examples/pro_auth.rb
travis-1.10.0.pre.rc3 examples/pro_auth.rb
travis-1.10.0.pre.rc2 examples/pro_auth.rb
travis-1.9.2.travis.1288.9 examples/pro_auth.rb
travis-1.9.2.travis.1285.9 examples/pro_auth.rb
travis-1.9.2.travis.1279.9 examples/pro_auth.rb
travis-1.10.0.pre.rc1 examples/pro_auth.rb
travis-1.9.2.travis.1254.9 examples/pro_auth.rb
travis-1.9.2.travis.1236.9 examples/pro_auth.rb
travis-1.9.2.travis.1224.9 examples/pro_auth.rb
travis-1.9.1 examples/pro_auth.rb
travis-1.9.1.travis.1223.9 examples/pro_auth.rb