diff --git a/.formatter.exs b/.formatter.exs index b28c787..f8438bc 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,3 +1,4 @@ [ - inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}", "priv/repo/*.{ex,exs}"] + inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}", "priv/repo/*.{ex,exs}"], + import_deps: [:alice] ] diff --git a/config/config.exs b/config/config.exs index d2d855e..ac6dfd6 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1 +1,3 @@ use Mix.Config + +config :alice, handlers: [Alice.Handlers.GoodMorningLanguages] diff --git a/lib/alice/handlers/good_morning_languages.ex b/lib/alice/handlers/good_morning_languages.ex index 8a66312..a4799b8 100644 --- a/lib/alice/handlers/good_morning_languages.ex +++ b/lib/alice/handlers/good_morning_languages.ex @@ -81,9 +81,9 @@ defmodule Alice.Handlers.GoodMorningLanguages do @good_morning_languages @good_mornings |> Enum.map(& &1.regex) |> Enum.join("|") - route(~r/\A#{@good_morning_languages}\z/i, :good_morning) - command(~r/> (#{@good_morning_languages})\z/i, :direct_good_morning) - command(~r/> (good morning|morning) language\z/i, :good_morning_language) + route ~r/\A#{@good_morning_languages}\z/i, :good_morning + command ~r/> (#{@good_morning_languages})\z/i, :direct_good_morning + command ~r/> (good morning|morning) language\z/i, :good_morning_language @doc """ `Good Morning` diff --git a/mix.exs b/mix.exs index 816b4e7..db39a8b 100644 --- a/mix.exs +++ b/mix.exs @@ -15,12 +15,12 @@ defmodule AliceGoodMorning.Mixfile do end def application do - [applications: [:logger]] + [extra_applications: [:logger]] end defp deps do [ - {:alice, "~> 0.4.1"}, + {:alice, "~> 0.4.3"}, {:ex_doc, ">= 0.0.0", only: :dev} ] end diff --git a/mix.lock b/mix.lock index 17998bd..c26c373 100644 --- a/mix.lock +++ b/mix.lock @@ -1,14 +1,12 @@ %{ - "alice": {:hex, :alice, "0.4.1", "69a8266c65fd326ad466ff89cb64baf55ce8edcab9f5b76634c1d15b0e4455da", [:mix], [{:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.0", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.6.0", [hex: :redix, repo: "hexpm", optional: false]}, {:slack, "~> 0.12.0", [hex: :slack, repo: "hexpm", optional: false]}], "hexpm", "8ce2dbe64e10aaa3964f396104b41ff702e7501c9d0bf3e1bda7ed2eae0f6db6"}, + "alice": {:hex, :alice, "0.4.3", "7211321f3aa0a123f91c1e9bb8dbf05333793cbf87749bfb045f7d373f3a18c0", [:mix], [{:poison, "~> 3.0", [hex: :poison, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5.0", [hex: :poolboy, repo: "hexpm", optional: false]}, {:redix, "~> 0.6.0", [hex: :redix, repo: "hexpm", optional: false]}, {:slack, "~> 0.12.0", [hex: :slack, repo: "hexpm", optional: false]}], "hexpm", "ee5ecbb3dab0cc4846e33ee0e123b08d102e5ffc8ccd4e58ee63bdf715efee15"}, "certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"}, "connection": {:hex, :connection, "1.0.4", "a1cae72211f0eef17705aaededacac3eb30e6625b04a6117c1b2db6ace7d5976", [:mix], [], "hexpm", "4a0850c9be22a43af9920a71ab17c051f5f7d45c209e40269a1938832510e4d9"}, "earmark": {:hex, :earmark, "1.0.3", "89bdbaf2aca8bbb5c97d8b3b55c5dd0cff517ecc78d417e87f1d0982e514557b", [:mix], [], "hexpm", "0fdcd651f9689e81cda24c8e5d06947c5aca69dbd8ce3d836b02bcd0c6004592"}, "ex_doc": {:hex, :ex_doc, "0.14.5", "c0433c8117e948404d93ca69411dd575ec6be39b47802e81ca8d91017a0cf83c", [:mix], [{:earmark, "~> 1.0", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm", "5c30e436a5acfdc2fd8fe6866585fcaf30f434c611d8119d4f3390ced2a550f3"}, - "exjsx": {:hex, :exjsx, "3.1.0", "d419162cb2d5be80070835c2c2b8c78c8c45907706c991d23f3750dae506d1e9", [:mix], [{:jsx, "~> 2.4.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm", "588a0b67ed0c45b21f018515fc478efac83c088661bd588831e41c9073a818fb"}, "hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"}, "httpoison": {:hex, :httpoison, "0.13.0", "bfaf44d9f133a6599886720f3937a7699466d23bb0cd7a88b6ba011f53c6f562", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "4846958172d6401c4f34ecc5c2c4607b5b0d90b8eec8f6df137ca4907942ed0f"}, "idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"}, - "jsx": {:hex, :jsx, "2.4.0", "fb83830ac15e981b6ce310b645324ceecd01b1e0847d23921c33df829de5d2db", [:mix], [], "hexpm", "f9044993bfc94371a7757656ab4b9ba2daaad3ddc97df37c2368875eea049b19"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, "parse_trans": {:hex, :parse_trans, "3.3.0", "09765507a3c7590a784615cfd421d101aec25098d50b89d7aa1d66646bc571c1", [:rebar3], [], "hexpm", "17ef63abde837ad30680ea7f857dd9e7ced9476cdd7b0394432af4bfc241b960"}, diff --git a/test/alice/handlers/good_morning_languages_test.exs b/test/alice/handlers/good_morning_languages_test.exs new file mode 100644 index 0000000..cca5bdc --- /dev/null +++ b/test/alice/handlers/good_morning_languages_test.exs @@ -0,0 +1,4 @@ +defmodule Alice.Handlers.GoodMorningLanguagesTest do + alias Alice.Handlers.GoodMorningLanguages + use Alice.HandlerCase, handlers: [GoodMorningLanguages] +end diff --git a/test/alice/handlers/good_morning_test.exs b/test/alice/handlers/good_morning_test.exs deleted file mode 100644 index 8b13789..0000000 --- a/test/alice/handlers/good_morning_test.exs +++ /dev/null @@ -1 +0,0 @@ -