Method: Git#initialize

Defined in:
lib/version_control/git.rb

#initialize(git, options, compat_options = {}) ⇒ Git

Initializes an instance of the class

Attributes

  • git - path to the git executable

  • options - hash of options includes: url - url for svn repository base_path - path for the local repository username - repository user username password - repository user password verbose - true for verbose output repository - name of remote git repository (default = origin) artifact_path - path in repository for artifacts (default = .) branch - scm branch (default = master) simulate - simulate command - echo it (default = false) output_file - file for logging results (default = step output file)



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/version_control/git.rb', line 23

def initialize(git, options, compat_options = {})
  self.extend Utilities
  if options.has_key?("SS_output_dir")
    BrpmAuto.log "Load for this class has changed, no longer necessary to send params as 2nd argument"
    options = compat_options 
  end
  @url = get_option(options,"url")
  @base_path = get_option(options,"base_path")
  user = get_option(options,"username")
  password = get_option(options,"password")
  @verbose = get_option(options,"verbose", false)
  @artifact_path = get_option(options,"artifact_path")
  @simulate = get_option(options,"simulate", false)
  update_repo_info(options)
  if user != "" && password != ""
    @credential = " --username #{user} --password #{password}"
  else
    @credential = ""
  end
  super(params)
  @git = git
end