Skip to content

Commit 08b2c13

Browse files
committed
Make bash code samples consistent
1 parent b8a2df0 commit 08b2c13

17 files changed

+112
-109
lines changed

doc/contributor/benchmarking.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Benchmarking with the GraalVM Compiler
44

5-
```
5+
```bash
66
$ jt benchmark bench/classic/mandelbrot.rb --simple
77
```
88

@@ -13,13 +13,13 @@ for the first few iterations).
1313

1414
You can turn off the GraalVM Compiler if you want using `--no-graal`.
1515

16-
```
16+
```bash
1717
$ jt benchmark --no-graal bench/classic/mandelbrot.rb --simple
1818
```
1919

2020
You can benchmark an entirely different implementation using the
2121
`JT_BENCHMARK_RUBY` environment variable.
2222

23-
```
23+
```bash
2424
$ JT_BENCHMARK_RUBY=ruby jt benchmark bench/classic/mandelbrot.rb --simple
2525
```

doc/contributor/building-graal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ install Graal locally.
1111
Our workflow tool can install Graal automatically under the directory
1212
`../graal/compiler` with:
1313

14-
```
14+
```bash
1515
$ jt install graal
1616
```
1717

1818
You can then use `jt` to run TruffleRuby with Graal.
1919

20-
```
20+
```bash
2121
$ jt ruby --graal ...
2222
```
2323

@@ -32,6 +32,6 @@ You can then set the `GRAAL_HOME` environment variable to the location of the
3232
`compiler` directory inside the `graal` repository and use `jt` to run
3333
TruffleRuby.
3434

35-
```
35+
```bash
3636
$ GRAAL_HOME=.../graal/compiler jt ruby --graal ...
3737
```

doc/contributor/cexts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
Get the gem test pack.
66

77
```bash
8-
jt gem-test-pack
8+
$ jt gem-test-pack
99
```
1010

1111
You can then test C extension support.
1212

1313
```bash
14-
jt test cexts
14+
$ jt test cexts
1515
```
1616

1717
You can also runs specs:
1818

1919
```bash
20-
jt test :capi
20+
$ jt test :capi
2121
```
2222

2323
### OpenSSL
2424

2525
The `openssl` specs and tests are currently segregated and are run separately.
2626

2727
```bash
28-
jt test :openssl
29-
jt test mri --openssl
28+
$ jt test :openssl
29+
$ jt test mri --openssl
3030
```
3131

3232
## Benchmarking
@@ -40,7 +40,7 @@ jt cextc bench/chunky_png/oily_png
4040
Then follow the instructions for benchmarking above, and then try:
4141

4242
```bash
43-
USE_CEXTS=true TRUFFLERUBYOPT=--cexts-log-load jt benchmark bench/chunky_png/chunky-color-r.rb --simple
43+
$ USE_CEXTS=true TRUFFLERUBYOPT=--cexts-log-load jt benchmark bench/chunky_png/chunky-color-r.rb --simple
4444
```
4545

4646
These benchmarks have Ruby fallbacks, so we should carefully check that the

doc/contributor/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ For example, to build a Docker image called `truffleruby-test` to test
1212
installing the public GraalVM CE binary and the public Ruby installable,
1313
using rbenv, and running a basic test:
1414

15-
```
15+
```bash
1616
$ jt docker build truffleruby-test --ubuntu1804 --public 1.0.0 --rbenv --basic-test
1717
```
1818

@@ -23,13 +23,13 @@ built to use TruffleRuby.
2323
Or, to print a Dockerfile to show how to install TruffleRuby from source on
2424
Fedora 28 using RVM:
2525

26-
```
26+
```bash
2727
$ jt docker print --fedora28 --source --rvm
2828
```
2929

3030
Or, to run a full set of tests on a set of new release candidate tarballs:
3131

32-
```
32+
```bash
3333
$ jt docker test --graalvm graalvm-ce.tar.gz ruby-installable.jar --test release_branch
3434
$ jt docker test --graalvm graalvm-ee.tar.gz ruby-installable.jar --test release_branch
3535
$ jt docker test --graalvm graalvm-ee.tar.gz ruby-installable.jar --rebuild-images --test release_branch
@@ -87,7 +87,7 @@ You may find that the Docker cache interacts badly with these Dockerfiles (such
8787
as repository URLs being cached that become unavailable). Therefore we recommend
8888
regularly clearing your Docker cache.
8989

