TRAVIS_OS_NAME=linux 1.10.3=.10.3 <<<<<< ENV .formatter.exs LICENSE Procfile assets/.babelrc assets/css/app.scss assets/css/phoenix.css assets/css/todomvc-app.css assets/js/app.js assets/js/socket.js assets/package.json assets/static/favicon.ico assets/webpack.config.js config/config.exs config/dev.exs config/prod.exs config/prod.secret.exs config/test.exs coveralls.json elixir_buildpack.config lib/app.ex lib/app/application.ex lib/app/repo.ex lib/app/todo.ex lib/app/todo/item.ex lib/app_web.ex lib/app_web/channels/user_socket.ex lib/app_web/controllers/item_controller.ex lib/app_web/controllers/ping_controller.ex lib/app_web/endpoint.ex lib/app_web/gettext.ex lib/app_web/router.ex lib/app_web/telemetry.ex lib/app_web/templates/item/edit.html.eex lib/app_web/templates/item/form.html.eex lib/app_web/templates/item/index.html.eex lib/app_web/templates/item/new.html.eex lib/app_web/templates/item/show.html.eex lib/app_web/templates/layout/app.html.eex lib/app_web/views/error_helpers.ex lib/app_web/views/error_view.ex lib/app_web/views/item_view.ex lib/app_web/views/layout_view.ex mix.exs mix.lock phoenix_static_buildpack.config priv/gettext/en/LC_MESSAGES/errors.po priv/gettext/errors.pot priv/repo/migrations/.formatter.exs priv/repo/migrations/20200521145424_create_items.exs priv/repo/seeds.exs test/app/todo_test.exs test/app_web/controllers/item_controller_test.exs test/app_web/controllers/ping_controller_test.exs test/app_web/views/error_view_test.exs test/app_web/views/item_view_test.exs test/app_web/views/layout_view_test.exs test/app_web/views/page_view_test.exs test/support/channel_case.ex test/support/conn_case.ex test/support/data_case.ex test/test_helper.exs <<<<<< network # path=./cover/excoveralls.json {"source_files":[{"coverage":[null,null,null,null,null,null,null,null,null],"name":"lib/app.ex","source":"defmodule App do\n @moduledoc \"\"\"\n App keeps the contexts that define your domain\n and business logic.\n\n Contexts are also responsible for managing your data, regardless\n if it comes from the database, an external API or others.\n \"\"\"\nend"},{"coverage":[null,null,null,null,null],"name":"lib/app/repo.ex","source":"defmodule App.Repo do\n use Ecto.Repo,\n otp_app: :app,\n adapter: Ecto.Adapters.Postgres\nend"},{"coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,13,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,17,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,1,null,null,null,null,null,null,null,null,null,null,null,null,7,null,null],"name":"lib/app/todo.ex","source":"defmodule App.Todo do\n @moduledoc \"\"\"\n The Todo context.\n \"\"\"\n\n import Ecto.Query, warn: false\n alias App.Repo\n\n alias App.Todo.Item\n\n @doc \"\"\"\n Returns the list of items.\n\n ## Examples\n\n iex> list_items()\n [%Item{}, ...]\n\n \"\"\"\n def list_items do\n Item |> order_by(asc: :id) |> Repo.all()\n end\n\n @doc \"\"\"\n Gets a single item.\n\n Raises `Ecto.NoResultsError` if the Item does not exist.\n\n ## Examples\n\n iex> get_item!(123)\n %Item{}\n\n iex> get_item!(456)\n ** (Ecto.NoResultsError)\n\n \"\"\"\n def get_item!(id), do: Repo.get!(Item, id)\n\n @doc \"\"\"\n Creates a item.\n\n ## Examples\n\n iex> create_item(%{field: value})\n {:ok, %Item{}}\n\n iex> create_item(%{field: bad_value})\n {:error, %Ecto.Changeset{}}\n\n \"\"\"\n def create_item(attrs \\\\ %{}) do\n %Item{}\n |> Item.changeset(attrs)\n |> Repo.insert()\n end\n\n @doc \"\"\"\n Updates a item.\n\n ## Examples\n\n iex> update_item(item, %{field: new_value})\n {:ok, %Item{}}\n\n iex> update_item(item, %{field: bad_value})\n {:error, %Ecto.Changeset{}}\n\n \"\"\"\n def update_item(%Item{} = item, attrs) do\n item\n |> Item.changeset(attrs)\n |> Repo.update()\n end\n\n @doc \"\"\"\n Deletes a item.\n\n ## Examples\n\n iex> delete_item(item)\n {:ok, %Item{}}\n\n iex> delete_item(item)\n {:error, %Ecto.Changeset{}}\n\n \"\"\"\n def delete_item(%Item{} = item) do\n Repo.delete(item)\n end\n\n @doc \"\"\"\n Returns an `%Ecto.Changeset{}` for tracking item changes.\n\n ## Examples\n\n iex> change_item(item)\n %Ecto.Changeset{data: %Item{}}\n\n \"\"\"\n def change_item(%Item{} = item, attrs \\\\ %{}) do\n Item.changeset(item, attrs)\n end\nend"},{"coverage":[null,null,null,null,34,null,null,null,null,null,null,null,null,null,null,null,31,null,null],"name":"lib/app/todo/item.ex","source":"defmodule App.Todo.Item do\n use Ecto.Schema\n import Ecto.Changeset\n\n schema \"items\" do\n field :person_id, :integer, default: 0\n field :status, :integer, default: 0\n field :text, :string\n\n timestamps()\n end\n\n @doc false\n def changeset(item, attrs) do\n item\n |> cast(attrs, [:text, :person_id, :status])\n |> validate_required([:text])\n end\nend"},{"coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"name":"lib/app_web/channels/user_socket.ex","source":"defmodule AppWeb.UserSocket do\n use Phoenix.Socket\n\n ## Channels\n # channel \"room:*\", AppWeb.RoomChannel\n\n # Socket params are passed from the client and can\n # be used to verify and authenticate a user. After\n # verification, you can put default assigns into\n # the socket that will be set for all channels, ie\n #\n # {:ok, assign(socket, :user_id, verified_user_id)}\n #\n # To deny connection, return `:error`.\n #\n # See `Phoenix.Token` documentation for examples in\n # performing token verification on connect.\n @impl true\n def connect(_params, socket, _connect_info) do\n {:ok, socket}\n end\n\n # Socket id's are topics that allow you to identify all sockets for a given user:\n #\n # def id(socket), do: \"user_socket:#{socket.assigns.user_id}\"\n #\n # Would allow you to broadcast a \"disconnect\" event and terminate\n # all active sockets and channels for a given user:\n #\n # AppWeb.Endpoint.broadcast(\"user_socket:#{user.id}\", \"disconnect\", %{})\n #\n # Returning `nil` makes this socket anonymous.\n @impl true\n def id(_socket), do: nil\nend"},{"coverage":[null,null,null,null,null,null,null,5,5,1,null,4,null,null,5,5,null,5,null,null,null,null,null,null,null,null,1,1,null,null,null,2,null,null,null,1,null,null,1,null,null,null,null,2,2,null,null,null,1,null,null,null,2,null,2,null,null,null,1,null,null,1,null,null,null,null,1,1,1,null,null,null,4,null,null,null,null,null,null,2,2,2,null,null,null,null,null,null,1,1,1,null,1,null,null],"name":"lib/app_web/controllers/item_controller.ex","source":"defmodule AppWeb.ItemController do\n use AppWeb, :controller\n\n alias App.Todo\n alias App.Todo.Item\n\n def index(conn, params) do\n item =\n if not is_nil(params) and Map.has_key?(params, \"id\") do\n Todo.get_item!(params[\"id\"])\n else\n %Item{}\n end\n\n items = Todo.list_items()\n changeset = Todo.change_item(item)\n\n render(conn, \"index.html\",\n items: items,\n changeset: changeset,\n editing: item,\n filter: Map.get(params, \"filter\", \"all\")\n )\n end\n\n def new(conn, _params) do\n changeset = Todo.change_item(%Item{})\n render(conn, \"new.html\", changeset: changeset)\n end\n\n def create(conn, %{\"item\" => item_params}) do\n case Todo.create_item(item_params) do\n {:ok, _item} ->\n conn\n |> put_flash(:info, \"Item created successfully.\")\n |> redirect(to: Routes.item_path(conn, :index))\n\n {:error, %Ecto.Changeset{} = changeset} ->\n render(conn, \"new.html\", changeset: changeset)\n end\n end\n\n def show(conn, %{\"id\" => id}) do\n item = Todo.get_item!(id)\n render(conn, \"show.html\", item: item)\n end\n\n def edit(conn, params) do\n index(conn, params)\n end\n\n def update(conn, %{\"id\" => id, \"item\" => item_params}) do\n item = Todo.get_item!(id)\n\n case Todo.update_item(item, item_params) do\n {:ok, _item} ->\n conn\n # |> put_flash(:info, \"Item updated successfully.\")\n |> redirect(to: Routes.item_path(conn, :index))\n\n {:error, %Ecto.Changeset{} = changeset} ->\n render(conn, \"edit.html\", item: item, changeset: changeset)\n end\n end\n\n def delete(conn, %{\"id\" => id}) do\n item = Todo.get_item!(id)\n Todo.update_item(item, %{status: 2})\n index(conn, %{})\n end\n\n def toggle_status(item) do\n case item.status do\n 1 -> 0\n 0 -> 1\n end\n end\n\n def toggle(conn, %{\"id\" => id}) do\n item = Todo.get_item!(id)\n Todo.update_item(item, %{status: toggle_status(item)})\n redirect(conn, to: Routes.item_path(conn, :index))\n end\n\n import Ecto.Query\n alias App.Repo\n\n def clear_completed(conn, _param) do\n person_id = 0\n query = from(i in Item, where: i.person_id == ^person_id, where: i.status == 1)\n Repo.update_all(query, set: [status: 2])\n # render the main template:\n index(conn, %{filter: \"all\"})\n end\nend"},{"coverage":[null,null,null,null,null,1,null,null],"name":"lib/app_web/controllers/ping_controller.ex","source":"defmodule AppWeb.PingController do\n use AppWeb, :controller\n\n # see: github.com/dwyl/ping\n def ping(conn, params) do\n Ping.render_pixel(conn, params)\n end\nend"},{"coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"name":"lib/app_web/endpoint.ex","source":"defmodule AppWeb.Endpoint do\n use Phoenix.Endpoint, otp_app: :app\n\n # The session will be stored in the cookie and signed,\n # this means its contents can be read but not tampered with.\n # Set :encryption_salt if you would also like to encrypt it.\n @session_options [\n store: :cookie,\n key: \"_app_key\",\n signing_salt: \"EaSsAcnS\"\n ]\n\n socket \"/socket\", AppWeb.UserSocket,\n websocket: [timeout: 45_000],\n longpoll: false\n\n socket \"/live\", Phoenix.LiveView.Socket, websocket: [connect_info: [session: @session_options]]\n\n # Serve at \"/\" the static files from \"priv/static\" directory.\n #\n # You should set gzip to true if you are running phx.digest\n # when deploying your static files in production.\n plug Plug.Static,\n at: \"/\",\n from: :app,\n gzip: false,\n only: ~w(css fonts images js favicon.ico robots.txt)\n\n # Code reloading can be explicitly enabled under the\n # :code_reloader configuration of your endpoint.\n if code_reloading? do\n socket \"/phoenix/live_reload/socket\", Phoenix.LiveReloader.Socket\n plug Phoenix.LiveReloader\n plug Phoenix.CodeReloader\n plug Phoenix.Ecto.CheckRepoStatus, otp_app: :app\n end\n\n plug Phoenix.LiveDashboard.RequestLogger,\n param_key: \"request_logger\",\n cookie_key: \"request_logger\"\n\n plug Plug.RequestId\n plug Plug.Telemetry, event_prefix: [:phoenix, :endpoint]\n\n plug Plug.Parsers,\n parsers: [:urlencoded, :multipart, :json],\n pass: [\"*/*\"],\n json_decoder: Phoenix.json_library()\n\n plug Plug.MethodOverride\n plug Plug.Head\n plug Plug.Session, @session_options\n plug AppWeb.Router\nend"},{"coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"name":"lib/app_web/gettext.ex","source":"defmodule AppWeb.Gettext do\n @moduledoc \"\"\"\n A module providing Internationalization with a gettext-based API.\n\n By using [Gettext](https://hexdocs.pm/gettext),\n your module gains a set of macros for translations, for example:\n\n import AppWeb.Gettext\n\n # Simple translation\n gettext(\"Here is the string to translate\")\n\n # Plural translation\n ngettext(\"Here is the string to translate\",\n \"Here are the strings to translate\",\n 3)\n\n # Domain-based translation\n dgettext(\"errors\", \"Here is the error message to translate\")\n\n See the [Gettext Docs](https://hexdocs.pm/gettext) for detailed usage.\n \"\"\"\n use Gettext, otp_app: :app\nend"},{"coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,2,null,null],"name":"lib/app_web/views/error_view.ex","source":"defmodule AppWeb.ErrorView do\n use AppWeb, :view\n\n # If you want to customize a particular status code\n # for a certain format, you may uncomment below.\n # def render(\"500.html\", _assigns) do\n # \"Internal Server Error\"\n # end\n\n # By default, Phoenix returns the status message from\n # the template name. For example, \"404.html\" becomes\n # \"Not Found\".\n def template_not_found(template, _assigns) do\n Phoenix.Controller.status_message_from_template(template)\n end\nend"},{"coverage":[null,null,null,null,null,4,null,null,null,null,null,null,null,null,4,null,null,null,null,null,null,null,null,13,null,null,null,null,11,5,2,4,null,null,null,null,6,null,null,null,null,null,null,null,null,5,null,null,null,null,null,null,null,5,null,null],"name":"lib/app_web/views/item_view.ex","source":"defmodule AppWeb.ItemView do\n use AppWeb, :view\n\n # add class \"completed\" to a list item if item.status=1\n def complete(item) do\n case item.status do\n 1 -> \"completed\"\n # empty string means empty class so no style applied\n _ -> \"\"\n end\n end\n\n #  add \"checked\" to input if item.status=1\n def checked(item) do\n case item.status do\n 1 -> \"checked\"\n # empty string means empty class so no style applied\n _ -> \"\"\n end\n end\n\n # returns integer value of items where item.status == 0 (not \"done\")\n def remaining_items(items) do\n Enum.filter(items, fn i -> i.status < 1 end) |> Enum.count()\n end\n\n # filter the items based on the filter string\n def filter(items, str) do\n case str do\n \"all\" -> Enum.filter(items, fn i -> i.status == 0 || i.status == 1 end)\n \"active\" -> Enum.filter(items, fn i -> i.status == 0 end)\n \"completed\" -> Enum.filter(items, fn i -> i.status == 1 end)\n end\n end\n\n def selected(filter, str) do\n case filter == str do\n true -> \"selected\"\n false -> \"\"\n end\n end\n\n # pluralise the word item when the number of items is greather/less than 1\n def pluralise(items) do\n # items where status < 1 is equal to Zero or Greater than One:\n case remaining_items(items) == 0 || remaining_items(items) > 1 do\n true -> \"items\"\n false -> \"item\"\n end\n end\n\n # check if there are items with status 0 or 1, used to hide/show footer\n def got_items?(items) do\n Enum.filter(items, fn i -> i.status < 2 end) |> Enum.count() > 0\n end\nend"},{"coverage":[null,null,null],"name":"lib/app_web/views/layout_view.ex","source":"defmodule AppWeb.LayoutView do\n use AppWeb, :view\nend"}]}<<<<<< EOF