Skip to content

Commit f08a31a

Browse files
committed
Refactor Ruby starter templates: replace server.rb with inline server code in main.rb and update logging method. Added TODO for server implementation.
1 parent b83b77d commit f08a31a

File tree

8 files changed

+28
-47
lines changed

8 files changed

+28
-47
lines changed

compiled_starters/ruby/app/main.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
require "socket"
2+
13
# You can use print statements as follows for debugging, they'll be visible when running tests.
2-
$stderr.puts "Logs from your program will appear here!"
4+
print("Logs from your program will appear here!")
35

4-
# Uncomment this block to pass the first stage
5-
# puts "Implement code here!"
6+
# TODO: Uncomment the code below to pass the first stage
7+
#
8+
# server = TCPServer.new("localhost", 4221)
9+
# client_socket, client_address = server.accept

compiled_starters/ruby/app/server.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
# Uncomment this block to pass the first stage
2-
# puts "Implement code here!"
1+
require "socket"
2+
3+
server = TCPServer.new("localhost", 4221)
4+
client_socket, client_address = server.accept

solutions/ruby/01-at4/code/app/server.rb

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
@@ -1,5 +1,2 @@
1+
@@ -1,9 +1,4 @@
2+
require "socket"
3+
24
-# You can use print statements as follows for debugging, they'll be visible when running tests.
3-
-$stderr.puts "Logs from your program will appear here!"
5+
-print("Logs from your program will appear here!")
46
-
5-
# Uncomment this block to pass the first stage
6-
# puts "Implement code here!"
7-
\ No newline at end of file
7+
-# TODO: Uncomment the code below to pass the first stage
8+
-#
9+
-# server = TCPServer.new("localhost", 4221)
10+
-# client_socket, client_address = server.accept
11+
+server = TCPServer.new("localhost", 4221)
12+
+client_socket, client_address = server.accept

solutions/ruby/01-at4/diff/app/server.rb.diff

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
require "socket"
2+
13
# You can use print statements as follows for debugging, they'll be visible when running tests.
2-
$stderr.puts "Logs from your program will appear here!"
4+
print("Logs from your program will appear here!")
35

4-
# Uncomment this block to pass the first stage
5-
# puts "Implement code here!"
6+
# TODO: Uncomment the code below to pass the first stage
7+
#
8+
# server = TCPServer.new("localhost", 4221)
9+
# client_socket, client_address = server.accept

starter_templates/ruby/code/app/server.rb

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)