Class: Worktree::Launcher
- Inherits:
-
Object
- Object
- Worktree::Launcher
- Defined in:
- lib/worktree/launcher.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(project_dir:, branch:, extra_vars: {}) ⇒ Launcher
constructor
A new instance of Launcher.
- #launch! ⇒ Object
Constructor Details
#initialize(project_dir:, branch:, extra_vars: {}) ⇒ Launcher
Returns a new instance of Launcher.
5 6 7 8 9 10 |
# File 'lib/worktree/launcher.rb', line 5 def initialize(project_dir:, branch:, extra_vars: {}) @project_dir = project_dir @branch = branch @working_directory = "#{@project_dir}/#{@branch}".chomp('/') @extra_vars = extra_vars.symbolize_keys end |
Instance Method Details
#launch! ⇒ Object
12 13 14 |
# File 'lib/worktree/launcher.rb', line 12 def launch! Dir.chdir(@working_directory) { Kernel.system(command) } end |