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

Constructor Details

#initializeGitConfiguration

Returns a new instance of GitConfiguration.



94
95
96
97
98
# File 'lib/build-tool/vcs/git.rb', line 94

def initialize
    super
    @remote = {}
    @track = "origin/master"
end

Instance Attribute Details

#remoteObject

Returns the value of attribute remote.



92
93
94
# File 'lib/build-tool/vcs/git.rb', line 92

def remote
  @remote
end

#trackObject

The branch to track



107
108
109
# File 'lib/build-tool/vcs/git.rb', line 107

def track
  @track
end

Instance Method Details

#copy_configuration(other) ⇒ Object



125
126
127
128
# File 'lib/build-tool/vcs/git.rb', line 125

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

#nameObject



88
89
90
# File 'lib/build-tool/vcs/git.rb', line 88

def name
    "git"
end

#track_branchObject



117
118
119
120
121
122
123
# File 'lib/build-tool/vcs/git.rb', line 117

def track_branch
    rc = track.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



109
110
111
112
113
114
115
# File 'lib/build-tool/vcs/git.rb', line 109

def track_remote
    rc = track.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)


100
101
102
103
104
# File 'lib/build-tool/vcs/git.rb', line 100

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