Class: BuildTool::VCS::GitConfiguration
- Inherits:
-
BaseConfiguration
- Object
- BaseConfiguration
- BuildTool::VCS::GitConfiguration
- Defined in:
- lib/build-tool/vcs/git.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#remote ⇒ Object
Returns the value of attribute remote.
-
#track ⇒ Object
The branch to track.
Attributes inherited from BaseConfiguration
Instance Method Summary collapse
- #copy_configuration(other) ⇒ Object
-
#initialize ⇒ GitConfiguration
constructor
A new instance of GitConfiguration.
- #name ⇒ Object
- #track_branch ⇒ Object
- #track_remote ⇒ Object
- #vcs(mod) ⇒ Object
Methods inherited from BaseConfiguration
Constructor Details
#initialize ⇒ GitConfiguration
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
#remote ⇒ Object
Returns the value of attribute remote.
92 93 94 |
# File 'lib/build-tool/vcs/git.rb', line 92 def remote @remote end |
#track ⇒ Object
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 |
#name ⇒ Object
88 89 90 |
# File 'lib/build-tool/vcs/git.rb', line 88 def name "git" end |
#track_branch ⇒ Object
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_remote ⇒ Object
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 |