Skip to content

Commit fca4e84

Browse files
committed
Update dependencies
1 parent e9ecd90 commit fca4e84

6 files changed

Lines changed: 30 additions & 24 deletions

File tree

.formatter.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[
22
inputs: [
3-
"lib/**/*.{ex,exs}",
4-
"test/**/*.{ex,exs}",
3+
"{lib, test}/**/*.{ex,exs}",
54
"mix.exs"
65
]
76
]

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ help:
55
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
66

77
.PHONY: format
8-
format: ## Format the whole codabase with the upcoming formatter
9-
@docker run \
10-
--rm --name elixir_dev -it \
11-
-v $(shell pwd):/app leifg/elixir:edge \
12-
sh -c "cd /app && mix format ${FILE}"
8+
format: ## Format code
9+
@mix format
10+
11+
.PHONY: test
12+
test: ## Format code
13+
@mix test
1314

1415
.PHONY: publish-package
1516
publish-package: ## Publish the package

lib/telegram_logger_backend/formatter.ex

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ defmodule LoggerTelegramBackend.Formatter do
4444
defp format_message(msg) do
4545
msg
4646
|> to_string
47+
|> String.trim()
4748
|> escape_special_chars()
48-
|> String.split("\n")
4949
|> highlight_title()
50-
|> Enum.join("\n")
51-
|> String.trim()
5250
end
5351

5452
defp escape_special_chars(msg) do
@@ -63,8 +61,15 @@ defmodule LoggerTelegramBackend.Formatter do
6361
end)
6462
end
6563

66-
defp highlight_title([title]), do: ["<b>#{title}</b>"]
67-
defp highlight_title([title | rest]), do: ["<b>#{title}</b>"] ++ rest
64+
defp highlight_title(msg) do
65+
msg
66+
|> String.split("\n")
67+
|> do_highlight_title()
68+
|> Enum.join("\n")
69+
end
70+
71+
defp do_highlight_title([title]), do: ["<b>#{title}</b>"]
72+
defp do_highlight_title([title | rest]), do: ["<b>#{title}</b>"] ++ rest
6873

6974
defp format_metadata(metadata) do
7075
metadata

