Class: Indocker::Repositories::Git

Inherits:
Abstract
  • Object
show all
Defined in:
lib/indocker/repositories/git.rb

Instance Attribute Summary collapse

Attributes inherited from Abstract

#name

Instance Method Summary collapse

Methods inherited from Abstract

#initialize, #is_git?, #is_local?, #is_no_sync?

Methods included from Concerns::Inspectable

#inspect

Constructor Details

This class inherits a constructor from Indocker::Repositories::Abstract

Instance Attribute Details

#branch ⇒ Object (readonly)

Returns the value of attribute branch.



2
3
4
# File 'lib/indocker/repositories/git.rb', line 2

def branch
  @branch
end

#email ⇒ Object (readonly)

Returns the value of attribute email.



2
3
4
# File 'lib/indocker/repositories/git.rb', line 2

def email
  @email
end

#password ⇒ Object (readonly)

Returns the value of attribute password.



2
3
4
# File 'lib/indocker/repositories/git.rb', line 2

def password
  @password
end

#remote_name ⇒ Object (readonly)

Returns the value of attribute remote_name.



2
3
4
# File 'lib/indocker/repositories/git.rb', line 2

def remote_name
  @remote_name
end

#remote_url ⇒ Object (readonly)

Returns the value of attribute remote_url.



2
3
4
# File 'lib/indocker/repositories/git.rb', line 2

def remote_url
  @remote_url
end

Instance Method Details

#clone_path ⇒ Object



18
19
20
# File 'lib/indocker/repositories/git.rb', line 18

def clone_path
  @clone_path || "/tmp/#{Indocker.configuration.name}/repositories/git/#{project_name}/#{branch}"
end

#project_name ⇒ Object



14
15
16
# File 'lib/indocker/repositories/git.rb', line 14

def project_name
  @remote_url.split('/').last.gsub('.git', '')
end

#setup(remote_name:, remote_url:, email: nil, password: nil, branch:, clone_path: nil) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/indocker/repositories/git.rb', line 4

def setup(remote_name:, remote_url:, email: nil, password: nil, branch:, clone_path: nil)
  @remote_name = remote_name
  @remote_url = remote_url
  @email = email
  @password = password
  @branch = branch
  @clone_path = clone_path
  self
end