junction 0.1.7 → 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: 13d8ee6b5809768320ba9f2139be11d09c13ffd32534b9dedcab251ac4c59bf9
4
- data.tar.gz: ce2dfeaa01d58d081d49d807c91a1beaf5c11410662aaeef82da39208dd266ea
3
+ metadata.gz: 2d3f893c83739980c5650146e4ba8e278837bc3be8f6696fe88d0ee76f31dbb9
4
+ data.tar.gz: 1ad0d6e85048eb3d207271c947d23cc32be8bab2c909088b9c9b6814c269eb2a
5
5
  SHA512:
6
- metadata.gz: 2fa03e19b187c6b88cd4df306abd5628ab2cd3a093417bbf2ca40ada52ceefb58bb0d1ec364c741e50a31b45240ff7b26e46c6bedc6e79fe6ddecb4c5d1d7068
7
- data.tar.gz: 240c9f759fd8bb45d740f7b48be334c01d2f9d725bd513814a4fca88fc59916e61283b73261e37448b448414a35ace70ac52225e2c6211964fda3a708a1e6bb9
6
+ metadata.gz: f1994da8b75888e6dc13d43f0510f31bdfc2f0b72e2d29ef05b46219d945548376ddf5631997fa75e8a7cb896f5d46737dbf97a0ebbac8527cc61be378617804
7
+ data.tar.gz: f572d93c1a9a51ef22a069bad637fa7c41c56603f58fb974668c0c8d125cd69733c0372c35ba71be8d3dac55480f92de66cb589d21b9ecf5332d05b6702ee653
data/.idea/junction.iml CHANGED
@@ -11,30 +11,66 @@
11
11
  </content>
12
12
  <orderEntry type="jdk" jdkName="rbenv: 3.2.2" jdkType="RUBY_SDK" />
13
13
  <orderEntry type="sourceFolder" forTests="false" />
14
+ <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.2.2) [gem]" level="application" />
14
15
  <orderEntry type="library" scope="PROVIDED" name="bundler (v2.5.23, rbenv: 3.2.2) [gem]" level="application" />
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" />
18
+ <orderEntry type="library" scope="PROVIDED" name="json (v2.7.2, rbenv: 3.2.2) [gem]" level="application" />
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" />
21
+ <orderEntry type="library" scope="PROVIDED" name="parallel (v1.26.3, rbenv: 3.2.2) [gem]" level="application" />
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" />
15
24
  <orderEntry type="library" scope="PROVIDED" name="racc (v1.8.1, rbenv: 3.2.2) [gem]" level="application" />
25
+ <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.1.1, rbenv: 3.2.2) [gem]" level="application" />
16
26
  <orderEntry type="library" scope="PROVIDED" name="rake (v13.2.1, rbenv: 3.2.2) [gem]" level="application" />
17
27
  <orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.9.2, rbenv: 3.2.2) [gem]" level="application" />
28
+ <orderEntry type="library" scope="PROVIDED" name="rexml (v3.3.6, rbenv: 3.2.2) [gem]" level="application" />
29
+ <orderEntry type="library" scope="PROVIDED" name="rspec (v3.13.0, rbenv: 3.2.2) [gem]" level="application" />
30
+ <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.13.0, rbenv: 3.2.2) [gem]" level="application" />
31
+ <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.13.2, rbenv: 3.2.2) [gem]" level="application" />
32
+ <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.13.1, rbenv: 3.2.2) [gem]" level="application" />
33
+ <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.13.1, rbenv: 3.2.2) [gem]" level="application" />
34
+ <orderEntry type="library" scope="PROVIDED" name="rubocop (v1.65.1, rbenv: 3.2.2) [gem]" level="application" />
35
+ <orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.32.1, rbenv: 3.2.2) [gem]" level="application" />
36
+ <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.13.0, rbenv: 3.2.2) [gem]" level="application" />
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" />
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" />
18
54
  </component>
19
55
  <component name="RakeTasksCache-v2">
20
56
  <option name="myRootTask">
21
57
  <RakeTaskImpl id="rake">
22
58
  <subtasks>
23
- <RakeTaskImpl description="Build junction-0.1.5.gem into the pkg directory" fullCommand="build" id="build" />
59
+ <RakeTaskImpl description="Build junction-0.1.7.gem into the pkg directory" fullCommand="build" id="build" />
24
60
  <RakeTaskImpl id="build">
25
61
  <subtasks>
26
- <RakeTaskImpl description="Generate SHA512 checksum of junction-0.1.5.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
62
+ <RakeTaskImpl description="Generate SHA512 checksum of junction-0.1.7.gem into the checksums directory" fullCommand="build:checksum" id="checksum" />
27
63
  </subtasks>
28
64
  </RakeTaskImpl>
29
65
  <RakeTaskImpl description="Remove any temporary products" fullCommand="clean" id="clean" />
30
66
  <RakeTaskImpl description="Remove any generated files" fullCommand="clobber" id="clobber" />
31
- <RakeTaskImpl description="Build and install junction-0.1.5.gem into system gems" fullCommand="install" id="install" />
67
+ <RakeTaskImpl description="Build and install junction-0.1.7.gem into system gems" fullCommand="install" id="install" />
32
68
  <RakeTaskImpl id="install">
33
69
  <subtasks>
34
- <RakeTaskImpl description="Build and install junction-0.1.5.gem into system gems without network access" fullCommand="install:local" id="local" />
70
+ <RakeTaskImpl description="Build and install junction-0.1.7.gem into system gems without network access" fullCommand="install:local" id="local" />
35
71
  </subtasks>
36
72
  </RakeTaskImpl>
37
- <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]" />
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]" />
38
74
  <RakeTaskImpl description="Run RuboCop" fullCommand="rubocop" id="rubocop" />
39
75
  <RakeTaskImpl id="rubocop">
40
76
  <subtasks>
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junction (0.1.6)
4
+ junction (0.1.9)
5
+ tty (~> 0.5.0)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
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,14 +1,29 @@
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
- loop do
11
- @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
12
27
  end
13
28
  end
14
29
  end
@@ -1,13 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'tty-screen'
4
-
5
3
  module Junction
6
4
  module Screens
7
- class Main
5
+ class Main < Screen
8
6
  def render
9
- puts 'Welcome to Junction!'
10
- puts "Screen size: #{TTY::Screen.width}x#{TTY::Screen.height}"
7
+ prompt.say('Welcome to the Junction CLI!')
8
+ prompt.say('Please select an option:')
9
+ prompt.select('Options:') do |menu|
10
+ menu.choice 'Create a new project', -> { create_project }
11
+ menu.choice 'Exit', -> { exit }
12
+ end
11
13
  end
12
14
  end
13
15
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'tty-prompt'
4
+
5
+ module Junction
6
+ module Screens
7
+ class Screen
8
+ attr_reader :prompt
9
+
10
+ def initialize
11
+ @prompt = TTY::Prompt.new
12
+ end
13
+
14
+ def render
15
+ raise NotImplementedError
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Junction
4
- VERSION = '0.1.7'
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.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - keegankb93
@@ -51,6 +51,7 @@ files:
51
51
  - lib/junction/components/cursor.rb
52
52
  - lib/junction/screen_manager.rb
53
53
  - lib/junction/screens/main.rb
54
+ - lib/junction/screens/screen.rb
54
55
  - lib/junction/version.rb
55
56
  - lib/tasks/junction.rake
56
57
  - sig/junction.rbs