Skip to content

Commit c5c894c

Browse files
committed
[DOC] Markup example code as ruby
1 parent cefd4a2 commit c5c894c

1 file changed

Lines changed: 24 additions & 24 deletions

File tree

doc/globals.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For each of those, the \English synonym is given.
66

77
To use the module:
88

9-
```
9+
```ruby
1010
require 'English'
1111
```
1212

@@ -85,7 +85,7 @@ require 'English'
8585

8686
Contains the Exception object set by Kernel#raise:
8787

88-
```
88+
```ruby
8989
begin
9090
raise RuntimeError.new('Boo!')
9191
rescue RuntimeError
@@ -106,7 +106,7 @@ English - `$ERROR_INFO`
106106
Same as `$!.backtrace`;
107107
returns an array of backtrace positions:
108108

109-
```
109+
```ruby
110110
begin
111111
raise RuntimeError.new('Boo!')
112112
rescue RuntimeError
@@ -191,23 +191,23 @@ English - `$OUTPUT_RECORD_SEPARATOR`, `$ORS`.
191191

192192
The current standard input stream; initially:
193193

194-
```
194+
```ruby
195195
$stdin # => #<IO:<STDIN>>
196196
```
197197

198198
### `$stdout` (Standard Output)
199199

200200
The current standard output stream; initially:
201201

202-
```
202+
```ruby
203203
$stdout # => #<IO:<STDOUT>>
204204
```
205205

206206
### `$stderr` (Standard Error)
207207

208208
The current standard error stream; initially:
209209

210-
```
210+
```ruby
211211
$stderr # => #<IO:<STDERR>>
212212
```
213213

@@ -278,7 +278,7 @@ returns:
278278

279279
Examples:
280280

281-
```
281+
```ruby
282282
$LOAD_PATH.resolve_feature_path('timeout')
283283
# => [:rb, "/snap/ruby/317/lib/ruby/3.2.0/timeout.rb"]
284284
$LOAD_PATH.resolve_feature_path('date_core')
@@ -293,7 +293,7 @@ Aliased as `$:` and `$-I`.
293293

294294
Contains an array of the paths to the loaded files:
295295

296-
```
296+
```ruby
297297
$LOADED_FEATURES.take(10)
298298
# =>
299299
["enumerator.so",
@@ -409,23 +409,23 @@ Whether command-line option `-p` was given; read-only.
409409

410410
The standard input stream (the default value for `$stdin`):
411411

412-
```
412+
```ruby
413413
STDIN # => #<IO:<STDIN>>
414414
```
415415

416416
### `STDOUT`
417417

418418
The standard output stream (the default value for `$stdout`):
419419

420-
```
420+
```ruby
421421
STDOUT # => #<IO:<STDOUT>>
422422
```
423423

424424
### `STDERR`
425425

426426
The standard error stream (the default value for `$stderr`):
427427

428-
```
428+
```ruby
429429
STDERR # => #<IO:<STDERR>>
430430
```
431431

@@ -435,7 +435,7 @@ STDERR # => #<IO:<STDERR>>
435435

436436
A hash of the contains current environment variables names and values:
437437

438-
```
438+
```ruby
439439
ENV.take(5)
440440
# =>
441441
[["COLORTERM", "truecolor"],
@@ -459,39 +459,39 @@ An array of the given command-line arguments.
459459

460460
The Binding of the top level scope:
461461

462-
```
462+
```ruby
463463
TOPLEVEL_BINDING # => #<Binding:0x00007f58da0da7c0>
464464
```
465465

466466
### `RUBY_VERSION`
467467

468468
The Ruby version:
469469

470-
```
470+
```ruby
471471
RUBY_VERSION # => "3.2.2"
472472
```
473473

474474
### `RUBY_RELEASE_DATE`
475475

476476
The release date string:
477477

478-
```
478+
```ruby
479479
RUBY_RELEASE_DATE # => "2023-03-30"
480480
```
481481

482482
### `RUBY_PLATFORM`
483483

484484
The platform identifier:
485485

486-
```
486+
```ruby
487487
RUBY_PLATFORM # => "x86_64-linux"
488488
```
489489

490490
### `RUBY_PATCHLEVEL`
491491

492492
The integer patch level for this Ruby:
493493

494-
```
494+
```ruby
495495
RUBY_PATCHLEVEL # => 53
496496
```
497497

@@ -501,15 +501,15 @@ For a development build the patch level will be -1.
501501

502502
The git commit hash for this Ruby:
503503

504-
```
504+
```ruby
505505
RUBY_REVISION # => "e51014f9c05aa65cbf203442d37fef7c12390015"
506506
```
507507

508508
### `RUBY_COPYRIGHT`
509509

510510
The copyright string:
511511

512-
```
512+
```ruby
513513
RUBY_COPYRIGHT
514514
# => "ruby - Copyright (C) 1993-2023 Yukihiro Matsumoto"
515515
```
@@ -518,23 +518,23 @@ RUBY_COPYRIGHT
518518

519519
The name of the Ruby implementation:
520520

521-
```
521+
```ruby
522522
RUBY_ENGINE # => "ruby"
523523
```
524524

525525
### `RUBY_ENGINE_VERSION`
526526

527527
The version of the Ruby implementation:
528528

529-
```
529+
```ruby
530530
RUBY_ENGINE_VERSION # => "3.2.2"
531531
```
532532

533533
### `RUBY_DESCRIPTION`
534534

535535
The description of the Ruby implementation:
536536

537-
```
537+
```ruby
538538
RUBY_DESCRIPTION
539539
# => "ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]"
540540
```
@@ -545,15 +545,15 @@ RUBY_DESCRIPTION
545545

546546
Defined if and only if the program has this line:
547547

548-
```
548+
```ruby
549549
__END__
550550
```
551551

552552
When defined, `DATA` is a File object
553553
containing the lines following the `__END__`,
554554
positioned at the first of those lines:
555555

556-
```
556+
```ruby
557557
p DATA
558558
DATA.each_line { |line| p line }
559559
__END__

0 commit comments

Comments
 (0)