Class: PanedRepl::Repls::BaseRepl

Inherits:
Object
  • Object
show all
Includes:
AutoInitializer, Tmux
Defined in:
lib/paned_repl/repls/base_repl.rb

Constant Summary collapse

Sessions =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Tmux

#attach, #create_session, #even_horizontal, #even_vertical, #kill_pane, #select_pane, #send_keys, #setup_tmux, #split_horizontal, #split_vertical, #swap_pane, #tiled

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/paned_repl/repls/base_repl.rb', line 11

def name
  @name
end

#paneObject (readonly)

Returns the value of attribute pane.



11
12
13
# File 'lib/paned_repl/repls/base_repl.rb', line 11

def pane
  @pane
end

Class Method Details

.start(name, &blk) ⇒ Object



3
4
5
# File 'lib/paned_repl/repls/base_repl.rb', line 3

def self.start(name, &blk)
  new(name: name).start(&blk)
end

Instance Method Details

#start(&blk) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/paned_repl/repls/base_repl.rb', line 15

def start(&blk)
  setup_tmux
  Object.include TopLevelExtensions
  Sessions[name] = self
  Thread.new(&blk) if blk
  PanedRepl.class_exec { Pry.start }
end