Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiled_starters/ruby/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec bundle exec ruby app/server.rb "$@"
exec bundle exec ruby app/main.rb "$@"
6 changes: 3 additions & 3 deletions compiled_starters/ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and more.

# Passing the first stage

The entry point for your HTTP server implementation is in `app/server.rb`. Study
The entry point for your HTTP server implementation is in `app/main.rb`. Study
and uncomment the relevant code, and push your changes to pass the first stage:

```sh
Expand All @@ -30,8 +30,8 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `ruby (3.3)` installed locally
1. Ensure you have `ruby (3.4)` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`app/server.rb`.
`app/main.rb`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
5 changes: 5 additions & 0 deletions compiled_starters/ruby/app/main.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# You can use print statements as follows for debugging, they'll be visible when running tests.
$stderr.puts "Logs from your program will appear here!"

# Uncomment this block to pass the first stage
# puts "Implement code here!"
4 changes: 2 additions & 2 deletions compiled_starters/ruby/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Ruby version used to run your code
# on Codecrafters.
#
# Available versions: ruby-3.3
buildpack: ruby-3.3
# Available versions: ruby-3.4
buildpack: ruby-3.4
2 changes: 1 addition & 1 deletion compiled_starters/ruby/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec bundle exec ruby app/server.rb "$@"
exec bundle exec ruby app/main.rb "$@"
19 changes: 19 additions & 0 deletions dockerfiles/ruby-3.4.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1.7-labs
FROM ruby:3.4-alpine3.23

# Required for installing the json/async gems
RUN apk add --no-cache \
build-base~=0.5 \
libssl3~=3.5 \
readline-dev~=8.3 \
zlib-dev~=1.3

# Re-build if Gemfile or Gemfile.lock changes
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Gemfile,Gemfile.lock"

WORKDIR /app

# .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
COPY --exclude=.git --exclude=README.md . /app

RUN bundle install --verbose
2 changes: 1 addition & 1 deletion solutions/ruby/01-at4/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec bundle exec ruby app/server.rb "$@"
exec bundle exec ruby app/main.rb "$@"
6 changes: 3 additions & 3 deletions solutions/ruby/01-at4/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and more.

# Passing the first stage

The entry point for your HTTP server implementation is in `app/server.rb`. Study
The entry point for your HTTP server implementation is in `app/main.rb`. Study
and uncomment the relevant code, and push your changes to pass the first stage:

```sh
Expand All @@ -30,8 +30,8 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `ruby (3.3)` installed locally
1. Ensure you have `ruby (3.4)` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`app/server.rb`.
`app/main.rb`.
1. Commit your changes and run `git push origin master` to submit your solution
to CodeCrafters. Test output will be streamed to your terminal.
2 changes: 2 additions & 0 deletions solutions/ruby/01-at4/code/app/main.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Uncomment this block to pass the first stage
# puts "Implement code here!"
4 changes: 2 additions & 2 deletions solutions/ruby/01-at4/code/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Ruby version used to run your code
# on Codecrafters.
#
# Available versions: ruby-3.3
buildpack: ruby-3.3
# Available versions: ruby-3.4
buildpack: ruby-3.4
2 changes: 1 addition & 1 deletion solutions/ruby/01-at4/code/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec bundle exec ruby app/server.rb "$@"
exec bundle exec ruby app/main.rb "$@"
7 changes: 7 additions & 0 deletions solutions/ruby/01-at4/diff/app/main.rb.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@@ -1,5 +1,2 @@
-# You can use print statements as follows for debugging, they'll be visible when running tests.
-$stderr.puts "Logs from your program will appear here!"
-
# Uncomment this block to pass the first stage
# puts "Implement code here!"
\ No newline at end of file
2 changes: 1 addition & 1 deletion starter_templates/ruby/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec bundle exec ruby app/server.rb "$@"
exec bundle exec ruby app/main.rb "$@"
5 changes: 5 additions & 0 deletions starter_templates/ruby/code/app/main.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# You can use print statements as follows for debugging, they'll be visible when running tests.
$stderr.puts "Logs from your program will appear here!"

# Uncomment this block to pass the first stage
# puts "Implement code here!"
4 changes: 2 additions & 2 deletions starter_templates/ruby/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
attributes:
required_executable: ruby (3.3)
user_editable_file: app/server.rb
required_executable: ruby (3.4)
user_editable_file: app/main.rb
Loading