Class: GitRunner::Branch
- Inherits:
-
Object
- Object
- GitRunner::Branch
- Defined in:
- lib/git-runner/branch.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#repository_path ⇒ Object
Returns the value of attribute repository_path.
Instance Method Summary collapse
-
#initialize(repository_path, name) ⇒ Branch
constructor
A new instance of Branch.
- #instructions ⇒ Object
- #repository_name ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(repository_path, name) ⇒ Branch
Returns a new instance of Branch.
6 7 8 9 |
# File 'lib/git-runner/branch.rb', line 6 def initialize(repository_path, name) self.repository_path = repository_path self.name = name end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/git-runner/branch.rb', line 3 def name @name end |
#repository_path ⇒ Object
Returns the value of attribute repository_path.
3 4 5 |
# File 'lib/git-runner/branch.rb', line 3 def repository_path @repository_path end |
Instance Method Details
#instructions ⇒ Object
17 18 19 |
# File 'lib/git-runner/branch.rb', line 17 def instructions @instructions ||= extract_instructions end |
#repository_name ⇒ Object
21 22 23 |
# File 'lib/git-runner/branch.rb', line 21 def repository_name repository_path.split(File::SEPARATOR).last.gsub('.git', '') end |
#run ⇒ Object
11 12 13 14 15 |
# File 'lib/git-runner/branch.rb', line 11 def run instructions.each do |instruction| instruction.run end end |