git_game_show 0.1.3 → 0.1.4
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/lib/git_game_show/cli.rb +70 -50
- data/lib/git_game_show/game_server.rb +1 -1
- data/lib/git_game_show/player_client.rb +192 -191
- data/lib/git_game_show/updater.rb +14 -14
- data/lib/git_game_show/version.rb +1 -1
- data/lib/git_game_show.rb +4 -4
- metadata +2 -2
@@ -13,7 +13,7 @@ module GitGameShow
|
|
13
13
|
latest_version = fetch_latest_version
|
14
14
|
|
15
15
|
return if latest_version.nil?
|
16
|
-
|
16
|
+
|
17
17
|
# Compare versions
|
18
18
|
if newer_version_available?(current_version, latest_version)
|
19
19
|
display_update_prompt(current_version, latest_version)
|
@@ -26,7 +26,7 @@ module GitGameShow
|
|
26
26
|
begin
|
27
27
|
uri = URI.parse("https://rubygems.org/api/v1/gems/git_game_show.json")
|
28
28
|
response = Net::HTTP.get_response(uri)
|
29
|
-
|
29
|
+
|
30
30
|
if response.code == "200"
|
31
31
|
data = JSON.parse(response.body)
|
32
32
|
return data["version"]
|
@@ -57,22 +57,22 @@ module GitGameShow
|
|
57
57
|
|
58
58
|
def display_update_prompt(current_version, latest_version)
|
59
59
|
prompt = TTY::Prompt.new
|
60
|
-
|
60
|
+
|
61
61
|
# Clear the terminal for better visibility
|
62
62
|
puts "\n\n"
|
63
|
-
|
63
|
+
|
64
64
|
puts "┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓".colorize(:cyan)
|
65
|
-
puts "┃ UPDATE AVAILABLE FOR GIT GAME SHOW
|
65
|
+
puts "┃ UPDATE AVAILABLE FOR GIT GAME SHOW ┃".colorize(:cyan)
|
66
66
|
puts "┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫".colorize(:cyan)
|
67
|
-
puts "┃
|
68
|
-
puts "┃ Current version: #{current_version.ljust(
|
69
|
-
puts "┃ Latest version: #{latest_version.ljust(
|
70
|
-
puts "┃
|
67
|
+
puts "┃ ┃".colorize(:cyan)
|
68
|
+
puts "┃ Current version: #{current_version.ljust(44)}┃".colorize(:cyan)
|
69
|
+
puts "┃ Latest version: #{latest_version.ljust(44)}┃".colorize(:cyan)
|
70
|
+
puts "┃ ┃".colorize(:cyan)
|
71
71
|
puts "┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛".colorize(:cyan)
|
72
72
|
puts "\n"
|
73
|
-
|
73
|
+
|
74
74
|
update_now = prompt.yes?("Would you like to update now?")
|
75
|
-
|
75
|
+
|
76
76
|
if update_now
|
77
77
|
perform_update
|
78
78
|
else
|
@@ -83,12 +83,12 @@ module GitGameShow
|
|
83
83
|
|
84
84
|
def perform_update
|
85
85
|
puts "\nUpdating Git Game Show to the latest version...".colorize(:cyan)
|
86
|
-
|
86
|
+
|
87
87
|
begin
|
88
88
|
# Use system to capture both stdout and stderr
|
89
89
|
update_command = "gem update git_game_show"
|
90
90
|
result = system(update_command)
|
91
|
-
|
91
|
+
|
92
92
|
if result
|
93
93
|
puts "\n✅ Update completed successfully!".colorize(:green)
|
94
94
|
puts "Please restart Git Game Show to use the new version.".colorize(:yellow)
|
@@ -104,4 +104,4 @@ module GitGameShow
|
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
107
|
-
end
|
107
|
+
end
|
data/lib/git_game_show.rb
CHANGED
@@ -17,16 +17,16 @@ require 'net/http'
|
|
17
17
|
# Define module and constants first before loading any other files
|
18
18
|
module GitGameShow
|
19
19
|
# VERSION is defined in version.rb
|
20
|
-
|
20
|
+
|
21
21
|
# Default configuration
|
22
22
|
DEFAULT_CONFIG = {
|
23
|
-
|
23
|
+
internal_port: 80,
|
24
24
|
rounds: 3,
|
25
25
|
question_timeout: 30, # seconds
|
26
26
|
question_display_time: 5, # seconds to show results before next question
|
27
27
|
transition_delay: 5 # seconds between rounds
|
28
28
|
}.freeze
|
29
|
-
|
29
|
+
|
30
30
|
# Message types for WebSocket communication
|
31
31
|
module MessageType
|
32
32
|
JOIN_REQUEST = 'join_request'
|
@@ -47,4 +47,4 @@ end
|
|
47
47
|
Dir[File.join(__dir__, 'git_game_show', '*.rb')].sort.each { |file| require file }
|
48
48
|
|
49
49
|
# Load all mini-games
|
50
|
-
Dir[File.join(__dir__, '..', 'mini_games', '*.rb')].sort.each { |file| require file }
|
50
|
+
Dir[File.join(__dir__, '..', 'mini_games', '*.rb')].sort.each { |file| require file }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_game_show
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Paulson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|