Use heredoc-style for longer blocks of text in Display
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
defmodule Display do
|
defmodule Display do
|
||||||
alias IO.ANSI
|
alias IO.ANSI
|
||||||
|
|
||||||
@current_dir File.cwd!
|
|
||||||
@no_value :ex_unit_no_meaningful_value
|
@no_value :ex_unit_no_meaningful_value
|
||||||
@progress_bar_length 30
|
@progress_bar_length 30
|
||||||
|
|
||||||
@@ -22,15 +21,17 @@ defmodule Display do
|
|||||||
defp name(module), do: name(Atom.to_string(module))
|
defp name(module), do: name(Atom.to_string(module))
|
||||||
|
|
||||||
def show_failure(failure, module, name) do
|
def show_failure(failure, module, name) do
|
||||||
IO.puts("Now meditate upon #{format_module(module)}")
|
IO.puts(format(failure, module, name))
|
||||||
IO.puts(progress_bar(Tracker.summarize))
|
|
||||||
IO.puts(bar())
|
|
||||||
IO.puts(name)
|
|
||||||
IO.puts(format_failure(failure))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp bar() do
|
def format(failure, module, name) do
|
||||||
"----------------------------------------"
|
"""
|
||||||
|
Now meditate upon #{format_module(module)}
|
||||||
|
#{progress_bar(Tracker.summarize)}
|
||||||
|
----------------------------------------
|
||||||
|
#{name}
|
||||||
|
#{format_failure(failure)}
|
||||||
|
"""
|
||||||
end
|
end
|
||||||
|
|
||||||
def progress_bar(%{current: current, total: total}) do
|
def progress_bar(%{current: current, total: total}) do
|
||||||
@@ -54,8 +55,7 @@ defmodule Display do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def congratulate do
|
def congratulate do
|
||||||
Colours.green("\nYou have learned much. You must find your own path now.")
|
IO.puts(Colours.green("\nYou have learned much. You must find your own path now."))
|
||||||
|> IO.puts
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def clear_screen do
|
def clear_screen do
|
||||||
|
|||||||
Reference in New Issue
Block a user