Running Ruby in Zerethon IDE
What Run does with your project, the time limit, input, tests, and what a run cannot do.
Runs in Zerethon IDE · Ruby 4.0
Official Ruby documentation ↗
- Run (Ctrl/⌘+Enter) runs the entry file —
main.rbby default — with Ruby 4.0. Make another file the entry with the ▶ button next to it in the explorer. - Output and errors appear in the Output tab; what you type in the Input tab is the program's standard input.
- A run is stopped after 10 seconds. Memory is limited, there is no network, and the project files are read-only (write to
/tmp). - Run tests (Ctrl/⌘+Shift+Enter) runs every file named
test_*.rb, each in its own interpreter. A test file passes when it exits with status 0, so an uncaughtraiseor a failing Minitest assertion fails it.
test_geometry.rb
require "minitest/autorun"
require_relative "geometry"
class GeometryTest < Minitest::Test
def test_area
assert_equal 6, Geometry.area(2, 3)
assert_equal 0, Geometry.area(0, 5)
end
end
geometry.rb module from “Several files and libraries”.
Tip: The editor highlights Ruby and completes keywords and common methods. There is no formatter or live error checking yet: Run shows Ruby's own messages.