From f6e65cdd40f359e0742fba18c81149d1b44b8c96 Mon Sep 17 00:00:00 2001 From: kballou Date: Mon, 31 Oct 2016 03:45:47 -0600 Subject: Trim trailing new line before reversing --- lib/octochat/servers/echo.ex | 1 + mix.exs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/octochat/servers/echo.ex b/lib/octochat/servers/echo.ex index b0bd515..ff25869 100644 --- a/lib/octochat/servers/echo.ex +++ b/lib/octochat/servers/echo.ex @@ -16,6 +16,7 @@ defmodule Octochat.Echo do def handle_info({:tcp, _, msg}, state = %{socket: socket}) do msg + |> String.trim() |> String.reverse() |> write_line!(socket) {:noreply, state} diff --git a/mix.exs b/mix.exs index 15eaf65..da21570 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule Octochat.Mixfile do [app: :octochat, description: "Demo Application for How Swapping Code", package: package(), - version: "0.3.1", + version: "0.3.2", elixir: "~> 1.3", build_embedded: Mix.env == :prod, start_permanent: Mix.env == :prod, -- cgit v1.2.1