Sha256: 4283d3afb3a1b27389133d812d1a0fa279c5ff02dca9505f21f811ae7d89edae

Contents?: true

Size: 497 Bytes

Versions: 5

Compression:

Stored size: 497 Bytes

Contents

# lib/rails_tmux/pane_manager.rb
module Junction
  class PaneManager
    def initialize
      @panes = {}
    end

    def create_pane(name, command = "bash")
      @panes[name] = Session.new(name, command)
    end

    def list_panes
      @panes.keys
    end

    def write_to_pane(name, input)
      @panes[name]&.write(input)
    end

    def read_from_pane(name)
      @panes[name]&.read
    end

    def close_pane(name)
      @panes[name]&.close
      @panes.delete(name)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
junction-0.1.5 lib/junction/pane_manager.rb
junction-0.1.4 lib/junction/pane_manager.rb
junction-0.1.3 lib/junction/pane_manager.rb
junction-0.1.2 lib/junction/pane_manager.rb
junction-0.1.1 lib/junction/pane_manager.rb