90-
```
90+
```bash
9191
$ docker system prune -a -f
9292
```
9393

doc/contributor/native-image.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ warm-up time for shorter running commands and benchmarks.
3333
$ cd graalvm
3434
$ otool -L jre/bin/ruby
3535
jre/bin/ruby:
36-
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0)
37-
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
38-
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
36+
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1348.28.0)
37+
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0)
38+
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
39+
```
3940

41+
```bash
4042
$ du -h jre/bin/ruby
41-
200M jre/bin/ruby
43+
200M jre/bin/ruby
4244
```
4345

4446
The Native Image version of TruffleRuby has better startup performance and lower memory
@@ -81,7 +83,7 @@ There is no need to do so, but you can actually also compile your own copy of
8183
the Native Image version of TruffleRuby using a tool distributed as part of GraalVM and
8284
the Java version of TruffleRuby from GraalVM.
8385

84-
```
86+
```bash
8587
$ native-image -H:Name=native-ruby --language:ruby
8688
```
8789

@@ -90,7 +92,7 @@ $ native-image -H:Name=native-ruby --language:ruby
9092
You can build a native build of TruffleRuby using the Native Image Tool from a
9193
source distribution using:
9294

93-
```
95+
```bash
9496
$ jt build native
9597
```
9698

doc/contributor/static-analysis.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The [Clang Static Analyzer](https://clang-analyzer.llvm.org) finds bugs in C
1111
code. We occasionally run this tool locally but only take its output as a
1212
suggestion. We use a default configuration.
1313

14-
```
14+
```bash
1515
$ scan-build --use-analyzer `which clang` -analyze-headers clang -c --std=c99 -Ilib/cext/include src/main/c/cext/ruby.c src/main/c/truffleposix/truffleposix.c
1616
$ scan-view ...as instructed by scan-build...
1717
```
@@ -23,7 +23,7 @@ $ scan-view ...as instructed by scan-build...
2323
We have a tool to check that some use of our internal annotations and the
2424
Truffle DSL are correct. Passing this is enforced in our CI gate.
2525

26-
```
26+
```bash
2727
$ jt check_dsl_usage
2828
```
2929

@@ -32,7 +32,7 @@ $ jt check_dsl_usage
3232
[CheckStyle](http://checkstyle.sourceforge.net) enforces a Java style guide.
3333
Passing CheckStyle is enforced in our CI gate.
3434

35-
```
35+
```bash
3636
$ mx checkstyle
3737
```
3838

@@ -42,7 +42,7 @@ $ mx checkstyle
4242
errors. We run it with the default Graal project configuration. Passing
4343
SpotBugs is enforced in our CI gate.
4444

45-
```
45+
```bash
4646
$ mx spotbugs
4747
```
4848

@@ -54,7 +54,7 @@ $ mx spotbugs
5454
It's configured in `.rubocop.yml`, and can be run locally as `jt rubocop`.
5555
Passing Rubocop is enforced in our CI gate.
5656

57-
```
57+
```bash
5858
$ jt rubocop
5959
```
6060

@@ -64,7 +64,7 @@ $ jt rubocop
6464
performance improvements. We occasionally run this tool locally but only take
6565
its output as a suggestion. We use a default configuration.
6666

67-
```
67+
```bash
6868
$ gem install fasterer
6969
$ fasterer lib/truffle lib/cext src/main
7070
```
@@ -78,7 +78,7 @@ suggestion. We disable a lot of the defaults in `.reek.yml`, either because
7878
we're implementing a set API, because we're doing something low-level or
7979
outside normal Ruby semantics, or for performance reasons.
8080

81-
```
81+
```bash
8282
$ gem install reek
8383
$ reek lib/truffle lib/cext src/main
8484
```
@@ -89,7 +89,7 @@ $ reek lib/truffle lib/cext src/main
8989
check that your methods do not appear near the top of this list. We
9090
occasionally run this tool locally but only take its output as a suggestion.
9191

92-
```
92+
```bash
9393
$ gem install flog
9494
$ flog -m -t 10 lib/truffle lib/cext src/main
9595
```
@@ -100,7 +100,7 @@ $ flog -m -t 10 lib/truffle lib/cext src/main
100100
could potentially be factored out. We occasionally run this tool locally but
101101
only take its output as a suggestion.
102102

103-
```
103+
```bash
104104
$ gem install flay
105105
$ flay lib/truffle lib/cext src/main
106106
```
@@ -112,7 +112,7 @@ vulnerabilities. It's really designed for Rails, and many of the rules are
112112
specific to Rails, but we do run it ocassionally anyway and take its output as
113113
a suggestion.
114114

115-
```
115+
```bash
116116
$ gem install brakeman
117117
$ brakeman --force-scan --run-all-checks --interprocedural --no-pager --add-libs-path src --only-files lib/truffle/,lib/cext/,src/main/ruby/core/
118118
```

doc/contributor/updating-ruby-installers.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ maintained in the [ruby-versions](https://github.com/postmodern/ruby-versions) r
2929

3030
There is a handy script in the repo that does everything needed:
3131

32-
```
33-
./update.sh truffleruby $VERSION
32+
```bash
33+
$ ./update.sh truffleruby $VERSION
3434
```
3535

3636
Example PR for `1.0.0-rc12`: https://github.com/postmodern/ruby-versions/pull/39
@@ -41,8 +41,8 @@ cc `@havenwood` in the PR description.
4141

4242
There is a script in the repo that does everything needed:
4343

44-
```
45-
script/update-truffleruby $VERSION
44+
```bash
45+
$ script/update-truffleruby $VERSION
4646
```
4747

4848
Example PR for `1.0.0-rc12`: https://github.com/rbenv/ruby-build/pull/1282
@@ -56,8 +56,8 @@ cc `@hsbt` in the PR description.
5656

5757
There is a script in the repo that does everything needed:
5858

59-
```
60-
ruby update-truffleruby.rb $VERSION ../ruby-versions/pkg
59+
```bash
60+
$ ruby update-truffleruby.rb $VERSION ../ruby-versions/pkg
6161
```
6262

6363
The script must be run after running the `ruby-versions` script above.

doc/contributor/updating-ruby.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Check out the version of Ruby you want to create the branch for in `../ruby`.
1717

1818
Then create the reference branch in the TruffleRuby repository
1919

20-
```
20+
```bash
2121
$ git checkout -b vNN
2222
$ tool/import-mri-files.sh
2323
$ git commit -am 'vNN'
@@ -33,9 +33,9 @@ update.
3333
In your working branch you can import MRI files again, and you can re-apply
3434
old patches using the old reference branch.
3535

36-
```
37-
tool/import-mri-files.sh
38-
git diff vNN master | git apply -3
36+
```bash
37+
$ tool/import-mri-files.sh
38+
$ git diff vNN master | git apply -3
3939
```
4040

4141
You'll usually get some conflicts to work out.

doc/contributor/workflow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ $ ruby tool/jt.rb --help
3030

3131
Most of us add a function to our shell profile file so that it can be run with
3232
just `jt`. To allow this to run from any path, add this to your `.bash_profile`:
33+
3334
```bash
3435
$ echo 'function jt { ruby '$PWD'/tool/jt.rb "$@"; }' >> ~/.bash_profile
3536
```
@@ -44,7 +45,7 @@ $ jt --help
4445
You can install it automatically with:
4546

4647
```bash
47-
jt mx version
48+
$ jt mx version
4849
```
4950

5051
## Building

doc/user/installing-graalvm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ After installing GraalVM you then need to install the Ruby language into it.
4444
This is done using the `gu` command. The Ruby package is the same for both
4545
editions of GraalVM and comes from GitHub.
4646

47-
```
47+
```bash
4848
$ gu install ruby
4949
```
5050

@@ -67,7 +67,7 @@ To get the best performance you want to rebuild the images. Check that `ruby
6767
Rebuilding the executable images can take a few minutes and you should have
6868
about 8 GB of RAM available.
6969

70-
```
70+
```bash
7171
$ gu rebuild-images ruby
7272
```
7373

0 commit comments

Comments
 (0)