junction 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a19c0f6c7e343e6f694f8d996d308f7b43b61a56085ac082c7f9bf5db32fdcd
4
- data.tar.gz: d3bba49a9b7ad4c1967152601dfe8d3a433e5ff18fa72de915991c7e870ce9c8
3
+ metadata.gz: 2d3f893c83739980c5650146e4ba8e278837bc3be8f6696fe88d0ee76f31dbb9
4
+ data.tar.gz: 1ad0d6e85048eb3d207271c947d23cc32be8bab2c909088b9c9b6814c269eb2a
5
5
  SHA512:
6
- metadata.gz: 5ec3362a0a493ffa552e0315519a7e9ebb7baa38175faf1dc8af1b4e173ac37d39ca899cd20073c641c69825f52c464b7b294e99a5e15c7312a4bd7bf0aa4ea6
7
- data.tar.gz: 186ccf83d30faf8eb0d78a0786edb73a91069781cd02b098d4103a95a00cf2059b9e6eb8a6c0823ab9a403c92f1ee293e46743e16b95458720a8481f8b049189
6
+ metadata.gz: f1994da8b75888e6dc13d43f0510f31bdfc2f0b72e2d29ef05b46219d945548376ddf5631997fa75e8a7cb896f5d46737dbf97a0ebbac8527cc61be378617804
7
+ data.tar.gz: f572d93c1a9a51ef22a069bad637fa7c41c56603f58fb974668c0c8d125cd69733c0372c35ba71be8d3dac55480f92de66cb589d21b9ecf5332d05b6702ee653
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junction (0.1.8)
4
+ junction (0.1.9)
5
5
  tty (~> 0.5.0)
6
6
 
7
7
  GEM
data/bin/junction:start CHANGED
@@ -3,4 +3,4 @@
3
3
 
4
4
  require 'junction'
5
5
 
6
- Junction::ScreenManager.new.start
6
+ Junction::ScreenManager.instance.start
@@ -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
- @screen = Junction::Screens::Main.new
9
+ @menu_screen = Junction::Screens::MenuScreen.new
10
+ @running = true
7
11
  end
8
12
 
9
13
  def start
10
- @screen.render
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Junction
4
- VERSION = '0.1.8'
4
+ VERSION = '0.1.9'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junction
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - keegankb93