junction 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/junction.iml +23 -5
- data/Gemfile +2 -0
- data/Gemfile.lock +52 -1
- data/bin/junction:start +1 -41
- data/junction.gemspec +1 -1
- data/lib/junction/components/cursor.rb +9 -0
- data/lib/junction/screen_manager.rb +15 -0
- data/lib/junction/screens/main.rb +14 -0
- data/lib/junction/version.rb +1 -1
- data/lib/junction.rb +3 -2
- metadata +5 -4
- data/lib/junction/pane_manager.rb +0 -29
- data/lib/junction/session.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8263a6f70eccd0015464e0c15be04badd0a20125644408e357cd03896ef0885e
|
4
|
+
data.tar.gz: 486c902c1e0e885f9458adeed5e5e5b9ce42cae33c215108e1fce8c2dc6a5ffd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02abb0ab8e0496bb2dfa17b0e0d7b7ea6f60eb754225e52ff5ad1f3fe7657868dd4c1bd0afdf36cd0fe7aa53e96b6e9e9f3940a586dd1a73f84a2a3058506f43
|
7
|
+
data.tar.gz: 96f56fa4212b3297b3b3fc711e48077c035539b54c9e3ff48ada46e5e2bdb43b74946f4a961e60c3a4743d0d81c2a43f17f978dbbc931b21efe70600ec5146b8
|
data/.idea/junction.iml
CHANGED
@@ -14,10 +14,13 @@
|
|
14
14
|
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.2.2) [gem]" level="application" />
|
15
15
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.5.23, rbenv: 3.2.2) [gem]" level="application" />
|
16
16
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.5.1, rbenv: 3.2.2) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="equatable (v0.5.0, rbenv: 3.2.2) [gem]" level="application" />
|
17
18
|
<orderEntry type="library" scope="PROVIDED" name="json (v2.7.2, rbenv: 3.2.2) [gem]" level="application" />
|
18
19
|
<orderEntry type="library" scope="PROVIDED" name="language_server-protocol (v3.17.0.3, rbenv: 3.2.2) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="necromancer (v0.3.0, rbenv: 3.2.2) [gem]" level="application" />
|
19
21
|
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.26.3, rbenv: 3.2.2) [gem]" level="application" />
|
20
22
|
<orderEntry type="library" scope="PROVIDED" name="parser (v3.3.4.2, rbenv: 3.2.2) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="pastel (v0.6.1, rbenv: 3.2.2) [gem]" level="application" />
|
21
24
|
<orderEntry type="library" scope="PROVIDED" name="racc (v1.8.1, rbenv: 3.2.2) [gem]" level="application" />
|
22
25
|
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, rbenv: 3.2.2) [gem]" level="application" />
|
23
26
|
<orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, rbenv: 3.2.2) [gem]" level="application" />
|
@@ -32,27 +35,42 @@
|
|
32
35
|
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.32.1, rbenv: 3.2.2) [gem]" level="application" />
|
33
36
|
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.13.0, rbenv: 3.2.2) [gem]" level="application" />
|
34
37
|
<orderEntry type="library" scope="PROVIDED" name="strscan (v3.1.0, rbenv: 3.2.2) [gem]" level="application" />
|
38
|
+
<orderEntry type="library" scope="PROVIDED" name="tty (v0.5.0, rbenv: 3.2.2) [gem]" level="application" />
|
39
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-color (v0.3.0, rbenv: 3.2.2) [gem]" level="application" />
|
40
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-command (v0.1.0, rbenv: 3.2.2) [gem]" level="application" />
|
41
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-cursor (v0.3.0, rbenv: 3.2.2) [gem]" level="application" />
|
42
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-pager (v0.4.0, rbenv: 3.2.2) [gem]" level="application" />
|
43
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-platform (v0.1.0, rbenv: 3.2.2) [gem]" level="application" />
|
44
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-progressbar (v0.9.0, rbenv: 3.2.2) [gem]" level="application" />
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-prompt (v0.6.0, rbenv: 3.2.2) [gem]" level="application" />
|
46
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-screen (v0.5.1, rbenv: 3.2.2) [gem]" level="application" />
|
47
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-spinner (v0.2.0, rbenv: 3.2.2) [gem]" level="application" />
|
48
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-table (v0.5.0, rbenv: 3.2.2) [gem]" level="application" />
|
49
|
+
<orderEntry type="library" scope="PROVIDED" name="tty-which (v0.1.0, rbenv: 3.2.2) [gem]" level="application" />
|
35
50
|
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.5.0, rbenv: 3.2.2) [gem]" level="application" />
|
51
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode_utils (v1.4.0, rbenv: 3.2.2) [gem]" level="application" />
|
52
|
+
<orderEntry type="library" scope="PROVIDED" name="verse (v0.4.0, rbenv: 3.2.2) [gem]" level="application" />
|
53
|
+
<orderEntry type="library" scope="PROVIDED" name="wisper (v1.6.1, rbenv: 3.2.2) [gem]" level="application" />
|
36
54
|
</component>
|
37
55
|
<component name="RakeTasksCache-v2">
|
38
56
|
<option name="myRootTask">
|
39
57
|
<RakeTaskImpl id="rake">
|
40
58
|
<subtasks>
|
41
|
-
<RakeTaskImpl description="Build junction-0.1.
|
59
|
+
<RakeTaskImpl description="Build junction-0.1.5.gem into the pkg directory" fullCommand="build" id="build" />
|
42
60
|
<RakeTaskImpl id="build">
|
43
61
|
<subtasks>
|
44
|
-
<RakeTaskImpl description="Generate SHA512 checksum of junction-0.1.
|
62
|
+
<RakeTaskImpl description="Generate SHA512 checksum of junction-0.1.5.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
|
45
63
|
</subtasks>
|
46
64
|
</RakeTaskImpl>
|
47
65
|
<RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
|
48
66
|
<RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
|
49
|
-
<RakeTaskImpl description="Build and install junction-0.1.
|
67
|
+
<RakeTaskImpl description="Build and install junction-0.1.5.gem into system gems" fullCommand="install" id="install" />
|
50
68
|
<RakeTaskImpl id="install">
|
51
69
|
<subtasks>
|
52
|
-
<RakeTaskImpl description="Build and install junction-0.1.
|
70
|
+
<RakeTaskImpl description="Build and install junction-0.1.5.gem into system gems without network access" fullCommand="install:local" id="local" />
|
53
71
|
</subtasks>
|
54
72
|
</RakeTaskImpl>
|
55
|
-
<RakeTaskImpl description="Create tag v0.1.
|
73
|
+
<RakeTaskImpl description="Create tag v0.1.5 and build and push junction-0.1.5.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
|
56
74
|
<RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
|
57
75
|
<RakeTaskImpl id="rubocop">
|
58
76
|
<subtasks>
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,19 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
junction (0.1.
|
4
|
+
junction (0.1.6)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.2)
|
10
10
|
diff-lcs (1.5.1)
|
11
|
+
equatable (0.5.0)
|
11
12
|
json (2.7.2)
|
12
13
|
language_server-protocol (3.17.0.3)
|
14
|
+
necromancer (0.3.0)
|
13
15
|
parallel (1.26.3)
|
14
16
|
parser (3.3.4.2)
|
15
17
|
ast (~> 2.4.1)
|
16
18
|
racc
|
19
|
+
pastel (0.6.1)
|
20
|
+
equatable (~> 0.5.0)
|
21
|
+
tty-color (~> 0.3.0)
|
17
22
|
racc (1.8.1)
|
18
23
|
rainbow (3.1.1)
|
19
24
|
rake (13.2.1)
|
@@ -48,7 +53,52 @@ GEM
|
|
48
53
|
parser (>= 3.3.1.0)
|
49
54
|
ruby-progressbar (1.13.0)
|
50
55
|
strscan (3.1.0)
|
56
|
+
tty (0.5.0)
|
57
|
+
equatable (~> 0.5.0)
|
58
|
+
pastel (~> 0.6.0)
|
59
|
+
tty-color (~> 0.3.0)
|
60
|
+
tty-command (~> 0.1.0)
|
61
|
+
tty-cursor (~> 0.3.0)
|
62
|
+
tty-pager (~> 0.4.0)
|
63
|
+
tty-platform (~> 0.1.0)
|
64
|
+
tty-progressbar (~> 0.9.0)
|
65
|
+
tty-prompt (~> 0.6.0)
|
66
|
+
tty-screen (~> 0.5.0)
|
67
|
+
tty-spinner (~> 0.2.0)
|
68
|
+
tty-table (~> 0.5.0)
|
69
|
+
tty-which (~> 0.1.0)
|
70
|
+
tty-color (0.3.0)
|
71
|
+
tty-command (0.1.0)
|
72
|
+
pastel (~> 0.6.0)
|
73
|
+
tty-cursor (0.3.0)
|
74
|
+
tty-pager (0.4.0)
|
75
|
+
tty-screen (~> 0.5.0)
|
76
|
+
tty-which (~> 0.1.0)
|
77
|
+
verse (~> 0.4.0)
|
78
|
+
tty-platform (0.1.0)
|
79
|
+
tty-progressbar (0.9.0)
|
80
|
+
tty-screen (~> 0.5.0)
|
81
|
+
tty-prompt (0.6.0)
|
82
|
+
necromancer (~> 0.3.0)
|
83
|
+
pastel (~> 0.6.0)
|
84
|
+
tty-cursor (~> 0.3.0)
|
85
|
+
tty-platform (~> 0.1.0)
|
86
|
+
wisper (~> 1.6.1)
|
87
|
+
tty-screen (0.5.1)
|
88
|
+
tty-spinner (0.2.0)
|
89
|
+
tty-table (0.5.0)
|
90
|
+
equatable (~> 0.5.0)
|
91
|
+
necromancer (~> 0.3.0)
|
92
|
+
pastel (~> 0.6.0)
|
93
|
+
tty-screen (~> 0.5.0)
|
94
|
+
unicode_utils (~> 1.4.0)
|
95
|
+
verse (~> 0.4.0)
|
96
|
+
tty-which (0.1.0)
|
51
97
|
unicode-display_width (2.5.0)
|
98
|
+
unicode_utils (1.4.0)
|
99
|
+
verse (0.4.0)
|
100
|
+
unicode_utils (~> 1.4.0)
|
101
|
+
wisper (1.6.1)
|
52
102
|
|
53
103
|
PLATFORMS
|
54
104
|
arm64-darwin-23
|
@@ -58,6 +108,7 @@ DEPENDENCIES
|
|
58
108
|
rake (~> 13.0)
|
59
109
|
rspec (~> 3.0)
|
60
110
|
rubocop (~> 1.21)
|
111
|
+
tty (~> 0.5.0)
|
61
112
|
|
62
113
|
BUNDLED WITH
|
63
114
|
2.5.23
|
data/bin/junction:start
CHANGED
@@ -3,44 +3,4 @@
|
|
3
3
|
|
4
4
|
require 'junction'
|
5
5
|
|
6
|
-
|
7
|
-
manager = Junction::PaneManager.new
|
8
|
-
|
9
|
-
puts 'Welcome to RailsTmux for Rails!'
|
10
|
-
loop do
|
11
|
-
puts "\n1. Create Pane\n2. List Panes\n3. Write to Pane\n4. Read from Pane\n5. Close Pane\n6. Exit"
|
12
|
-
print 'Select an option: '
|
13
|
-
choice = gets.chomp.to_i
|
14
|
-
|
15
|
-
case choice
|
16
|
-
when 1
|
17
|
-
print 'Enter pane name: '
|
18
|
-
name = gets.chomp
|
19
|
-
print 'Enter command (or press Enter for default bash): '
|
20
|
-
command = gets.chomp
|
21
|
-
manager.create_pane(name, command.empty? ? 'bash' : command)
|
22
|
-
puts "Pane #{name} created."
|
23
|
-
when 2
|
24
|
-
puts "Panes: #{manager.list_panes.join(", ")}"
|
25
|
-
when 3
|
26
|
-
print 'Enter pane name: '
|
27
|
-
name = gets.chomp
|
28
|
-
print 'Enter input: '
|
29
|
-
input = gets.chomp
|
30
|
-
manager.write_to_pane(name, input)
|
31
|
-
when 4
|
32
|
-
print 'Enter pane name: '
|
33
|
-
name = gets.chomp
|
34
|
-
puts "Output: #{manager.read_from_pane(name)}"
|
35
|
-
when 5
|
36
|
-
print 'Enter pane name: '
|
37
|
-
name = gets.chomp
|
38
|
-
manager.close_pane(name)
|
39
|
-
puts "Pane #{name} closed."
|
40
|
-
when 6
|
41
|
-
puts 'Exiting...'
|
42
|
-
break
|
43
|
-
else
|
44
|
-
puts 'Invalid option.'
|
45
|
-
end
|
46
|
-
end
|
6
|
+
Junction::ScreenManager.new.start
|
data/junction.gemspec
CHANGED
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
34
34
|
|
35
35
|
# Uncomment to register a new dependency of your gem
|
36
36
|
# spec.add_dependency "example-gem", "~> 1.0"
|
37
|
-
|
37
|
+
# spec.add_dependency 'stringio', '>= 3.0.0'
|
38
38
|
# For more information and examples about making a new gem, check out our
|
39
39
|
# guide at: https://bundler.io/guides/creating_gem.html
|
40
40
|
end
|
data/lib/junction/version.rb
CHANGED
data/lib/junction.rb
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'junction/version'
|
4
|
-
require_relative 'junction/
|
5
|
-
require_relative 'junction/
|
4
|
+
require_relative 'junction/screen_manager'
|
5
|
+
require_relative 'junction/components/cursor'
|
6
|
+
require_relative 'junction/screens/main'
|
6
7
|
|
7
8
|
module Junction
|
8
9
|
class Error < StandardError; end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: junction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- keegankb93
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Placeholder
|
14
14
|
email:
|
@@ -34,8 +34,9 @@ files:
|
|
34
34
|
- bin/junction:start
|
35
35
|
- junction.gemspec
|
36
36
|
- lib/junction.rb
|
37
|
-
- lib/junction/
|
38
|
-
- lib/junction/
|
37
|
+
- lib/junction/components/cursor.rb
|
38
|
+
- lib/junction/screen_manager.rb
|
39
|
+
- lib/junction/screens/main.rb
|
39
40
|
- lib/junction/version.rb
|
40
41
|
- lib/tasks/junction.rake
|
41
42
|
- sig/junction.rbs
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# lib/rails_tmux/pane_manager.rb
|
2
|
-
module Junction
|
3
|
-
class PaneManager
|
4
|
-
def initialize
|
5
|
-
@panes = {}
|
6
|
-
end
|
7
|
-
|
8
|
-
def create_pane(name, command = "bash")
|
9
|
-
@panes[name] = Session.new(name, command)
|
10
|
-
end
|
11
|
-
|
12
|
-
def list_panes
|
13
|
-
@panes.keys
|
14
|
-
end
|
15
|
-
|
16
|
-
def write_to_pane(name, input)
|
17
|
-
@panes[name]&.write(input)
|
18
|
-
end
|
19
|
-
|
20
|
-
def read_from_pane(name)
|
21
|
-
@panes[name]&.read
|
22
|
-
end
|
23
|
-
|
24
|
-
def close_pane(name)
|
25
|
-
@panes[name]&.close
|
26
|
-
@panes.delete(name)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/lib/junction/session.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'pty'
|
4
|
-
|
5
|
-
module Junction
|
6
|
-
class Session
|
7
|
-
attr_reader :name, :pid, :output
|
8
|
-
|
9
|
-
def initialize(name, command = 'bash')
|
10
|
-
@name = name
|
11
|
-
@command = command
|
12
|
-
@output, @input, @pid = PTY.spawn(command)
|
13
|
-
end
|
14
|
-
|
15
|
-
def write(input)
|
16
|
-
@input.puts(input)
|
17
|
-
end
|
18
|
-
|
19
|
-
def read
|
20
|
-
@output.read_nonblock(1024)
|
21
|
-
rescue IO::WaitReadable
|
22
|
-
''
|
23
|
-
end
|
24
|
-
|
25
|
-
def close
|
26
|
-
Process.kill('KILL', @pid)
|
27
|
-
rescue Errno::ESRCH
|
28
|
-
# Process already exited
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|