Skip to content

Commit e5de237

Browse files
committed
Fix warnings
1 parent 49ecb97 commit e5de237

7 files changed

Lines changed: 15 additions & 16 deletions

File tree

lib/elixir/pages/getting-started/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ dbg(Map.put(feature, :in_version, "1.14.0"))
7777

7878
The code above prints this:
7979

80-
```shell
80+
```text
8181
[my_file.exs:2: (file)]
8282
feature #=> %{inspiration: "Rust", name: :dbg}
8383
[my_file.exs:3: (file)]
@@ -97,7 +97,7 @@ __ENV__.file
9797

9898
This code prints:
9999

100-
```shell
100+
```text
101101
[dbg_pipes.exs:5: (file)]
102102
__ENV__.file #=> "/home/myuser/dbg_pipes.exs"
103103
|> String.split("/", trim: true) #=> ["home", "myuser", "dbg_pipes.exs"]

lib/elixir/pages/mix-and-otp/config-and-distribution.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Now we just need to read this configuration. Open up `lib/kv.ex` and the `start/
5656

5757
Run `iex -S mix` and you will see the following message printed:
5858

59-
```
59+
```text
6060
[info] Accepting connections on port 4050
6161
```
6262

@@ -149,13 +149,13 @@ In other words, we can spawn processes in other nodes, hold to their PIDs, and t
149149

150150
First, let's check that our code is not currently distributed. Start a new node like this:
151151

152-
```
152+
```console
153153
$ PORT=4100 iex --sname foo -S mix
154154
```
155155

156156
And the other like this:
157157

158-
```
158+
```console
159159
$ PORT=4101 iex --sname bar -S mix
160160
```
161161

@@ -280,7 +280,7 @@ Now, in your `start/2` callback, we will add this to of the `start/2` function:
280280

281281
Now we can start our nodes as:
282282

283-
```shell
283+
```console
284284
$ NODES="foo@computer-name,bar@computer-name" PORT=4040 iex --sname foo -S mix
285285
$ NODES="foo@computer-name,bar@computer-name" PORT=4041 iex --sname bar -S mix
286286
```

lib/elixir/pages/mix-and-otp/docs-tests-and-with.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@ defmodule KV.ServerTest do
414414
end
415415
```
416416

417-
418417
Run `mix test` and the tests should all pass. However, make sure to terminate any `iex -S mix` session you may have running, as currently tests and development environment are running on the same port (4040). We will address it in the next chapter.
419418

420419
We added three tests, the first one tests most bucket actions, while the other two deal with error cases. Given there is a lot of shared setup across these tests, we used the `setup/2` macro to deal with common boilerplate. The macro receives the same *test context* as tests and starts a client TCP connection per test. It also defines a unique bucket name using the module name and the test name, making sure any space in the test name is replaced by `-`.
@@ -427,4 +426,4 @@ Then, on each test, we pattern matched on the *test context*, extracting the soc
427426

428427
Except back then we matched on all config and, this time around, we matched only on the data we needed.
429428

430-
Let's move to the next chapter. We will finally make our system distributed by adding a tiny bit of configuration and, *spoiler alert*, changing one line of code.
429+
Let's move to the next chapter. We will finally make our system distributed by adding a tiny bit of configuration and, *spoiler alert*, changing one line of code.

lib/elixir/pages/mix-and-otp/genservers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ To wrap up our distributed key-value store, we will implement a feature where a
99

1010
We will do by adding a new command, called SUBSCRIBE, to be used like this:
1111

12-
```
12+
```text
1313
SUBSCRIBE shopping
1414
milk SET TO 1
1515
eggs SET TO 10

lib/elixir/pages/mix-and-otp/releases.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A release is a self-contained directory that consists of your application code,
1111

1212
To get started, simply run `mix release` while setting `MIX_ENV=prod`:
1313

14-
```
14+
```console
1515
$ MIX_ENV=prod mix release
1616
Compiling 4 files (.ex)
1717
Generated kv app
@@ -78,11 +78,11 @@ Releases also provide built-in hooks for configuring almost every need of the pr
7878

7979
In this case, we already have specified a `config/runtime.exs` that deals with both `PORT` and `NODES` environment variables. Furthermore, while releases don't accept a `--sname` parameter, they do allow us to set the name via the `RELEASE_NODE` env var. Therefore, we can start two copies of the system by jumping into `_build/prod/rel/kv` and typing this (remember to adjust `@computer-name` to your actual computer name):
8080

81-
```shell
81+
```console
8282
$ NODES="foo@computer-name,bar@computer-name" PORT=4040 RELEASE_NODE="foo" bin/kv start_iex
8383
```
8484

85-
```shell
85+
```console
8686
$ NODES="foo@computer-name,bar@computer-name" PORT=4041 RELEASE_NODE="bar" bin/kv start_iex
8787
```
8888

lib/elixir/pages/mix-and-otp/supervisor-and-application.md

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

88
In the [previous chapter](agents.md), we used agents to represent our buckets. In the [introduction to mix](introduction-to-mix.md), we specified we would like to name each bucket so we can do the following:
99

10-
```elixir
10+
```text
1111
CREATE shopping
1212
OK
1313
@@ -145,7 +145,7 @@ end
145145

146146
Now run `mix test` and you will see a couple things happening. First of all, you will get a compilation warning:
147147

148-
```
148+
```text
149149
Compiling 1 file (.ex)
150150
warning: function start/2 required by behaviour Application is not implemented (in module KV)
151151
@@ -159,7 +159,7 @@ This warning is telling us that `use Application` actually defines a behaviour,
159159

160160
Then our application does not even boot because the `start/2` function is not actually implemented:
161161

162-
```
162+
```text
163163
18:29:39.109 [notice] Application kv exited: exited in: KV.start(:normal, [])
164164
** (EXIT) an exception was raised:
165165
** (UndefinedFunctionError) function KV.start/2 is undefined or private

lib/elixir/pages/mix-and-otp/task-and-gen-tcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ My particular telnet client can be exited by typing `ctrl + ]`, typing `quit`, a
109109

110110
Once you exit the telnet client, you will likely see an error in the IEx session:
111111

112-
```
112+
```text
113113
** (MatchError) no match of right hand side value: {:error, :closed}
114114
(kv) lib/kv/server.ex:45: KV.Server.read_line/1
115115
(kv) lib/kv/server.ex:37: KV.Server.serve/1

0 commit comments

Comments
 (0)