Class: Ace::Overseer::Molecules::TmuxWindowOpener

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/overseer/molecules/tmux_window_opener.rb

Instance Method Summary collapse

Constructor Details

#initialize(tmux_window_command: nil, tmux_executor: nil) ⇒ TmuxWindowOpener

Returns a new instance of TmuxWindowOpener.



7
8
9
10
# File 'lib/ace/overseer/molecules/tmux_window_opener.rb', line 7

def initialize(tmux_window_command: nil, tmux_executor: nil)
  @tmux_window_command = tmux_window_command || Ace::Tmux::CLI::Commands::Window.new
  @tmux_executor = tmux_executor || Ace::Tmux::Molecules::TmuxExecutor.new
end

Instance Method Details

#open(worktree_path:, preset: nil) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ace/overseer/molecules/tmux_window_opener.rb', line 12

def open(worktree_path:, preset: nil)
  ensure_session_exists
  return if window_already_open?(worktree_path)

  @tmux_window_command.call(
    root: worktree_path.to_s,
    preset: preset,
    quiet: true,
    session: ENV["ACE_TMUX_SESSION"]
  )
end