junction 0.1.8 → 0.1.9
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 +4 -4
- data/Gemfile.lock +1 -1
- data/bin/junction:start +1 -1
- data/lib/junction/screen_manager.rb +19 -2
- data/lib/junction/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d3f893c83739980c5650146e4ba8e278837bc3be8f6696fe88d0ee76f31dbb9
|
4
|
+
data.tar.gz: 1ad0d6e85048eb3d207271c947d23cc32be8bab2c909088b9c9b6814c269eb2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1994da8b75888e6dc13d43f0510f31bdfc2f0b72e2d29ef05b46219d945548376ddf5631997fa75e8a7cb896f5d46737dbf97a0ebbac8527cc61be378617804
|
7
|
+
data.tar.gz: f572d93c1a9a51ef22a069bad637fa7c41c56603f58fb974668c0c8d125cd69733c0372c35ba71be8d3dac55480f92de66cb589d21b9ecf5332d05b6702ee653
|
data/Gemfile.lock
CHANGED
data/bin/junction:start
CHANGED
@@ -1,13 +1,30 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'singleton'
|
2
3
|
|
3
4
|
module Junction
|
4
5
|
class ScreenManager
|
6
|
+
include Singleton
|
7
|
+
|
5
8
|
def initialize
|
6
|
-
@
|
9
|
+
@menu_screen = Junction::Screens::MenuScreen.new
|
10
|
+
@running = true
|
7
11
|
end
|
8
12
|
|
9
13
|
def start
|
10
|
-
|
14
|
+
# Trap Ctrl+C (SIGINT) to exit gracefully
|
15
|
+
trap("SIGINT") do
|
16
|
+
puts "\nExiting gracefully... Goodbye!"
|
17
|
+
@running = false
|
18
|
+
end
|
19
|
+
|
20
|
+
while @running
|
21
|
+
begin
|
22
|
+
@menu_screen.render
|
23
|
+
rescue Interrupt
|
24
|
+
# Handle any mid-operation interruption if necessary
|
25
|
+
puts "\nInterrupted! Returning to the menu."
|
26
|
+
end
|
27
|
+
end
|
11
28
|
end
|
12
29
|
end
|
13
30
|
end
|
data/lib/junction/version.rb
CHANGED