cover/Elixir.Utils.World.html| 1 | defmodule Utils.World do |
|
| 2 | import Enum, only: [map: 2, sort: 1, filter: 2] |
|
| 3 | import File, only: [ls: 1] |
|
| 4 | import Path, only: [basename: 2] |
|
| 5 | import String, only: [ends_with?: 2] |
|
| 6 | |
|
| 7 | def agents do |
|
| 8 | "." |
|
| 9 | |> ls() |
|
| 10 | |> markdown() |
|
| 11 | 90 | |> sort() |
| 12 | end |
|
| 13 | |
|
| 14 | defp markdown({:ok, files}) do |
|
| 15 | files |
|
| 16 | 360 | |> filter(&ends_with?(&1, ".md")) |
| 17 | 90 | |> map(&basename(&1, ".md")) |
| 18 | end |
|
| 19 | |
|
| 20 | :-( |
defp markdown({:error, _}) do |
| 21 | [] |
|
| 22 | end |
|
| 23 | end |
|
| Line | Hits | Source |
|---|