Class: BuildTool::VCS::GitConfiguration

Inherits:
BaseConfiguration show all
Defined in:
lib/build-tool/vcs/git.rb

Direct Known Subclasses

GitSvnConfiguration

Instance Attribute Summary collapse

Attributes inherited from BaseConfiguration

#module

Instance Method Summary collapse

Methods inherited from BaseConfiguration

#local_path, #remote_path, #repository

Constructor Details

#initializeGitConfiguration

Returns a new instance of GitConfiguration.



16
17
18
19
# File 'lib/build-tool/vcs/git.rb', line 16

def initialize
    super
    @remote = {}
end

Instance Attribute Details

#remoteObject

Returns the value of attribute remote.



14
15
16
# File 'lib/build-tool/vcs/git.rb', line 14

def remote
  @remote
end

Instance Method Details

#copy_configuration(other) ⇒ Object



43
44
45
46
# File 'lib/build-tool/vcs/git.rb', line 43

def copy_configuration( other )
    super
    @remote = {}     # Do not copy the remotes
end

#nameObject



10
11
12
# File 'lib/build-tool/vcs/git.rb', line 10

def name
    "git"
end

#track_branchObject



35
36
37
38
39
40
41
# File 'lib/build-tool/vcs/git.rb', line 35

def track_branch
    rc = self.module.remote_path.split('/')
    # If there is only one string we assume it is the branch name from
    # origin
    return rc[0] if rc.length == 1
    return rc[1..-1].join( '/' )
end

#track_remoteObject



27
28
29
30
31
32
33
# File 'lib/build-tool/vcs/git.rb', line 27

def track_remote
    rc = self.module.remote_path.split('/')
    # If there is only one string we assume it is the branch name from
    # origin
    return "origin" if rc.length == 1
    return rc[0]
end

#vcs(mod) ⇒ Object

Raises:

  • (StandardError)


21
22
23
24
25
# File 'lib/build-tool/vcs/git.rb', line 21

def vcs( mod )
    raise StandardError if @module and ! mod.equal?( @module )
    @module = mod
    Git.new( self )
end