Sha256: 500f513b5f997c621476cbba40085f80b663367f67c955ac6979aeb4788e93f4
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 KB
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'junction' # CLI Implementation manager = Junction::PaneManager.new puts 'Welcome to RailsTmux for Rails!' loop do puts "\n1. Create Pane\n2. List Panes\n3. Write to Pane\n4. Read from Pane\n5. Close Pane\n6. Exit" print 'Select an option: ' choice = gets.chomp.to_i case choice when 1 print 'Enter pane name: ' name = gets.chomp print 'Enter command (or press Enter for default bash): ' command = gets.chomp manager.create_pane(name, command.empty? ? 'bash' : command) puts "Pane #{name} created." when 2 puts "Panes: #{manager.list_panes.join(", ")}" when 3 print 'Enter pane name: ' name = gets.chomp print 'Enter input: ' input = gets.chomp manager.write_to_pane(name, input) when 4 print 'Enter pane name: ' name = gets.chomp puts "Output: #{manager.read_from_pane(name)}" when 5 print 'Enter pane name: ' name = gets.chomp manager.close_pane(name) puts "Pane #{name} closed." when 6 puts 'Exiting...' break else puts 'Invalid option.' end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
junction-0.1.5 | bin/junction:start |
junction-0.1.4 | bin/junction:start |
junction-0.1.3 | bin/junction |
junction-0.1.2 | bin/junction |
junction-0.1.1 | junction |