junction 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d748323010afcccefd3808b3cf754542ca766638b48d4ade2210f11366f3442b
4
- data.tar.gz: b0df4805d0ee5dffd3509b7a2eac0004eabcc3dcb8067f25445c74a46bf6b0d9
3
+ metadata.gz: 8263a6f70eccd0015464e0c15be04badd0a20125644408e357cd03896ef0885e
4
+ data.tar.gz: 486c902c1e0e885f9458adeed5e5e5b9ce42cae33c215108e1fce8c2dc6a5ffd
5
5
  SHA512:
6
- metadata.gz: 9c9860c72a22663852ad31913c5cc70213e63e9015eea852efcf3999f103820dcd3d067bda549e01e45c4c3b395816feaa22786f08a55c34e528d755dcab0fd0
7
- data.tar.gz: b90d7cb2085a7db0b26bb83b4b6263254f0bafcdeb0f8866ab089f5b6f6f6b0eb737431f50f403b61cfc2efeefcdfca7ec4e4b3ebf485c1bae382736fdb9f68e
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" />
@@ -31,9 +34,23 @@
31
34
  <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.65.1, rbenv: 3.2.2) [gem]" level="application" />
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
- <orderEntry type="library" scope="PROVIDED" name="stringio (v3.1.2, rbenv: 3.2.2) [gem]" level="application" />
35
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" />
36
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" />
37
54
  </component>
38
55
  <component name="RakeTasksCache-v2">
39
56
  <option name="myRootTask">
data/Gemfile CHANGED
@@ -10,3 +10,5 @@ gem 'rake', '~> 13.0'
10
10
  gem 'rspec', '~> 3.0'
11
11
 
12
12
  gem 'rubocop', '~> 1.21'
13
+
14
+ gem "tty", "~> 0.5.0"
data/Gemfile.lock CHANGED
@@ -1,20 +1,24 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junction (0.1.5)
5
- stringio (>= 3.0.0)
4
+ junction (0.1.6)
6
5
 
7
6
  GEM
8
7
  remote: https://rubygems.org/
9
8
  specs:
10
9
  ast (2.4.2)
11
10
  diff-lcs (1.5.1)
11
+ equatable (0.5.0)
12
12
  json (2.7.2)
13
13
  language_server-protocol (3.17.0.3)
14
+ necromancer (0.3.0)
14
15
  parallel (1.26.3)
15
16
  parser (3.3.4.2)
16
17
  ast (~> 2.4.1)
17
18
  racc
19
+ pastel (0.6.1)
20
+ equatable (~> 0.5.0)
21
+ tty-color (~> 0.3.0)
18
22
  racc (1.8.1)
19
23
  rainbow (3.1.1)
20
24
  rake (13.2.1)
@@ -48,9 +52,53 @@ GEM
48
52
  rubocop-ast (1.32.1)
49
53
  parser (>= 3.3.1.0)
50
54
  ruby-progressbar (1.13.0)
51
- stringio (3.1.2)
52
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)
53
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)
54
102
 
55
103
  PLATFORMS
56
104
  arm64-darwin-23
@@ -60,6 +108,7 @@ DEPENDENCIES
60
108
  rake (~> 13.0)
61
109
  rspec (~> 3.0)
62
110
  rubocop (~> 1.21)
111
+ tty (~> 0.5.0)
63
112
 
64
113
  BUNDLED WITH
65
114
  2.5.23
data/bin/junction:start CHANGED
@@ -3,44 +3,4 @@
3
3
 
4
4
  require 'junction'
5
5
 
6
- # CLI Implementation
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
- spec.add_dependency 'stringio', '>= 3.0.0'
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
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tty-cursor'
4
+
5
+ module Junction
6
+ module Components
7
+ class Cursor; end
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Junction
4
+ class ScreenManager
5
+ def initialize
6
+ @screen = Junction::Screens::Main.new
7
+ end
8
+
9
+ def start
10
+ loop do
11
+ @screen.render
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tty-screen'
4
+
5
+ module Junction
6
+ module Screens
7
+ class Main
8
+ def render
9
+ puts 'Welcome to Junction!'
10
+ puts "Screen size: #{TTY::Screen.width}x#{TTY::Screen.height}"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Junction
4
- VERSION = '0.1.5'
4
+ VERSION = '0.1.6'
5
5
  end
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/pane_manager'
5
- require_relative 'junction/session'
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,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junction
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
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-19 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: stringio
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 3.0.0
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: 3.0.0
11
+ date: 2024-11-20 00:00:00.000000000 Z
12
+ dependencies: []
27
13
  description: Placeholder
28
14
  email:
29
15
  - keegankb@gmail.com
@@ -48,8 +34,9 @@ files:
48
34
  - bin/junction:start
49
35
  - junction.gemspec
50
36
  - lib/junction.rb
51
- - lib/junction/pane_manager.rb
52
- - lib/junction/session.rb
37
+ - lib/junction/components/cursor.rb
38
+ - lib/junction/screen_manager.rb
39
+ - lib/junction/screens/main.rb
53
40
  - lib/junction/version.rb
54
41
  - lib/tasks/junction.rake
55
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
@@ -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