Class: Worktree::Launcher

Inherits:
Object
  • Object
show all
Defined in:
lib/worktree/launcher.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(project_dir:, branch:) ⇒ Launcher

Returns a new instance of Launcher.



5
6
7
8
9
# File 'lib/worktree/launcher.rb', line 5

def initialize(project_dir:, branch:)
  @project_dir = project_dir
  @branch = branch
  @working_directory = "#{@project_dir}/#{@branch}".chomp('/')
end

Instance Method Details

#launch!Object



11
12
13
# File 'lib/worktree/launcher.rb', line 11

def launch!
  Dir.chdir(@working_directory) { Kernel.system(command) }
end