Module: TopLevelExtensions

Defined in:
lib/paned_repl/top_level_extensions.rb

Instance Method Summary collapse

Instance Method Details

#exit_tmux(pane_count = 0) ⇒ Object



6
7
8
9
# File 'lib/paned_repl/top_level_extensions.rb', line 6

def exit_tmux(pane_count=0)
  pane_count.times { base.kill_pane(0) }
  `pkill tmux`
end

#to_shell_command(ruby_string) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/paned_repl/top_level_extensions.rb', line 11

def to_shell_command(ruby_string)
  if ["\"", "\'"].any? &cmd_fragment.method(:include?)
    raise ArgumentError, "fragment cant have quotes"
  end
  "  ruby -e '\#{cmd_fragment}'\n  SH\nend\n"