junction 0.1.8 → 0.1.10

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: d4604334bafd276ba847ab802e9309131cd0959e58a4716cf57a9aed021f5caf
4
+ data.tar.gz: dc9a7a2e1ab8ac7d52820516bac641c7c893166323a24449321dc75d46a33abd
5
5
  SHA512:
6
- metadata.gz: 5ec3362a0a493ffa552e0315519a7e9ebb7baa38175faf1dc8af1b4e173ac37d39ca899cd20073c641c69825f52c464b7b294e99a5e15c7312a4bd7bf0aa4ea6
7
- data.tar.gz: 186ccf83d30faf8eb0d78a0786edb73a91069781cd02b098d4103a95a00cf2059b9e6eb8a6c0823ab9a403c92f1ee293e46743e16b95458720a8481f8b049189
6
+ metadata.gz: 07f9e29c966fcbb01207f42206a7d1a28ce68460f3ef46f4307c18d4eab98606624a71aff90681f1368e5af7d4aece48cf401e1b10e8ca251d6a1c222d9626fa
7
+ data.tar.gz: 34c21247013ca1f7ed26bc036af4a454f2633cbb38dc2913e25b43fbb2c59d96db7eb59d5cd7961c63f246b993747fb778bbcb1a1d2ba9572c5d7704005cf383
data/.idea/junction.iml CHANGED
@@ -51,26 +51,28 @@
51
51
  <orderEntry type="library" scope="PROVIDED" name="unicode_utils (v1.4.0, rbenv: 3.2.2) [gem]" level="application" />
52
52
  <orderEntry type="library" scope="PROVIDED" name="verse (v0.4.0, rbenv: 3.2.2) [gem]" level="application" />
53
53
  <orderEntry type="library" scope="PROVIDED" name="wisper (v1.6.1, rbenv: 3.2.2) [gem]" level="application" />
54
+ <orderEntry type="library" scope="PROVIDED" name="yard (v0.9.37, rbenv: 3.2.2) [gem]" level="application" />
55
+ <orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.7.1, rbenv: 3.2.2) [gem]" level="application" />
54
56
  </component>
55
57
  <component name="RakeTasksCache-v2">
56
58
  <option name="myRootTask">
57
59
  <RakeTaskImpl id="rake">
58
60
  <subtasks>
59
- <RakeTaskImpl description="Build junction-0.1.7.gem into the pkg directory" fullCommand="build" id="build" />
61
+ <RakeTaskImpl description="Build junction-0.1.9.gem into the pkg directory" fullCommand="build" id="build" />
60
62
  <RakeTaskImpl id="build">
61
63
  <subtasks>
62
- <RakeTaskImpl description="Generate SHA512 checksum of junction-0.1.7.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
64
+ <RakeTaskImpl description="Generate SHA512 checksum of junction-0.1.9.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
63
65
  </subtasks>
64
66
  </RakeTaskImpl>
65
67
  <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
66
68
  <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
67
- <RakeTaskImpl description="Build and install junction-0.1.7.gem into system gems" fullCommand="install" id="install" />
69
+ <RakeTaskImpl description="Build and install junction-0.1.9.gem into system gems" fullCommand="install" id="install" />
68
70
  <RakeTaskImpl id="install">
69
71
  <subtasks>
70
- <RakeTaskImpl description="Build and install junction-0.1.7.gem into system gems without network access" fullCommand="install:local" id="local" />
72
+ <RakeTaskImpl description="Build and install junction-0.1.9.gem into system gems without network access" fullCommand="install:local" id="local" />
71
73
  </subtasks>
72
74
  </RakeTaskImpl>
73
- <RakeTaskImpl description="Create tag v0.1.7 and build and push junction-0.1.7.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
75
+ <RakeTaskImpl description="Create tag v0.1.9 and build and push junction-0.1.9.gem to https://rubygems.org" fullCommand="release[remote]" id="release[remote]" />
74
76
  <RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
75
77
  <RakeTaskImpl id="rubocop">
76
78
  <subtasks>
data/Gemfile CHANGED
@@ -11,4 +11,8 @@ gem 'rspec', '~> 3.0'
11
11
 
12
12
  gem 'rubocop', '~> 1.21'
13
13
 
14
- gem "tty", "~> 0.5.0"
14
+ gem 'tty', '~> 0.5.0'
15
+
16
+ gem 'zeitwerk', '~> 2.7'
17
+
18
+ gem 'yard', '~> 0.9.37'
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junction (0.1.8)
4
+ junction (0.1.10)
5
5
  tty (~> 0.5.0)
6
+ zeitwerk (~> 2.7)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
@@ -100,6 +101,8 @@ GEM
100
101
  verse (0.4.0)
101
102
  unicode_utils (~> 1.4.0)
102
103
  wisper (1.6.1)
104
+ yard (0.9.37)
105
+ zeitwerk (2.7.1)
103
106
 
104
107
  PLATFORMS
105
108
  arm64-darwin-23
@@ -110,6 +113,8 @@ DEPENDENCIES
110
113
  rspec (~> 3.0)
111
114
  rubocop (~> 1.21)
112
115
  tty (~> 0.5.0)
116
+ yard (~> 0.9.37)
117
+ zeitwerk (~> 2.7)
113
118
 
114
119
  BUNDLED WITH
115
120
  2.5.23
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
data/junction.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  # spec.add_dependency "example-gem", "~> 1.0"
37
37
  # spec.add_dependency 'stringio', '>= 3.0.0'
38
38
  spec.add_dependency 'tty', '~> 0.5.0'
39
+ spec.add_dependency 'zeitwerk', '~> 2.7'
39
40
  # For more information and examples about making a new gem, check out our
40
41
  # guide at: https://bundler.io/guides/creating_gem.html
41
42
  end
@@ -1,7 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
- require 'tty-cursor'
4
-
5
2
  module Junction
6
3
  module Components
7
4
  class Cursor; end
@@ -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,7 +1,4 @@
1
1
  # frozen_string_literal: true
2
-
3
- require 'tty-prompt'
4
-
5
2
  module Junction
6
3
  module Screens
7
4
  class Screen
@@ -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.10'
5
5
  end
data/lib/junction.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'junction/version'
4
- require_relative 'junction/screen_manager'
5
- require_relative 'junction/components/cursor'
6
- require_relative 'junction/screens/main'
3
+ require 'zeitwerk'
4
+ loader = Zeitwerk::Loader.for_gem
5
+ loader.setup
7
6
 
8
7
  module Junction
9
8
  class Error < StandardError; 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.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - keegankb93
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.5.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: zeitwerk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.7'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.7'
27
41
  description: Placeholder
28
42
  email:
29
43
  - keegankb@gmail.com