Skip to content

Commit

Permalink
Merge pull request #117 from codecrafters-io/upgrade-ruby
Browse files Browse the repository at this point in the history
Add Ruby Gemfile and Gemfile.lock for version 3.3
  • Loading branch information
rohitpaulk authored Feb 1, 2024
2 parents 7af80c7 + d26abaa commit 925d6ad
Show file tree
Hide file tree
Showing 14 changed files with 92 additions and 9 deletions.
9 changes: 9 additions & 0 deletions compiled_starters/ruby/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Add gems here if you need to use them.
# Make sure to run `bundle install` before running tests or submitting your code.

# Helps with declaratively parsing binary data.
gem "bindata", "~> 2.4"
15 changes: 15 additions & 0 deletions compiled_starters/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
bindata (2.4.15)

PLATFORMS
aarch64-linux-musl
arm64-darwin-21
x86_64-linux

DEPENDENCIES
bindata (~> 2.4)

BUNDLED WITH
2.4.18
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.2
language_pack: ruby-3.2
# Available versions: ruby-3.3
language_pack: ruby-3.3
2 changes: 1 addition & 1 deletion compiled_starters/ruby/spawn_redis_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# CodeCrafters uses this file to test your code. Don't make any changes here!
#
# DON'T EDIT THIS!
exec ruby app/server.rb "$@"
exec bundle exec ruby app/server.rb "$@"
7 changes: 7 additions & 0 deletions dockerfiles/ruby-3.3.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ruby:3.3-alpine

ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Gemfile,Gemfile.lock"
WORKDIR /app

COPY Gemfile Gemfile.lock ./
RUN bundle install --verbose
9 changes: 9 additions & 0 deletions solutions/ruby/01-init/code/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Add gems here if you need to use them.
# Make sure to run `bundle install` before running tests or submitting your code.

# Helps with declaratively parsing binary data.
gem "bindata", "~> 2.4"
15 changes: 15 additions & 0 deletions solutions/ruby/01-init/code/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
bindata (2.4.15)

PLATFORMS
aarch64-linux-musl
arm64-darwin-21
x86_64-linux

DEPENDENCIES
bindata (~> 2.4)

BUNDLED WITH
2.4.18
4 changes: 2 additions & 2 deletions solutions/ruby/01-init/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.2
language_pack: ruby-3.2
# Available versions: ruby-3.3
language_pack: ruby-3.3
2 changes: 1 addition & 1 deletion solutions/ruby/01-init/code/spawn_redis_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# CodeCrafters uses this file to test your code. Don't make any changes here!
#
# DON'T EDIT THIS!
exec ruby app/server.rb "$@"
exec bundle exec ruby app/server.rb "$@"
4 changes: 4 additions & 0 deletions starter-repository-definitions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
target: spawn_redis_server.sh
- source: starter_templates/.gitattributes
target: .gitattributes
- source: starter_templates/ruby/Gemfile
target: Gemfile
- source: starter_templates/ruby/Gemfile.lock
target: Gemfile.lock
template_attributes:
required_executable: "ruby (2.7)"
user_editable_file: "app/server.rb"
Expand Down
4 changes: 2 additions & 2 deletions starter_templates/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ language_pack: nodejs-18
language_pack: c-9.2
{{/ language_is_c }}
{{# language_is_ruby }}
# Available versions: ruby-3.2
language_pack: ruby-3.2
# Available versions: ruby-3.3
language_pack: ruby-3.3
{{/ language_is_ruby }}
{{# language_is_rust }}
# Available versions: rust-1.70
Expand Down
9 changes: 9 additions & 0 deletions starter_templates/ruby/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Add gems here if you need to use them.
# Make sure to run `bundle install` before running tests or submitting your code.

# Helps with declaratively parsing binary data.
gem "bindata", "~> 2.4"
15 changes: 15 additions & 0 deletions starter_templates/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
bindata (2.4.15)

PLATFORMS
aarch64-linux-musl
arm64-darwin-21
x86_64-linux

DEPENDENCIES
bindata (~> 2.4)

BUNDLED WITH
2.4.18
2 changes: 1 addition & 1 deletion starter_templates/ruby/spawn_redis_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# CodeCrafters uses this file to test your code. Don't make any changes here!
#
# DON'T EDIT THIS!
exec ruby app/server.rb "$@"
exec bundle exec ruby app/server.rb "$@"

0 comments on commit 925d6ad

Please sign in to comment.