Skip to content

Commit cbae2ae

Browse files
author
José Valim
committed
Remove m/0 helper
The goal is to come up with a general IEx module for runtime statistics.
1 parent 66e0c53 commit cbae2ae

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

lib/iex/lib/iex/helpers.ex

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ defmodule IEx.Helpers do
2020
* `l/1` — loads the given module's beam code and purges the current version
2121
* `ls/0` — lists the contents of the current directory
2222
* `ls/1` — lists the contents of the specified directory
23-
* `m/0` — prints loaded modules
2423
* `pwd/0` — prints the current working directory
2524
* `r/1` — recompiles and reloads the given module's source file
2625
* `respawn/0` — respawns the current shell
@@ -98,22 +97,6 @@ defmodule IEx.Helpers do
9897
dont_display_result
9998
end
10099

101-
@doc """
102-
Prints the list of all loaded modules with paths to
103-
their corresponding `.beam` files.
104-
"""
105-
def m do
106-
all = Enum.map :code.all_loaded, fn { mod, file } -> { inspect(mod), file } end
107-
sorted = Enum.sort all
108-
size = Enum.reduce sorted, 0, fn({ mod, _ }, acc) -> max(byte_size(mod), acc) end
109-
format = "~-#{size}s ~ts~n"
110-
111-
Enum.each sorted, fn({ mod, file }) ->
112-
:io.format(format, [mod, file])
113-
end
114-
dont_display_result
115-
end
116-
117100
@doc """
118101
Prints the documentation for `IEx.Helpers`.
119102
"""

lib/iex/test/iex/helpers_test.exs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -179,20 +179,6 @@ defmodule IEx.HelpersTest do
179179
end
180180
end
181181

182-
test "m helper" do
183-
regexes = [
184-
%r/^:application\s+.+application\.beam$/,
185-
%r/^:code\s+.+code\.beam$/,
186-
%r/^Kernel\s+.+Elixir\.Kernel\.beam$/,
187-
]
188-
189-
assert Enum.count(capture_io(fn -> m end) |> String.split("\n"), fn line ->
190-
Enum.any? regexes, fn re ->
191-
Regex.match? re, line
192-
end
193-
end) >= 2
194-
end
195-
196182
test "c helper" do
197183
assert_raise UndefinedFunctionError, "undefined function: Sample.run/0", fn ->
198184
Sample.run

0 commit comments

Comments
 (0)