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 7af1bc9 commit 9812d30
Show file tree
Hide file tree
Showing 27 changed files with 209 additions and 209 deletions.
35 changes: 19 additions & 16 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ details of the default gems or bundled gems.
* Kernel#caller, Thread::Backtrace::Location’s methods, etc. are also changed accordingly.
Old:
```
```text
test.rb:1:in `foo': undefined method `time' for an instance of Integer
from test.rb:2:in `<main>'
```
New:
```
```text
test.rb:1:in 'Object#foo': undefined method 'time' for an instance of Integer
from test.rb:2:in '<main>'
```
Expand All @@ -259,21 +259,24 @@ details of the default gems or bundled gems.
* Other keys now have spaces around `=>`: `'{"user" => 1}'`, while previously they didn't: `'{"user"=>1}'`
* Kernel#Float() now accepts a decimal string with decimal part omitted. [[Feature #20705]]
```
```rb
Float("1.") #=> 1.0 (previously, an ArgumentError was raised)
Float("1.E-1") #=> 0.1 (previously, an ArgumentError was raised)
```
* String#to_f now accepts a decimal string with decimal part omitted. [[Feature #20705]]
Note that the result changes when an exponent is specified.
```
```rb
"1.".to_f #=> 1.0
"1.E-1".to_f #=> 0.1 (previously, 1.0 was returned)
```
* Object#singleton_method now returns methods in modules prepended to or included in the
receiver's singleton class. [[Bug #20620]]
```

```rb
o = Object.new
o.extend(Module.new{def a = 1})
o.singleton_method(:a).call #=> 1
Expand All @@ -288,17 +291,17 @@ details of the default gems or bundled gems.
* Net::HTTP

* Removed the following deprecated constants:
`Net::HTTP::ProxyMod`
`Net::NetPrivate::HTTPRequest`
`Net::HTTPInformationCode`
`Net::HTTPSuccessCode`
`Net::HTTPRedirectionCode`
`Net::HTTPRetriableCode`
`Net::HTTPClientErrorCode`
`Net::HTTPFatalErrorCode`
`Net::HTTPServerErrorCode`
`Net::HTTPResponseReceiver`
`Net::HTTPResponceReceiver`
* `Net::HTTP::ProxyMod`
* `Net::NetPrivate::HTTPRequest`
* `Net::HTTPInformationCode`
* `Net::HTTPSuccessCode`
* `Net::HTTPRedirectionCode`
* `Net::HTTPRetriableCode`
* `Net::HTTPClientErrorCode`
* `Net::HTTPFatalErrorCode`
* `Net::HTTPServerErrorCode`
* `Net::HTTPResponseReceiver`
* `Net::HTTPResponceReceiver`

These constants were deprecated from 2012.

Expand Down
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
Loading

0 comments on commit 9812d30

Please sign in to comment.