Skip to content

Commit

Permalink
remove excess debugging code from parse_json/0 #19
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Mar 26, 2020
1 parent 8ee2715 commit 2d47f13
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/quotes.ex
Expand Up @@ -30,23 +30,17 @@ defmodule Quotes do
"""
def parse_json do
{:ok, cwd} = File.cwd
IO.inspect(cwd, label: "cwd 33")
# we need this cd to locate the file in /deps
case cwd =~ "/quotes" do
# coveralls-ignore-start
true ->
File.read!("quotes.json") |> Jason.decode!()
# coveralls-ignore-start
false -> # temporarily cd into deps/quotes dir and read quotes.json file:
File.cd!("deps/quotes")
{:ok, cwd} = File.cwd
IO.inspect(cwd, label: "cwd 42")

data = File.read!("quotes.json")
|> Jason.decode!()

File.cd!("../..")
{:ok, cwd} = File.cwd
IO.inspect(cwd, label: "cwd 49")
data
# coveralls-ignore-stop
end
Expand Down

0 comments on commit 2d47f13

Please sign in to comment.