Skip to content

Commit c775ed6

Browse files
authored
Merge pull request #160 from codecrafters-io/andy/refactor-elixir
Update main module reference in Elixir project files
2 parents d0bfebb + db52f9a commit c775ed6

File tree

7 files changed

+4
-24
lines changed

7 files changed

+4
-24
lines changed

compiled_starters/elixir/lib/main.ex

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ defmodule Server do
1616
# {:ok, socket} = :gen_tcp.listen(4221, [:binary, active: false, reuseaddr: true])
1717
# {:ok, _client} = :gen_tcp.accept(socket)
1818
end
19-
end
2019

21-
defmodule CLI do
2220
def main(_args) do
23-
# Start the Server application
2421
{:ok, _pid} = Application.ensure_all_started(:codecrafters_http_server)
25-
26-
# Run forever
2722
Process.sleep(:infinity)
2823
end
2924
end

compiled_starters/elixir/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule App.MixProject do
99
elixir: "~> 1.18",
1010
start_permanent: Mix.env() == :prod,
1111
deps: deps(),
12-
escript: [main_module: CLI]
12+
escript: [main_module: Server]
1313
]
1414
end
1515

solutions/elixir/01-at4/code/lib/main.ex

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@ defmodule Server do
1111
{:ok, socket} = :gen_tcp.listen(4221, [:binary, active: false, reuseaddr: true])
1212
{:ok, _client} = :gen_tcp.accept(socket)
1313
end
14-
end
1514

16-
defmodule CLI do
1715
def main(_args) do
18-
# Start the Server application
1916
{:ok, _pid} = Application.ensure_all_started(:codecrafters_http_server)
20-
21-
# Run forever
2217
Process.sleep(:infinity)
2318
end
2419
end

solutions/elixir/01-at4/code/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule App.MixProject do
99
elixir: "~> 1.18",
1010
start_permanent: Mix.env() == :prod,
1111
deps: deps(),
12-
escript: [main_module: CLI]
12+
escript: [main_module: Server]
1313
]
1414
end
1515

solutions/elixir/01-at4/diff/lib/main.ex.diff

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -1,29 +1,24 @@
1+
@@ -1,24 +1,19 @@
22
defmodule Server do
33
use Application
44

@@ -21,14 +21,9 @@
2121
+ {:ok, socket} = :gen_tcp.listen(4221, [:binary, active: false, reuseaddr: true])
2222
+ {:ok, _client} = :gen_tcp.accept(socket)
2323
end
24-
end
2524

26-
defmodule CLI do
2725
def main(_args) do
28-
# Start the Server application
2926
{:ok, _pid} = Application.ensure_all_started(:codecrafters_http_server)
30-
31-
# Run forever
3227
Process.sleep(:infinity)
3328
end
3429
end

starter_templates/elixir/code/lib/main.ex

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,9 @@ defmodule Server do
1616
# {:ok, socket} = :gen_tcp.listen(4221, [:binary, active: false, reuseaddr: true])
1717
# {:ok, _client} = :gen_tcp.accept(socket)
1818
end
19-
end
2019

21-
defmodule CLI do
2220
def main(_args) do
23-
# Start the Server application
2421
{:ok, _pid} = Application.ensure_all_started(:codecrafters_http_server)
25-
26-
# Run forever
2722
Process.sleep(:infinity)
2823
end
2924
end

starter_templates/elixir/code/mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule App.MixProject do
99
elixir: "~> 1.18",
1010
start_permanent: Mix.env() == :prod,
1111
deps: deps(),
12-
escript: [main_module: CLI]
12+
escript: [main_module: Server]
1313
]
1414
end
1515

0 commit comments

Comments
 (0)