diff --git a/compiled_starters/ruby/Gemfile b/compiled_starters/ruby/Gemfile new file mode 100644 index 00000000..fd73dd7a --- /dev/null +++ b/compiled_starters/ruby/Gemfile @@ -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" diff --git a/compiled_starters/ruby/Gemfile.lock b/compiled_starters/ruby/Gemfile.lock new file mode 100644 index 00000000..2c8c7286 --- /dev/null +++ b/compiled_starters/ruby/Gemfile.lock @@ -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 diff --git a/compiled_starters/ruby/codecrafters.yml b/compiled_starters/ruby/codecrafters.yml index 3cee60de..b3ef8176 100644 --- a/compiled_starters/ruby/codecrafters.yml +++ b/compiled_starters/ruby/codecrafters.yml @@ -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 diff --git a/compiled_starters/ruby/spawn_redis_server.sh b/compiled_starters/ruby/spawn_redis_server.sh index 50c6b799..70a9e42c 100755 --- a/compiled_starters/ruby/spawn_redis_server.sh +++ b/compiled_starters/ruby/spawn_redis_server.sh @@ -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 "$@" diff --git a/dockerfiles/ruby-3.3.Dockerfile b/dockerfiles/ruby-3.3.Dockerfile new file mode 100644 index 00000000..37ff3fbf --- /dev/null +++ b/dockerfiles/ruby-3.3.Dockerfile @@ -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 \ No newline at end of file diff --git a/solutions/ruby/01-init/code/Gemfile b/solutions/ruby/01-init/code/Gemfile new file mode 100644 index 00000000..fd73dd7a --- /dev/null +++ b/solutions/ruby/01-init/code/Gemfile @@ -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" diff --git a/solutions/ruby/01-init/code/Gemfile.lock b/solutions/ruby/01-init/code/Gemfile.lock new file mode 100644 index 00000000..2c8c7286 --- /dev/null +++ b/solutions/ruby/01-init/code/Gemfile.lock @@ -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 diff --git a/solutions/ruby/01-init/code/codecrafters.yml b/solutions/ruby/01-init/code/codecrafters.yml index 3cee60de..b3ef8176 100644 --- a/solutions/ruby/01-init/code/codecrafters.yml +++ b/solutions/ruby/01-init/code/codecrafters.yml @@ -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 diff --git a/solutions/ruby/01-init/code/spawn_redis_server.sh b/solutions/ruby/01-init/code/spawn_redis_server.sh index 50c6b799..70a9e42c 100755 --- a/solutions/ruby/01-init/code/spawn_redis_server.sh +++ b/solutions/ruby/01-init/code/spawn_redis_server.sh @@ -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 "$@" diff --git a/starter-repository-definitions.yml b/starter-repository-definitions.yml index f9227ce4..4ec42d8b 100644 --- a/starter-repository-definitions.yml +++ b/starter-repository-definitions.yml @@ -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" diff --git a/starter_templates/codecrafters.yml b/starter_templates/codecrafters.yml index e6296001..5201ea57 100644 --- a/starter_templates/codecrafters.yml +++ b/starter_templates/codecrafters.yml @@ -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 diff --git a/starter_templates/ruby/Gemfile b/starter_templates/ruby/Gemfile new file mode 100644 index 00000000..fd73dd7a --- /dev/null +++ b/starter_templates/ruby/Gemfile @@ -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" diff --git a/starter_templates/ruby/Gemfile.lock b/starter_templates/ruby/Gemfile.lock new file mode 100644 index 00000000..2c8c7286 --- /dev/null +++ b/starter_templates/ruby/Gemfile.lock @@ -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 diff --git a/starter_templates/ruby/spawn_redis_server.sh b/starter_templates/ruby/spawn_redis_server.sh index 50c6b799..70a9e42c 100755 --- a/starter_templates/ruby/spawn_redis_server.sh +++ b/starter_templates/ruby/spawn_redis_server.sh @@ -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 "$@"