mix.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule LoggerTelegramBackend.Mixfile do
44
def project do
55
[
66
app: :logger_telegram_backend,
7-
version: "1.0.0",
7+
version: "1.0.1",
88
elixir: "~> 1.5",
99
start_permanent: Mix.env() == :prod,
1010
deps: deps(),
@@ -28,9 +28,9 @@ defmodule LoggerTelegramBackend.Mixfile do
2828

2929
defp deps do
3030
[
31-
{:ex_doc, "~> 0.16", only: :dev, runtime: false},
32-
{:exvcr, "~> 0.8", only: :test},
33-
{:gen_stage, "~> 0.12"},
31+
{:ex_doc, "~> 0.18", only: :dev, runtime: false},
32+
{:exvcr, "~> 0.10", only: :test},
33+
{:gen_stage, "~> 0.13"},
3434
{:httpoison, "~> 0.13"},
3535
{:poison, "~> 3.1"}
3636
]

mix.lock

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
1-
%{"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], [], "hexpm"},
1+
%{
2+
"certifi": {:hex, :certifi, "2.0.0", "a0c0e475107135f76b8c1d5bc7efb33cd3815cb3cf3dea7aefdd174dabead064", [:rebar3], [], "hexpm"},
23
"earmark": {:hex, :earmark, "1.2.4", "99b637c62a4d65a20a9fb674b8cffb8baa771c04605a80c911c4418c69b75439", [:mix], [], "hexpm"},
3-
"ex_doc": {:hex, :ex_doc, "0.18.1", "37c69d2ef62f24928c1f4fdc7c724ea04aecfdf500c4329185f8e3649c915baf", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
4+
"ex_doc": {:hex, :ex_doc, "0.18.2", "993e0a95e9fbb790ac54ea58e700b45b299bd48bc44b4ae0404f28161f37a83e", [:mix], [{:earmark, "~> 1.1", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
45
"exactor": {:hex, :exactor, "2.2.4", "5efb4ddeb2c48d9a1d7c9b465a6fffdd82300eb9618ece5d34c3334d5d7245b1", [:mix], [], "hexpm"},
56
"exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm"},
6-
"exvcr": {:hex, :exvcr, "0.9.1", "31e3936a790a14bf56b31b6b276577076a5ef8afd9b2d53ba3ff8bb647d45613", [:mix], [{:exactor, "~> 2.2", [hex: :exactor, repo: "hexpm", optional: false]}, {:exjsx, "~> 4.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:httpoison, "~> 0.13", [hex: :httpoison, repo: "hexpm", optional: true]}, {:httpotion, "~> 3.0", [hex: :httpotion, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"},
7-
"gen_stage": {:hex, :gen_stage, "0.13.0", "09c85d9939d4dce88e8819fd235ce411990abaf1bc24bd5a824e851439aedc15", [:mix], [], "hexpm"},
8-
"hackney": {:hex, :hackney, "1.10.1", "c38d0ca52ea80254936a32c45bb7eb414e7a96a521b4ce76d00a69753b157f21", [:rebar3], [{:certifi, "2.0.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
7+
"exvcr": {:hex, :exvcr, "0.10.0", "5150808404d9f48dbda636f70f7f8fefd93e2433cd39f695f810e73b3a9d1736", [:mix], [{:exactor, "~> 2.2", [hex: :exactor, repo: "hexpm", optional: false]}, {:exjsx, "~> 4.0", [hex: :exjsx, repo: "hexpm", optional: false]}, {:httpoison, "~> 0.13", [hex: :httpoison, repo: "hexpm", optional: true]}, {:httpotion, "~> 3.0", [hex: :httpotion, repo: "hexpm", optional: true]}, {:ibrowse, "~> 4.4", [hex: :ibrowse, repo: "hexpm", optional: true]}, {:meck, "~> 0.8.8", [hex: :meck, repo: "hexpm", optional: false]}], "hexpm"},
8+
"gen_stage": {:hex, :gen_stage, "0.13.1", "edff5bca9cab22c5d03a834062515e6a1aeeb7665fb44eddae086252e39c4378", [:mix], [], "hexpm"},
9+
"hackney": {:hex, :hackney, "1.11.0", "4951ee019df102492dabba66a09e305f61919a8a183a7860236c0fde586134b6", [:rebar3], [{:certifi, "2.0.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "5.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm"},
910
"httpoison": {:hex, :httpoison, "0.13.0", "bfaf44d9f133a6599886720f3937a7699466d23bb0cd7a88b6ba011f53c6f562", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm"},
1011
"idna": {:hex, :idna, "5.1.0", "d72b4effeb324ad5da3cab1767cb16b17939004e789d8c0ad5b70f3cea20c89a", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
1112
"jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm"},
1213
"meck": {:hex, :meck, "0.8.9", "64c5c0bd8bcca3a180b44196265c8ed7594e16bcc845d0698ec6b4e577f48188", [:rebar3], [], "hexpm"},
1314
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm"},
1415
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], [], "hexpm"},
15-
"nadia": {:hex, :nadia, "0.4.2", "a0ec739815674581e74b407450e448aa494921889c62f2b5d18ee2a43f6bad2e", [], [{:httpoison, "~> 0.9", [hex: :httpoison, repo: "hexpm", optional: false]}, {:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}], "hexpm"},
1616
"poison": {:hex, :poison, "3.1.0", "d9eb636610e096f86f25d9a46f35a9facac35609a7591b3be3326e99a0484665", [:mix], [], "hexpm"},
1717
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.1", "28a4d65b7f59893bc2c7de786dec1e1555bd742d336043fe644ae956c3497fbe", [:make, :rebar], [], "hexpm"},
18-
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"}}
18+
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"},
19+
}

test/logger_telegram_backend/sender_telegram_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule SenderTelegramTest do
44

55
alias LoggerTelegramBackend.Sender.Telegram
66

7-
setup_all do
7+
setup do
88
ExVCR.Config.cassette_library_dir("test/fixture/vcr_cassettes")
99
ExVCR.Config.filter_sensitive_data("bot[^/]+/", "bot<TOKEN>/")
1010
ExVCR.Config.filter_sensitive_data("id\":\\d+", "id\":666")

0 commit comments

Comments
 (0)