Skip to content

Commit c8431d3

Browse files
authored
Merge pull request #224 from eggplants/ruby-4.0
Add Ruby 4.0
2 parents 43da59e + 885bd17 commit c8431d3

File tree

6 files changed

+18
-39
lines changed

6 files changed

+18
-39
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Building image ##
2-
FROM ruby:3.0.3-slim-bullseye AS builder
2+
FROM ruby:3.4.8-slim-trixie AS builder
33
# install build dependencies
44
RUN apt update && apt install make gcc g++ libffi-dev nodejs git -y
55
COPY ./Gemfile /app/Gemfile

README.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,6 @@ docker compose up
4848

4949
Then visit `http://localhost:9099`.
5050

51-
## Preparing
52-
53-
Clone this repo, and use bundler to get dependencies:
54-
55-
$ bundle install
56-
57-
The website is built using middleman. Livereload is enabled.
58-
59-
Note: to install the 'eventmachine' gem a ruby development environment needs to
60-
be present. You may need to run something like:
61-
62-
$ sudo apt-get install ruby2.3-dev
63-
64-
## Run development website
65-
66-
$ bin/middleman server
67-
68-
Then visit `http://localhost:4567`.
69-
70-
## Publishing
71-
72-
$ bin/rake publish
73-
74-
Git branch 'gh-pages' now holds the publishable version of TryRuby, accessible
75-
via [try.ruby-lang.org/](https://try.ruby-lang.org/).
76-
7751
## Translators
7852

7953
When adding a new translation: see the README file in /translations.

app/ruby_engine.rb

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,25 @@ def loading(part = nil)
3939
# When you update the engines, ensure that they are tested correctly.
4040
# Update the engine list also in spec/playground_spec.
4141
ENGINES = [
42-
# https://www.jsdelivr.com/package/npm/@ruby/3.4-wasm-wasi?tab=files&path=dist&version=2.7.2
42+
# https://www.jsdelivr.com/package/npm/@ruby/4.0-wasm-wasi?tab=files&path=dist&version=2.8.1
4343
CRubyWASI.new(
44-
"https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/ruby.wasm",
44+
"https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/ruby.wasm",
45+
"4.0.0"
46+
),
47+
# https://www.jsdelivr.com/package/npm/@ruby/3.4-wasm-wasi?tab=files&path=dist&version=2.8.1
48+
CRubyWASI.new(
49+
"https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/ruby.wasm",
4550
"3.4.1"
4651
),
47-
# https://www.jsdelivr.com/package/npm/@ruby/3.3-wasm-wasi?tab=files&path=dist&version=2.7.2
52+
# https://www.jsdelivr.com/package/npm/@ruby/3.3-wasm-wasi?tab=files&path=dist&version=2.8.1
4853
CRubyWASI.new(
49-
"https://cdn.jsdelivr.net/npm/@ruby/3.3-wasm-wasi@2.7.2/dist/ruby.wasm",
50-
"3.3.0"
54+
"https://cdn.jsdelivr.net/npm/@ruby/3.3-wasm-wasi@2.8.1/dist/ruby.wasm",
55+
"3.3.3"
5156
),
52-
# https://www.jsdelivr.com/package/npm/@ruby/3.2-wasm-wasi?tab=files&path=dist&version=2.7.2
57+
# https://www.jsdelivr.com/package/npm/@ruby/3.2-wasm-wasi?tab=files&path=dist&version=2.8.1
5358
CRubyWASI.new(
54-
"https://cdn.jsdelivr.net/npm/@ruby/3.2-wasm-wasi@2.7.2/dist/ruby.wasm",
55-
"3.2.2"
59+
"https://cdn.jsdelivr.net/npm/@ruby/3.2-wasm-wasi@2.8.1/dist/ruby.wasm",
60+
"3.2.4"
5661
),
5762
# Opal.new,
5863
OpalWebWorker.new("1.8.2"),

app/ruby_engine/cruby_wasi.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class RubyEngine
77
class CRubyWASI < RubyEngine
88
REQUIRED_SCRIPTS = [
99
{
10-
# https://www.jsdelivr.com/package/npm/@ruby/wasm-wasi?version=2.7.2&tab=files&path=dist
11-
src: "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.7.2/dist/index.umd.js",
10+
# https://www.jsdelivr.com/package/npm/@ruby/wasm-wasi?version=2.8.1&tab=files&path=dist
11+
src: "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.8.1/dist/index.umd.js",
1212
integrity: "sha256-sxHtVJLn+brnck+saGLUKbu/JEP7pilIBgChJvVdjko=",
1313
crossorigin: "anonymous"
1414
},

app/try_ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TryRuby
1616
RUBY
1717
INITIAL_TRY_RESULT = 'Welcome ' * 3
1818

19-
DEFAULT_RUBY_ENGINE = "cruby-3.4.1"
19+
DEFAULT_RUBY_ENGINE = "cruby-4.0.0"
2020

2121
GEM_PRELUDE_WARNINGS = [
2222
"`RubyGems' were not loaded.",

spec/playground_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
RSpec.describe "Playground", type: :feature, js: true do
44
context "engine" do
5-
engines = ["opal-ww-1.8.2", "cruby-3.2.2", "cruby-3.3.0", "cruby-3.4.1"]
5+
engines = ["opal-ww-1.8.2", "cruby-3.2.4", "cruby-3.3.3", "cruby-3.4.1", "cruby-4.0.0"]
66
engines.each do |engine|
77
context engine do
88
before :each do

0 commit comments

Comments
 (0)