summaryrefslogtreecommitdiff
path: root/doc/hacking.md
blob: fe77232bd015c5a433d8688b66ed8576994e181e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Ruby Hacking Guide

This document gives some helpful instructions which should make your experience as a Ruby core developer easier.

## Configure Ruby

It's generally advisable to use a build directory.

	./autogen.sh
	mkdir build
	cd build
	../configure --prefix $HOME/.rubies/ruby-head
	make -j16 install

### Without Documentation

If you are frequently building Ruby, this will reduce the time it takes to `make install`.

	../configure --disable-install-doc

## Running Ruby

### Run Local Test Script

You can create a file in the Ruby source root called `test.rb`. You can build `miniruby` and execute this script:

	make -j16 run

If you want more of the standard library, you can use `runruby` instead of `run`.

### Run Bootstrap Tests

There are a set of tests in `bootstraptest/` which cover most basic features of the core Ruby language.

	make -j16 test

### Run Extensive Tests

There are extensive tests in `test/` which cover a wide range of features of the Ruby core language.

	make -j16 test-all

You can run specific tests by specifying their path:

	make -j16 test-all TESTS=../test/fiber/test_io.rb

### Run RubySpec Tests

RubySpec is a project to write a complete, executable specification for the Ruby programming language.

	make -j16 test-all test-rubyspec