Skip to content

Commit

Permalink
Set language on code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
amomchilov committed Dec 12, 2024
1 parent 33c240f commit 08483ac
Show file tree
Hide file tree
Showing 26 changed files with 190 additions and 193 deletions.
2 changes: 1 addition & 1 deletion benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ benchmark-driver benchmark/*.yml

See also:

```console
```text
Usage: benchmark-driver [options] RUBY|YAML...
-r, --runner TYPE Specify runner type: ips, time, memory, once, block (default: ips)
-o, --output TYPE Specify output type: compare, simple, markdown, record, all (default: compare)
Expand Down
5 changes: 3 additions & 2 deletions doc/command_line/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ nil
Ruby code may also define warnings for certain categories;
these are the default settings for the defined categories:

```
```ruby
Warning[:experimental] # => true
Warning[:deprecated] # => false
Warning[:performance] # => false
```

They may also be set:
```

```ruby
Warning[:experimental] = false
Warning[:deprecated] = true
Warning[:performance] = true
Expand Down
34 changes: 17 additions & 17 deletions doc/contributing/building_ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
the OS default place, typically using Homebrew on macOS, pass the
`--with-opt-dir` (or `--with-gmp-dir` for gmp) option to `configure`.

``` shell
```sh
configure --with-opt-dir=$(brew --prefix gmp):$(brew --prefix jemalloc)
```

Expand All @@ -43,7 +43,7 @@
latter environment variable is not embedded and is only used when
building the extension libraries.

``` shell
```sh
export CONFIGURE_ARGS=""
for ext in openssl readline libyaml zlib; do
CONFIGURE_ARGS="${CONFIGURE_ARGS} --with-$ext-dir=$(brew --prefix $ext)"
Expand Down Expand Up @@ -71,7 +71,7 @@
Download the latest tarball from [Download Ruby] page and extract
it. Example for Ruby 3.0.2:

``` shell
```sh
tar -xzf ruby-3.0.2.tar.gz
cd ruby-3.0.2
```
Expand All @@ -80,20 +80,20 @@

Checkout the CRuby source code:

``` shell
```sh
git clone https://github.com/ruby/ruby.git
cd ruby
```

Generate the configure file:

``` shell
```sh
./autogen.sh
```

2. Create a `build` directory separate from the source directory:

``` shell
```sh
mkdir build && cd build
```

Expand All @@ -102,13 +102,13 @@

3. We'll install Ruby in `~/.rubies/ruby-master`, so create the directory:
``` shell
```sh
mkdir ~/.rubies
```
4. Run configure:
``` shell
```sh
../configure --prefix="${HOME}/.rubies/ruby-master"
```
Expand All @@ -117,15 +117,15 @@
5. Build Ruby:
``` shell
```sh
make
```
6. [Run tests](testing_ruby.md) to confirm your build succeeded.
7. Install Ruby:
``` shell
```sh
make install
```
Expand Down Expand Up @@ -159,7 +159,7 @@ In GNU make[^caution-gmake-3] and BSD make implementations, to run a specific ma
parallel, pass the flag `-j<number of processes>`. For instance, to run tests
on 8 processes, use:

``` shell
```sh
make test-all -j8
```

Expand All @@ -169,7 +169,7 @@ Having the right `--jobs` flag will ensure all processors are utilized when
building software projects. To do this effectively, you can set `MAKEFLAGS` in
your shell configuration/profile:

``` shell
```sh
# On macOS with Fish shell:
export MAKEFLAGS="--jobs "(sysctl -n hw.ncpu)
Expand All @@ -193,7 +193,7 @@ certain features. It can be useful in Ruby development because it allows for
faster build times. Miniruby is built before Ruby. A functional Miniruby is
required to build Ruby. To build Miniruby:

``` shell
```sh
make miniruby
```

Expand All @@ -215,7 +215,7 @@ following make targets:
You should configure Ruby without optimization and other flags that may
interfere with debugging:
``` shell
```sh
./configure --enable-debug-env optflags="-O0 -fno-omit-frame-pointer"
```
Expand All @@ -225,7 +225,7 @@ Using the address sanitizer (ASAN) is a great way to detect memory issues. It
can detect memory safety issues in Ruby itself, and also in any C extensions
compiled with and loaded into a Ruby compiled with ASAN.
``` shell
```sh
./autogen.sh
mkdir build && cd build
../configure CC=clang-18 cflags="-fsanitize=address -fno-omit-frame-pointer -DUSE_MN_THREADS=0" # and any other options you might like
Expand All @@ -239,7 +239,7 @@ two hours on my laptop); the `RUBY_TEST_TIMEOUT_SCALE` and
`SYNTAX_SUGEST_TIMEOUT` variables are required to make sure tests don't
spuriously fail with timeouts when in fact they're just slow.

``` shell
```sh
RUBY_TEST_TIMEOUT_SCALE=5 SYNTAX_SUGGEST_TIMEOUT=600 make check
```

Expand Down Expand Up @@ -274,7 +274,7 @@ Please note, however, the following caveats!
You need to be able to use gcc (gcov) and lcov visualizer.
``` shell
```sh
./autogen.sh
./configure --enable-gcov
make
Expand Down
42 changes: 21 additions & 21 deletions doc/contributing/documentation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ involving new files `doc/*.rdoc`:
Example:
```
```c
/*
* call-seq:
* each_byte {|byte| ... } -> self
Expand Down Expand Up @@ -173,12 +173,13 @@ Code that is a simple string should include the quote marks.
Most often, the name of a class, module, or method
is auto-linked:
```
```rdoc
- Float.
- Enumerable.
- File.new
- File#read.
```
renders as:
> - Float.
Expand All @@ -189,7 +190,7 @@ renders as:
In general, \RDoc's auto-linking should not be suppressed.
For example, we should write just plain _Float_ (which is auto-linked):

```
```rdoc
Returns a Float.
```

Expand All @@ -200,13 +201,13 @@ which renders as:
However, _do_ suppress auto-linking when the word in question
does not refer to a Ruby entity (e.g., some uses of _Class_ or _English_):

```
```rdoc
\Class variables can be tricky.
```

renders as:

> \\Class variables can be tricky.
> Class variables can be tricky.

Also, _do_ suppress auto-linking when the word in question
refers to the current document
Expand All @@ -216,7 +217,7 @@ In this case you may consider forcing the name to
[monofont](rdoc-ref:RDoc::MarkupReference@Monofont),
which suppresses auto-linking, and also emphasizes that the word is a class name:

```
```rdoc
A +Float+ object represents ....
```

Expand All @@ -231,7 +232,7 @@ you might write simply the lowercase _array_.

Instead of:

```
```rdoc
For an empty Array, ....
```

Expand All @@ -241,7 +242,7 @@ which renders as:

you might write:

```
```rdoc
For an empty array, ....
```

Expand Down Expand Up @@ -398,13 +399,13 @@ the method accepts, so those need to be documented using \RDoc directive
For a singleton method, use the form:
```
```rdoc
class_name.method_name(method_args) {|block_args| ... } -> return_type
```

Example:

```
```rdoc
* call-seq:
* Hash.new(default_value = nil) -> new_hash
* Hash.new {|hash, key| ... } -> new_hash
Expand All @@ -413,27 +414,28 @@ Example:
For an instance method, use the form
(omitting any prefix, just as RDoc does for a Ruby-coded method):

```
```rdoc
method_name(method_args) {|block_args| ... } -> return_type
```

For example, in Array, use:

```
```rdoc
* call-seq:
* count -> integer
* count(obj) -> integer
* count {|element| ... } -> integer
```

```
```rdoc
* call-seq:
* <=> other -> -1, 0, 1, or nil
```

For a binary-operator style method (e.g., Array#&),
cite `self` in the call-seq (not, e.g., `array` or `receiver`):

```
```rdoc
* call-seq:
* self & other_array -> new_array
```
Expand All @@ -449,7 +451,7 @@ Arguments:
or an explicit argument, use a `call-seq` with optional arguments.
For example, use:

```
```rdoc
* call-seq:
* respond_to?(symbol, include_all = false) -> true or false
```
Expand All @@ -458,7 +460,7 @@ Arguments:
use a `call-seq` with separate lines.
For example, in Enumerable, use:
```
```rdoc
* call-seq:
* max -> element
* max(n) -> array
Expand All @@ -472,7 +474,7 @@ Block:
- If the method accepts a block, but returns an Enumerator when the block is omitted,
the `call-seq` should show both forms:
```
```rdoc
* call-seq:
* array.select {|element| ... } -> new_array
* array.select -> new_enumerator
Expand Down Expand Up @@ -505,9 +507,7 @@ an entire paragraph.
For `Array#count`, the synopsis is:
```
Returns a count of specified elements.
```
> Returns a count of specified elements.
This is great as it is short and descriptive. Avoid documenting
too much in the synopsis, stick to the most important information
Expand Down Expand Up @@ -550,7 +550,7 @@ but return a new Enumerator if the block is not given;
in that case, do not provide an example,
but do state the fact (with the auto-linking uppercase Enumerator):
```
```rdoc
* With no block given, returns a new Enumerator.
```

Expand Down
10 changes: 5 additions & 5 deletions doc/contributing/making_changes_to_stdlibs.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ You can find the list of maintainers [here](https://docs.ruby-lang.org/en/master

First, install its dependencies using:

```
```shell
bundle install
```

### Libraries with C-extension

If the library has a `/ext` directory, it has C files that you need to compile with:

```
```shell
bundle exec rake compile
```

Expand All @@ -32,18 +32,18 @@ All standard libraries use [test-unit](https://github.com/test-unit/test-unit) a

To run all tests:

```
```shell
bundle exec rake test
```

To run a single test file:

```
```shell
bundle exec rake test TEST="test/test_foo.rb"
```

To run a single test case:

```
```shell
bundle exec rake test TEST="test/test_foo.rb" TESTOPS="--name=/test_mytest/"
```
Loading

0 comments on commit 08483ac

Please sign in to comment.