Skip to content

Commit

Permalink
Use console code highlighting where appropriate
Browse files Browse the repository at this point in the history
… which handles the prefix `$` correctly.
  • Loading branch information
amomchilov committed Dec 12, 2024
1 parent 62166d3 commit a19f0b5
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 66 deletions.
8 changes: 6 additions & 2 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ https://www.ruby-lang.org/ja/downloads/

ミラーをGitHubに公開しています. 以下のコマンドでリポジトリを取得できます.

$ git clone https://github.com/ruby/ruby.git
```console
$ git clone https://github.com/ruby/ruby.git
```

他のブランチの一覧は次のコマンドで見られます.

$ git ls-remote https://github.com/ruby/ruby.git
```console
$ git ls-remote https://github.com/ruby/ruby.git
```

Rubyリポジトリの本来のmasterは https://git.ruby-lang.org/ruby.git にあります.
コミッタはこちらを使います.
Expand Down
2 changes: 1 addition & 1 deletion doc/NEWS/NEWS-3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ end
foo(42)
```
```
```console
$ typeprof test.rb
# Classes
class Object
Expand Down
4 changes: 2 additions & 2 deletions doc/NEWS/NEWS-3.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ Example: `title = json[:article][:title]`
If `json` is nil, it shows:
```
```console
$ ruby test.rb
test.rb:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)
Expand All @@ -562,7 +562,7 @@ title = json[:article][:title]

If `json[:article]` returns nil, it shows:

```
```console
$ ruby test.rb
test.rb:2:in `<main>': undefined method `[]' for nil:NilClass (NoMethodError)

Expand Down
4 changes: 2 additions & 2 deletions doc/NEWS/NEWS-3.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -623,13 +623,13 @@ The following deprecated methods are removed.
Psych and fiddle supported the static build with specific version of libyaml
and libffi sources. You can build psych with libyaml-0.2.5 like this.

```bash
```console
$ ./configure --with-libyaml-source-dir=/path/to/libyaml-0.2.5
```

And you can build fiddle with libffi-3.4.4 like this.

```bash
```console
$ ./configure --with-libffi-source-dir=/path/to/libffi-3.4.4
```

Expand Down
18 changes: 9 additions & 9 deletions doc/command_line/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ of the invoked Ruby program.
The examples here use command-line option `-e`,
which passes the Ruby code to be executed on the command line itself:

```sh
```console
$ ruby -e 'puts "Hello, World."'
```

Expand All @@ -18,7 +18,7 @@ The argument to option `-C` specifies a working directory
for the invoked Ruby program;
does not change the working directory for the current process:

```sh
```console
$ basename `pwd`
ruby
$ ruby -C lib -e 'puts File.basename(Dir.pwd)'
Expand All @@ -35,7 +35,7 @@ The argument to option `-I` specifies a directory
to be added to the array in global variable `$LOAD_PATH`;
the option may be given more than once:

```sh
```console
$ pushd /tmp
$ ruby -e 'p $LOAD_PATH.size'
8
Expand All @@ -54,7 +54,7 @@ The argument to option `-r` specifies a library to be required
before executing the Ruby program;
the option may be given more than once:

```sh
```console
$ ruby -e 'p defined?(JSON); p defined?(CSV)'
nil
nil
Expand Down Expand Up @@ -83,10 +83,10 @@ these digits are prefixed with digit `0` to form an octal value:

Examples:

```sh
```console
$ ruby -0 -e 'p $/'
"\x00"
ruby -00 -e 'p $/'
$ ruby -00 -e 'p $/'
""
$ ruby -012 -e 'p $/'
"\n"
Expand All @@ -109,7 +109,7 @@ these commonly write to `$stdout` or `$stderr`.
The default value for `$DEBUG` is `false`;
option `-d` (or `--debug`) sets it to `true`:

```sh
```console
$ ruby -e 'p $DEBUG'
false
$ ruby -d -e 'p $DEBUG'
Expand Down Expand Up @@ -140,7 +140,7 @@ by setting the initial value of global variable `$-W`:
The value of `$-W`, in turn, determines which warning messages (if any)
are to be printed to `$stdout` (see Kernel#warn):

```sh
```console
$ ruby -W1 -e 'p $foo'
nil
$ ruby -W2 -e 'p $foo'
Expand All @@ -166,7 +166,7 @@ Warning[:performance] = true

You can suppress a category by prefixing `no-` to the category name:

```
```console
$ ruby -W:no-experimental -e 'p IO::Buffer.new'
#<IO::Buffer>
```
Expand Down
3 changes: 2 additions & 1 deletion doc/distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ See the Snapshots section of the [Ruby website](https://www.ruby-lang.org/en/dow
This can be useful if the nightly tarball does not have all changes yet.

At Ruby source tree cloned using git:
```sh-session

```console
$ ./autogen.sh
$ ./configure -C
$ make
Expand Down
2 changes: 1 addition & 1 deletion doc/exceptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If an exception not _rescued_
execution transfers to code in the Ruby interpreter
that prints a message and exits the program (or thread):

```
```console
$ ruby -e "raise"
-e:1:in `<main>': unhandled exception
```
Expand Down
6 changes: 3 additions & 3 deletions doc/ruby/option_dump.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ see {Option --dump}[options_md.html#label--dump-3A+Dump+Items].

For the examples here, we use this program:

```sh
```console
$ cat t.rb
puts 'Foo'
```
Expand All @@ -26,7 +26,7 @@ The supported dump items:
- `parsetree`: {Abstract syntax tree}[https://en.wikipedia.org/wiki/Abstract_syntax_tree]
(AST):

```sh
```console
$ ruby --dump=parsetree t.rb
###########################################################
## Do NOT use this node dump for any purpose other than ##
Expand All @@ -52,7 +52,7 @@ The supported dump items:

- `parsetree_with_comment`: AST with comments:

```sh
```console
$ ruby --dump=parsetree_with_comment t.rb
###########################################################
## Do NOT use this node dump for any purpose other than ##
Expand Down
Loading

0 comments on commit a19f0b5

Please sign in to comment.