Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Commit

Permalink
Update to Elixir 0.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
edgurgel committed Aug 16, 2014
1 parent 1e75046 commit a141a2e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -4,9 +4,9 @@ notifications:
- eduardo@gurgel.me
otp_release:
- 17.0
- 17.1
env:
- ELIXIR="v0.14.2"
- ELIXIR="v0.14.3"
- ELIXIR="v0.15.1"
install: mix deps.get
before_install:
- mkdir -p vendor/elixir
Expand Down
16 changes: 8 additions & 8 deletions lib/tldr.ex
Expand Up @@ -54,27 +54,27 @@ defmodule TLDR do
describe(:common, term)
end
else
response.body |> format
response.body |> format_md
end
end

defp format(markdown) do
defp format_md(markdown) do
String.split(markdown, ~r/\n/)
|> Enum.drop(2)
|> Enum.map(fn(line) ->
format_line(line) <> reset
[[format_line(line) | reset] | "\n"]
end)
|> Enum.join("\n")
|> IO.ANSI.format(true)
end

defp format_line("> " <> line) do
escape(white <> line)
[:white, line]
end
defp format_line("- " <> line) do
escape(green <> line)
[:green, line]
end
defp format_line("`" <> line) do
escape(black_background <> white <> String.rstrip(line, ?`))
[:black_background, :white, String.rstrip(line, ?`)]
end
defp format_line(line), do: line
defp format_line(line), do: [line]
end
6 changes: 3 additions & 3 deletions mix.exs
Expand Up @@ -5,7 +5,7 @@ defmodule TLDR.Mixfile do
[ app: :tldr,
version: "0.0.2",
name: "TLDR",
elixir: "~> 0.14.2",
elixir: "~> 0.15.1",
escript: [ main_module: TLDR],
deps: deps ]
end
Expand All @@ -15,8 +15,8 @@ defmodule TLDR.Mixfile do
end

defp deps do
[ { :httpoison, github: "edgurgel/httpoison", tag: "0.3.0" },
{ :exvcr, "~> 0.2.0", only: :test },
[ { :httpoison, github: "edgurgel/httpoison", tag: "0.3.2" },
{ :exvcr, "~> 0.3.0", only: :test },
{ :meck, "0.8.2", github: "eproxus/meck", override: true, only: :test } ]
end
end
14 changes: 6 additions & 8 deletions mix.lock
@@ -1,10 +1,8 @@
%{"exactor": {:package, "0.5.0"},
"exprintf": {:package, "0.1.2"},
"exvcr": {:package, "0.2.1"},
"hackney": {:git, "git://github.com/benoitc/hackney.git", "cf90543f9cc21ffea34d71035521b0102b8555cf", [ref: "cf90543f9cc21ffea34d71035521b0102b8555cf"]},
"hackney_lib": {:git, "https://github.com/benoitc/hackney_lib.git", "48a5a3fc64892c95e4e3efdd464f26ca5683d2f9", [tag: "0.3.0"]},
"httpoison": {:git, "git://github.com/edgurgel/httpoison.git", "9e050f1f76900f08f5b258b09aaba8ae42f6d624", [tag: "0.3.0"]},
%{"exactor": {:package, "0.6.0"},
"exvcr": {:package, "0.3.0"},
"hackney": {:git, "git://github.com/benoitc/hackney.git", "fd2158b39b0aa139bb90f0c867f246ddfec072e6", [tag: "0.13.0"]},
"httpoison": {:git, "git://github.com/edgurgel/httpoison.git", "bca6f74e138c18dd8d3dd92b0e71e16e2f5f546a", [tag: "0.3.2"]},
"idna": {:git, "git://github.com/benoitc/erlang-idna.git", "21aa158b7f36bf2a000f12fe40d7f21eece9cf65", [tag: "hackney-0.11.2"]},
"jsex": {:package, "2.0.0"},
"jsx": {:package, "2.0.2"},
"meck": {:git, "git://github.com/eproxus/meck.git", "2eb19524a0cf33a0fc67fed766679c93d363ceee", []}}
"jsx": {:package, "2.0.4"},
"meck": {:git, "git://github.com/eproxus/meck.git", "63187e58559024354ecf354338065a973caa3b22", []}}

0 comments on commit a141a2e

Please sign in to comment.