Install

Metorex is built from source with Cargo.

Requirements#

Build#

$ git clone https://github.com/metorex-lang/metorex.git
$ cd metorex
$ cargo build --release

The binary is target/release/metorex.

Run a File#

Save this as hello.rb:

puts "Hello, world!"
p [1, 2, 3].map { it * 2 }

Run it:

$ target/release/metorex hello.rb
Hello, world!
[2, 4, 6]

Arguments after the file name are passed to the program in ARGV.

Run a One-Line Program#

$ target/release/metorex -e 'puts 6 * 7'
42

Start the REPL#

$ target/release/metorex
>> [1, 2].sum
=> 3
>> exit

help lists the REPL's commands, and Ctrl+D also exits.

Run Tests#

metorex test runs the files under test/ whose names match *_test.rb, test_*.rb, or *_spec.rb, and metorex test DIR runs those under DIR. metorex spec runs an RSpec suite under spec/ with Rex.

$ target/release/metorex test
$ target/release/metorex spec

Every Option#

$ target/release/metorex --help