Class: MSPRelease::MakeBranch
- Inherits:
-
Object
- Object
- MSPRelease::MakeBranch
- Includes:
- Exec::Helpers
- Defined in:
- lib/msp_release/make_branch.rb
Defined Under Namespace
Classes: BranchExistsError
Instance Attribute Summary collapse
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(git, branch_name, options = {}) ⇒ MakeBranch
constructor
A new instance of MakeBranch.
- #perform! ⇒ Object
Methods included from Exec::Helpers
Constructor Details
#initialize(git, branch_name, options = {}) ⇒ MakeBranch
Returns a new instance of MakeBranch.
12 13 14 15 16 |
# File 'lib/msp_release/make_branch.rb', line 12 def initialize(git, branch_name, ={}) @git = git @branch_name = branch_name @options = end |
Instance Attribute Details
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
8 9 10 |
# File 'lib/msp_release/make_branch.rb', line 8 def branch_name @branch_name end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
9 10 11 |
# File 'lib/msp_release/make_branch.rb', line 9 def git @git end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/msp_release/make_branch.rb', line 10 def @options end |
Instance Method Details
#perform! ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/msp_release/make_branch.rb', line 18 def perform! if git.branch_exists?(branch_name) raise BranchExistsError, branch_name end git.create_and_switch(branch_name, :start_point => [:start_point]) end |