Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Building image ##
FROM ruby:3.0.3-slim-bullseye AS builder
FROM ruby:3.4.8-slim-trixie AS builder
# install build dependencies
RUN apt update && apt install make gcc g++ libffi-dev nodejs git -y
COPY ./Gemfile /app/Gemfile
Expand Down
26 changes: 0 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,6 @@ docker compose up

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

## Preparing

Clone this repo, and use bundler to get dependencies:

$ bundle install

The website is built using middleman. Livereload is enabled.

Note: to install the 'eventmachine' gem a ruby development environment needs to
be present. You may need to run something like:

$ sudo apt-get install ruby2.3-dev

## Run development website

$ bin/middleman server

Then visit `http://localhost:4567`.

## Publishing

$ bin/rake publish

Git branch 'gh-pages' now holds the publishable version of TryRuby, accessible
via [try.ruby-lang.org/](https://try.ruby-lang.org/).

## Translators

When adding a new translation: see the README file in /translations.
Expand Down
21 changes: 13 additions & 8 deletions app/ruby_engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,25 @@ def loading(part = nil)
# When you update the engines, ensure that they are tested correctly.
# Update the engine list also in spec/playground_spec.
ENGINES = [
# https://www.jsdelivr.com/package/npm/@ruby/3.4-wasm-wasi?tab=files&path=dist&version=2.7.2
# https://www.jsdelivr.com/package/npm/@ruby/4.0-wasm-wasi?tab=files&path=dist&version=2.8.1
CRubyWASI.new(
"https://cdn.jsdelivr.net/npm/@ruby/3.4-wasm-wasi@2.7.2/dist/ruby.wasm",
"https://cdn.jsdelivr.net/npm/@ruby/4.0-wasm-wasi@2.8.1/dist/ruby.wasm",
"4.0.0"
),
# https://www.jsdelivr.com/package/npm/@ruby/3.4-wasm-wasi?tab=files&path=dist&version=2.8.1
CRubyWASI.new(
"https://cdn.jsdelivr.net/npm/@ruby/3.4-wasm-wasi@2.8.1/dist/ruby.wasm",
"3.4.1"
),
# https://www.jsdelivr.com/package/npm/@ruby/3.3-wasm-wasi?tab=files&path=dist&version=2.7.2
# https://www.jsdelivr.com/package/npm/@ruby/3.3-wasm-wasi?tab=files&path=dist&version=2.8.1
CRubyWASI.new(
"https://cdn.jsdelivr.net/npm/@ruby/3.3-wasm-wasi@2.7.2/dist/ruby.wasm",
"3.3.0"
"https://cdn.jsdelivr.net/npm/@ruby/3.3-wasm-wasi@2.8.1/dist/ruby.wasm",
"3.3.3"
),
# https://www.jsdelivr.com/package/npm/@ruby/3.2-wasm-wasi?tab=files&path=dist&version=2.7.2
# https://www.jsdelivr.com/package/npm/@ruby/3.2-wasm-wasi?tab=files&path=dist&version=2.8.1
CRubyWASI.new(
"https://cdn.jsdelivr.net/npm/@ruby/3.2-wasm-wasi@2.7.2/dist/ruby.wasm",
"3.2.2"
"https://cdn.jsdelivr.net/npm/@ruby/3.2-wasm-wasi@2.8.1/dist/ruby.wasm",
"3.2.4"
),
# Opal.new,
OpalWebWorker.new("1.8.2"),
Expand Down
4 changes: 2 additions & 2 deletions app/ruby_engine/cruby_wasi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class RubyEngine
class CRubyWASI < RubyEngine
REQUIRED_SCRIPTS = [
{
# https://www.jsdelivr.com/package/npm/@ruby/wasm-wasi?version=2.7.2&tab=files&path=dist
src: "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.7.2/dist/index.umd.js",
# https://www.jsdelivr.com/package/npm/@ruby/wasm-wasi?version=2.8.1&tab=files&path=dist
src: "https://cdn.jsdelivr.net/npm/@ruby/wasm-wasi@2.8.1/dist/index.umd.js",
integrity: "sha256-sxHtVJLn+brnck+saGLUKbu/JEP7pilIBgChJvVdjko=",
crossorigin: "anonymous"
},
Expand Down
2 changes: 1 addition & 1 deletion app/try_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TryRuby
RUBY
INITIAL_TRY_RESULT = 'Welcome ' * 3

DEFAULT_RUBY_ENGINE = "cruby-3.4.1"
DEFAULT_RUBY_ENGINE = "cruby-4.0.0"

GEM_PRELUDE_WARNINGS = [
"`RubyGems' were not loaded.",
Expand Down
2 changes: 1 addition & 1 deletion spec/playground_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.describe "Playground", type: :feature, js: true do
context "engine" do
engines = ["opal-ww-1.8.2", "cruby-3.2.2", "cruby-3.3.0", "cruby-3.4.1"]
engines = ["opal-ww-1.8.2", "cruby-3.2.4", "cruby-3.3.3", "cruby-3.4.1", "cruby-4.0.0"]
engines.each do |engine|
context engine do
before :each do
Expand Down