Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Apr 29, 2024
1 parent ab42ec1 commit 6240831
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .changeset/friendly-badgers-protect.md
@@ -1,5 +1,5 @@
---
'@vercel/ruby': patch
'@vercel/ruby': minor
---

Add support for Ruby 3.3
2 changes: 0 additions & 2 deletions packages/ruby/src/index.ts
Expand Up @@ -95,7 +95,6 @@ async function bundleInstall(
// "webrick" needs to be installed for Ruby 3+ to fix runtime error:
// webrick is not part of the default gems since Ruby 3.0.0. Install webrick from RubyGems.
if (major >= 3) {
console.log('installing webrick');
const result = await execa('bundler', ['add', 'webrick'], {
cwd: dirname(gemfilePath),
stdio: 'pipe',
Expand Down Expand Up @@ -155,7 +154,6 @@ export const build: BuildV3 = async ({
: '';
const { gemHome, bundlerPath, vendorPath, runtime, rubyPath, major } =
await installBundler(meta, gemfileContents);
console.log({ gemHome, bundlerPath, vendorPath, runtime, rubyPath, major });
process.env.GEM_HOME = gemHome;
debug(`Checking existing vendor directory at "${vendorPath}"`);
const vendorDir = join(workPath, vendorPath);
Expand Down
@@ -0,0 +1,7 @@
# frozen_string_literal: true

source "https://rubygems.org"

ruby "~> 3.2.x"

gem "cowsay", "~> 0.3.0"
@@ -0,0 +1,16 @@
GEM
remote: https://rubygems.org/
specs:
cowsay (0.3.0)

PLATFORMS
x86_64-linux

DEPENDENCIES
cowsay (~> 0.3.0)

RUBY VERSION
ruby 2.5.5p157

BUNDLED WITH
2.2.22
@@ -0,0 +1,9 @@
require 'cowsay'

Handler = Proc.new do |req, res|
name = req.query['name'] || 'World'

res.status = 200
res['Content-Type'] = 'text/text; charset=utf-8'
res.body = Cowsay.say("Hello #{name}", 'cow')
end
@@ -0,0 +1,4 @@
{
"version": 2,
"builds": [{ "src": "index.rb", "use": "@vercel/ruby" }]
}
4 changes: 4 additions & 0 deletions packages/ruby/test/test.js
Expand Up @@ -18,6 +18,10 @@ const testsThatFailToBuild = new Map([
'12-version-3-3-on-al2-error',
'Found `Gemfile` with invalid Ruby version: `ruby "~> 3.3.x".` Please set `ruby "~> 3.2.x"` in your `Gemfile` to use Ruby 3.2.x.',
],
[
'13-version-3-2-on-al2023-error',
'Found `Gemfile` with invalid Ruby version: `ruby "~> 3.2.x".` Please set `ruby "~> 3.3.x"` in your `Gemfile` to use Ruby 3.3.x.',
],
]);

const testsThatShouldBeSkipped = ['06-rails'];
Expand Down

0 comments on commit 6240831

Please sign in to comment.