Class: Terraspace::Cloud::Vcs::LocalGit::Base
- Inherits:
-
Object
- Object
- Terraspace::Cloud::Vcs::LocalGit::Base
show all
- Extended by:
- Memoist
- Defined in:
- lib/terraspace/cloud/vcs/local_git/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(vars, git_url) ⇒ Base
Returns a new instance of Base.
6
7
8
|
# File 'lib/terraspace/cloud/vcs/local_git/base.rb', line 6
def initialize(vars, git_url)
@vars, @git_url = vars, git_url
end
|
Instance Attribute Details
#git_url ⇒ Object
Returns the value of attribute git_url.
5
6
7
|
# File 'lib/terraspace/cloud/vcs/local_git/base.rb', line 5
def git_url
@git_url
end
|
Class Method Details
.vars_method(name) ⇒ Object
31
32
33
34
35
|
# File 'lib/terraspace/cloud/vcs/local_git/base.rb', line 31
def vars_method(name)
define_method name do
@vars[name]
end
end
|
.vars_methods(*names) ⇒ Object
25
26
27
28
29
|
# File 'lib/terraspace/cloud/vcs/local_git/base.rb', line 25
def vars_methods(*names)
names.each do |name|
vars_method(name)
end
end
|
Instance Method Details
#pr_number ⇒ Object
20
21
22
|
# File 'lib/terraspace/cloud/vcs/local_git/base.rb', line 20
def pr_number
ENV['TS_VCS_PR_NUMBER'] || ENV['PR_NUMBER'] || ENV['MR_NUMBER']
end
|
#vars ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/terraspace/cloud/vcs/local_git/base.rb', line 10
def vars
{
commit_url: commit_url, branch_url: branch_url, pr_number: pr_number,
pr_url: pr_url,
}
end
|