Skip to content

Commit 96cc933

Browse files
authored
Merge pull request rails#49097 from akhilgkrishnan/missing-markdown
[skip ci] Added the missing code block highlights in guides
2 parents 8b3dc1a + e556a4a commit 96cc933

9 files changed

+29
-29
lines changed

guides/source/action_cable_overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ when using the same Redis server for multiple applications. See the [Redis Pub/S
777777

778778
The Redis adapter also supports SSL/TLS connections. The required SSL/TLS parameters can be passed in `ssl_params` key in the configuration YAML file.
779779

780-
```
780+
```yaml
781781
production:
782782
adapter: redis
783783
url: rediss://10.10.3.153:tls_port
@@ -916,8 +916,8 @@ run ActionCable.server
916916

917917
Then to start the server:
918918

919-
```
920-
bundle exec puma -p 28080 cable/config.ru
919+
```bash
920+
$ bundle exec puma -p 28080 cable/config.ru
921921
```
922922

923923
This starts a cable server on port 28080. To tell Rails to use this

guides/source/active_record_querying.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ Customer.where(id: 1).joins(:orders).explain
24632463

24642464
may yield
24652465

2466-
```
2466+
```sql
24672467
EXPLAIN SELECT `customers`.* FROM `customers` INNER JOIN `orders` ON `orders`.`customer_id` = `customers`.`id` WHERE `customers`.`id` = 1
24682468
+----+-------------+------------+-------+---------------+
24692469
| id | select_type | table | type | possible_keys |
@@ -2487,7 +2487,7 @@ Active Record performs a pretty printing that emulates that of the
24872487
corresponding database shell. So, the same query running with the
24882488
PostgreSQL adapter would yield instead
24892489

2490-
```
2490+
```sql
24912491
EXPLAIN SELECT "customers".* FROM "customers" INNER JOIN "orders" ON "orders"."customer_id" = "customers"."id" WHERE "customers"."id" = $1 [["id", 1]]
24922492
QUERY PLAN
24932493
------------------------------------------------------------------------------
@@ -2511,7 +2511,7 @@ Customer.where(id: 1).includes(:orders).explain
25112511

25122512
may yield this for MySQL and MariaDB:
25132513

2514-
```
2514+
```sql
25152515
EXPLAIN SELECT `customers`.* FROM `customers` WHERE `customers`.`id` = 1
25162516
+----+-------------+-----------+-------+---------------+
25172517
| id | select_type | table | type | possible_keys |
@@ -2544,7 +2544,7 @@ EXPLAIN SELECT `orders`.* FROM `orders` WHERE `orders`.`customer_id` IN (1)
25442544

25452545
and may yield this for PostgreSQL:
25462546

2547-
```
2547+
```sql
25482548
Customer Load (0.3ms) SELECT "customers".* FROM "customers" WHERE "customers"."id" = $1 [["id", 1]]
25492549
Order Load (0.3ms) SELECT "orders".* FROM "orders" WHERE "orders"."customer_id" = $1 [["customer_id", 1]]
25502550
=> EXPLAIN SELECT "customers".* FROM "customers" WHERE "customers"."id" = $1 [["id", 1]]

guides/source/api_documentation_guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ When documenting the behavior for IRB, Ruby's interactive REPL, always prefix co
179179

180180
For example,
181181

182-
```
182+
```irb
183183
# Find the customer with primary key (id) 10.
184184
# irb> customer = Customer.find(10)
185185
# # => #<Customer id: 10, first_name: "Ryan">
@@ -189,7 +189,7 @@ For example,
189189

190190
For command-line examples, always prefix the command with `$`, the output doesn't have to be prefixed with anything.
191191

192-
```
192+
```bash
193193
# Run the following command:
194194
# $ bin/rails new zomg
195195
# ...

guides/source/autoloading_and_reloading_constants.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,8 +603,8 @@ When Rails boots, engine directories are added to the autoload paths, and from t
603603

604604
For example, this application uses [Devise](https://github.com/heartcombo/devise):
605605

606-
```
607-
% bin/rails runner 'pp ActiveSupport::Dependencies.autoload_paths'
606+
```bash
607+
$ bin/rails runner 'pp ActiveSupport::Dependencies.autoload_paths'
608608
[".../app/controllers",
609609
".../app/controllers/concerns",
610610
".../app/helpers",
@@ -632,8 +632,8 @@ Testing
632632

633633
The task `zeitwerk:check` checks if the project tree follows the expected naming conventions and it is handy for manual checks. For example, if you're migrating from `classic` to `zeitwerk` mode, or if you're fixing something:
634634

635-
```
636-
% bin/rails zeitwerk:check
635+
```bash
636+
$ bin/rails zeitwerk:check
637637
Hold on, I am eager loading the application.
638638
All is good!
639639
```

guides/source/classic_to_zeitwerk_howto.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ How to Verify The Application Runs in `zeitwerk` Mode?
8888

8989
To verify the application is running in `zeitwerk` mode, execute
9090

91-
```
92-
bin/rails runner 'p Rails.autoloaders.zeitwerk_enabled?'
91+
```bash
92+
$ bin/rails runner 'p Rails.autoloaders.zeitwerk_enabled?'
9393
```
9494

9595
If that prints `true`, `zeitwerk` mode is enabled.
@@ -119,14 +119,14 @@ config.eager_load_paths << "#{Rails.root}/extras"
119119

120120
Once `zeitwerk` mode is enabled and the configuration of eager load paths double-checked, please run:
121121

122-
```
123-
bin/rails zeitwerk:check
122+
```bash
123+
$ bin/rails zeitwerk:check
124124
```
125125

126126
A successful check looks like this:
127127

128-
```
129-
% bin/rails zeitwerk:check
128+
```bash
129+
$ bin/rails zeitwerk:check
130130
Hold on, I am eager loading the application.
131131
All is good!
132132
```
@@ -141,8 +141,8 @@ If there's one constant reported, fix that particular one and run the task again
141141

142142
Take for example:
143143

144-
```
145-
% bin/rails zeitwerk:check
144+
```bash
145+
$ bin/rails zeitwerk:check
146146
Hold on, I am eager loading the application.
147147
expected file app/models/vat.rb to define constant Vat
148148
```
@@ -177,8 +177,8 @@ With this option you have more control, because only files called exactly `vat.r
177177

178178
With that in place, the check passes!
179179

180-
```
181-
% bin/rails zeitwerk:check
180+
```bash
181+
$ bin/rails zeitwerk:check
182182
Hold on, I am eager loading the application.
183183
All is good!
184184
```

guides/source/contributing_to_ruby_on_rails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ You should add an entry **to the top** of the CHANGELOG of the framework you mod
530530

531531
A CHANGELOG entry should summarize what was changed and should end with the author's name. You can use multiple lines if you need more space, and you can attach code examples indented with 4 spaces. If a change is related to a specific issue, you should attach the issue's number. Here is an example CHANGELOG entry:
532532

533-
```
533+
```markdown
534534
* Summary of a change that briefly describes what was changed. You can use multiple
535535
lines and wrap them at around 80 characters. Code examples are ok, too, if needed:
536536

@@ -668,7 +668,7 @@ understanding why the change was made, so please take the time to write it.
668668

669669
A good commit message looks like this:
670670

671-
```
671+
```markdown
672672
Short summary (ideally 50 characters or less)
673673

674674
More detailed description, if necessary. Each line should wrap at

guides/source/debugging_rails_applications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Adding extra logging like this makes it easy to search for unexpected or unusual
208208

209209
When looking at database query output in logs, it may not be immediately clear why multiple database queries are triggered when a single method is called:
210210

211-
```
211+
```irb
212212
irb(main):001:0> Article.pamplemousse
213213
Article Load (0.4ms) SELECT "articles".* FROM "articles"
214214
Comment Load (0.2ms) SELECT "comments".* FROM "comments" WHERE "comments"."article_id" = ? [["article_id", 1]]
@@ -219,7 +219,7 @@ irb(main):001:0> Article.pamplemousse
219219

220220
After running `ActiveRecord.verbose_query_logs = true` in the `bin/rails console` session to enable verbose query logs and running the method again, it becomes obvious what single line of code is generating all these discrete database calls:
221221

222-
```
222+
```irb
223223
irb(main):003:0> Article.pamplemousse
224224
Article Load (0.2ms) SELECT "articles".* FROM "articles"
225225
↳ app/models/article.rb:5

guides/source/development_dependencies_install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ If both `[email protected]` and `openssl@3` are installed, you will need to tell Ruby
100100

101101
In your `.bash_profile` set the `PATH` and `RUBY_CONFIGURE_OPTS` to point to `[email protected]`:
102102

103-
```
103+
```sh
104104
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
105105
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
106106
```

guides/source/plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ end
146146
147147
To test that your method does what it says it does, run the unit tests with `bin/test` from your plugin directory.
148148
149-
```
149+
```bash
150150
$ bin/test
151151
...
152152
2 runs, 2 assertions, 0 failures, 0 errors, 0 skips

0 commit comments

Comments
 (0)