Class: Terraspace::Cloud::Vcs::LocalGit::Azure
- Inherits:
-
Base
- Object
- Base
- Terraspace::Cloud::Vcs::LocalGit::Azure
show all
- Defined in:
- lib/terraspace/cloud/vcs/local_git/azure.rb
Instance Attribute Summary
Attributes inherited from Base
#git_url
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #pr_number, vars_method, vars_methods
Instance Method Details
#base_repo_url ⇒ Object
15
16
17
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 15
def base_repo_url
"#{host}/#{org}/#{project}/_git/#{repo}"
end
|
#branch_url ⇒ Object
19
20
21
22
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 19
def branch_url
"#{base_repo_url}?verison=GB#{sha}" if sha
end
|
#commit_url ⇒ Object
10
11
12
13
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 10
def commit_url
"#{base_repo_url}/commits/#{sha}" if sha
end
|
#full_repo ⇒ Object
52
53
54
55
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 52
def full_repo
version, org, project, repo = url_info
"#{org}/#{repo}"
end
|
#host ⇒ Object
32
33
34
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 32
def host
"https://dev.azure.com"
end
|
#org ⇒ Object
42
43
44
45
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 42
def org
version, org, project, repo = url_info
org
end
|
#pr_url ⇒ Object
Also computed in ci plugins which detects it from the ci env. Also handling here for case when user provides PR_NUMBER and GIT_REPO outside of normal CI env.
26
27
28
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 26
def pr_url
"#{host}/#{full_repo}/pull-requests/#{pr_number}" if pr_number
end
|
#project ⇒ Object
57
58
59
60
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 57
def project
version, org, project, repo = url_info
project
end
|
#repo ⇒ Object
47
48
49
50
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 47
def repo
version, org, project, repo = url_info
repo
end
|
#url_info ⇒ Object
36
37
38
39
40
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 36
def url_info
uri = URI(git_url)
uri.path.sub(/^\//,'').split('/') end
|
#vars ⇒ Object
3
4
5
6
7
8
|
# File 'lib/terraspace/cloud/vcs/local_git/azure.rb', line 3
def vars
super.merge(
host: host,
full_repo: full_repo,
)
end
|