class Travis::CLI::Open
Public Instance Methods
run(number = nil)
click to toggle source
# File lib/travis/cli/open.rb, line 12 def run(number = nil) url = url_for(number) if print? say url, "web view: %s" else Launchy.open(url) end end
Private Instance Methods
host()
click to toggle source
# File lib/travis/cli/open.rb, line 34 def host github ? "github.com" : session.config['host'] end
repo_url()
click to toggle source
# File lib/travis/cli/open.rb, line 30 def repo_url "https://#{host}/#{slug}" end
url_for(number)
click to toggle source
# File lib/travis/cli/open.rb, line 23 def url_for(number) return repo_url unless number entity = job(number) || build(number) error "could not find job or build #{repository.slug}##{number}" unless entity github ? entity.commit.compare_url : "#{repo_url}/#{entity.class.many}/#{entity.id}" end