Class: ControlRepo

Inherits:
Object
  • Object
show all
Includes:
ReleaseManager::Git::Utilities, ReleaseManager::Logger
Defined in:
lib/release_manager/control_repo.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ReleaseManager::Logger

#color, #log_level, #logger

Methods included from ReleaseManager::Git::Utilities

#add_file, #add_remote, #author, #author_email, #author_name, #branch_exist?, #checkout_branch, #cherry_pick, #clone, #create_branch, #create_commit, #credentials, #current_branch, #delete_branch, #fetch, #find_or_create_remote, #git_url?, #push_branch, #push_tags, #remote_exists?, #remote_from_name, #remote_from_url, #remote_url_matches?, #remove_file, #transports

Constructor Details

#initialize(path, url = nil) ⇒ ControlRepo

Returns a new instance of ControlRepo.



11
12
13
14
# File 'lib/release_manager/control_repo.rb', line 11

def initialize(path, url = nil)
  @path = path
  @url = url
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



6
7
8
# File 'lib/release_manager/control_repo.rb', line 6

def path
  @path
end

#repoObject

Returns the value of attribute repo.



6
7
8
# File 'lib/release_manager/control_repo.rb', line 6

def repo
  @repo
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/release_manager/control_repo.rb', line 6

def url
  @url
end

Class Method Details

.create(path, url) ⇒ ControlRepo

Returns - creates a new control repo object and clones the url unless already cloned.

Returns:

    • creates a new control repo object and clones the url unless already cloned



17
18
19
20
21
# File 'lib/release_manager/control_repo.rb', line 17

def self.create(path, url)
  c = ControlRepo.new(path, url)
  c.clone(url, path)
  c
end

Instance Method Details

#puppetfileObject



27
28
29
30
31
32
33
# File 'lib/release_manager/control_repo.rb', line 27

def puppetfile
  unless @puppetfile
    @puppetfile = Puppetfile.new(File.join(path, 'Puppetfile'))
    @puppetfile.base_path = path
  end
  @puppetfile
end