Browse Source

Fix that up.

jackyalcine 9 months ago
parent
commit
ffcf189506
Signed by: Jacky Alciné <yo@jacky.wtf> GPG Key ID: 537A4F904B15268D

+ 1
- 1
lib/indieweb/app.ex View File

@@ -23,7 +23,7 @@ defmodule IndieWeb.App do
23 23
     def known() do
24 24
       [
25 25
         ## Recommended parsers to stop at
26
-        IndieWeb.App.HxApp,
26
+        IndieWeb.App.Microformats,
27 27
 
28 28
         ## Open stopgap solutions
29 29
         IndieWeb.App.Link

+ 1
- 7
lib/indieweb/app/link.ex View File

@@ -1,12 +1,6 @@
1 1
 defmodule IndieWeb.App.Link do
2 2
   @behaviour IndieWeb.App.Parser
3
-  @moduledoc """
4
-  Extracts information about app from <link> info.
5
-
6
-  This takes information stored in the <link rel> bits of the site and uses
7
-  it to render generic information about the application. It's not the best
8
-  solution.
9
-  """
3
+  @moduledoc false
10 4
 
11 5
   defp do_fetch(uri) do
12 6
     with(

lib/indieweb/app/h_x_app.ex → lib/indieweb/app/microformats.ex View File

@@ -1,13 +1,6 @@
1
-defmodule IndieWeb.App.HxApp do
1
+defmodule IndieWeb.App.Microformats do
2 2
   @behaviour IndieWeb.App.Parser
3
-  @moduledoc """
4
-  Parses h-x-app information from a Website.
5
-
6
-  Using the specificiation of h-x-app information outlined at 
7
-  https://indieweb.org/h-x-app. This allows platforms that are
8
-  richly formatted with said markup to be presented to Koype
9
-  in a useful manner.
10
-  """
3
+  @moduledoc false
11 4
 
12 5
   alias Microformats2.Utility, as: MF2
13 6
 

+ 3
- 3
lib/indieweb/post.ex View File

@@ -248,9 +248,9 @@ defmodule IndieWeb.Post do
248 248
       properties
249 249
       |> Map.get("name", [])
250 250
       |> (fn
251
-        name when is_list(name) -> name
252
-        name -> [name]
253
-      end).()
251
+            name when is_list(name) -> name
252
+            name -> [name]
253
+          end).()
254 254
       |> Enum.map(&String.trim/1)
255 255
       |> Enum.join(" ")
256 256
 

+ 4
- 2
lib/indieweb/webmention.ex View File

@@ -97,7 +97,9 @@ defmodule IndieWeb.Webmention do
97 97
   def direct_send!(endpoint, target_url, source) do
98 98
     with(
99 99
       {:ok, source_url} <- resolve_source_url(source),
100
-      {:ok, %IndieWeb.Http.Response{code: code, body: body, headers: headers}} when code >= 200 and code < 400 <- IndieWeb.Http.post(endpoint,
100
+      {:ok, %IndieWeb.Http.Response{code: code, body: body, headers: headers}}
101
+      when code >= 200 and code < 400 <-
102
+        IndieWeb.Http.post(endpoint,
101 103
           body: %{"source" => source_url, "target" => target_url},
102 104
           headers: %{"Content-Type" => "application/x-www-form-urlencoded"}
103 105
         )
@@ -108,7 +110,7 @@ defmodule IndieWeb.Webmention do
108 110
         code: code,
109 111
         body: body,
110 112
         headers: headers,
111
-        status: :accepted,
113
+        status: :accepted
112 114
       }
113 115
 
114 116
       {:ok, send_resp}

+ 5
- 6
mix.exs View File

@@ -8,7 +8,7 @@ defmodule IndieWeb.MixProject do
8 8
       app: :indieweb,
9 9
       name: "IndieWeb",
10 10
       version: "0.0.42",
11
-      elixir: "~> 1.7",
11
+      elixir: "~> 1.6",
12 12
       elixirc_paths: elixirc_paths(Mix.env()),
13 13
       start_permanent: Mix.env() == :prod,
14 14
       build_embedded: Mix.env() == :prod,
@@ -24,7 +24,8 @@ defmodule IndieWeb.MixProject do
24 24
       homepage_url: "https://indieweb.org/",
25 25
       docs: [
26 26
         source_url: "https://git.jacky.wtf/indieweb/elixir",
27
-        source_url_pattern: "https://git.jacky.wtf/indieweb/elixir/src/branch/master/%{path}#L%{line}",
27
+        source_url_pattern:
28
+          "https://git.jacky.wtf/indieweb/elixir/src/branch/master/%{path}#L%{line}",
28 29
         logo: "priv/static/images/logo.png",
29 30
         extras: Path.wildcard("docs/*.markdown")
30 31
       ]
@@ -42,12 +43,10 @@ defmodule IndieWeb.MixProject do
42 43
     [
43 44
       {:apex, "~> 1.2.1", only: [:dev, :test]},
44 45
       {:cachex, "~> 3.1.0"},
45
-      {:credo, "~> 1.0.0", only: [:dev, :test]},
46 46
       {:excoveralls, "~> 0.10.0", only: [:test]},
47
-      {:ex_doc, "~> 0.14.0", only: :dev},
47
+      {:ex_doc, "~> 0.19", override: true},
48 48
       {:exvcr, "~> 0.10.0", only: :test},
49 49
       {:faker, "~> 0.12.0", only: :test},
50
-      {:inch_ex, github: "rrrene/inch_ex", only: [:dev, :test]},
51 50
       {:microformats2, "~> 0.2.0"}
52 51
     ]
53 52
   end
@@ -71,7 +70,7 @@ defmodule IndieWeb.MixProject do
71 70
 
72 71
   defp aliases do
73 72
     [
74
-      ci: ["test --include slow:true --cover", "coveralls.detail", "inch"]
73
+      ci: ["test --include slow:true --cover", "coveralls.detail"]
75 74
     ]
76 75
   end
77 76
 end

+ 1
- 1
mix.lock View File

@@ -6,7 +6,7 @@
6 6
   "credo": {:hex, :credo, "1.0.2", "88bc918f215168bf6ce7070610a6173c45c82f32baa08bdfc80bf58df2d103b6", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
7 7
   "earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"},
8 8
   "eternal": {:hex, :eternal, "1.2.1", "d5b6b2499ba876c57be2581b5b999ee9bdf861c647401066d3eeed111d096bc4", [:mix], [], "hexpm"},
9
-  "ex_doc": {:hex, :ex_doc, "0.14.5", "c0433c8117e948404d93ca69411dd575ec6be39b47802e81ca8d91017a0cf83c", [:mix], [{:earmark, "~> 1.0", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
9
+  "ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.0", [hex: :earmark, repo: "hexpm", optional: false]}], "hexpm"},
10 10
   "exactor": {:hex, :exactor, "2.2.4", "5efb4ddeb2c48d9a1d7c9b465a6fffdd82300eb9618ece5d34c3334d5d7245b1", [:mix], [], "hexpm"},
11 11
   "excoveralls": {:hex, :excoveralls, "0.10.5", "7c912c4ec0715a6013647d835c87cde8154855b9b84e256bc7a63858d5f284e3", [:mix], [{:hackney, "~> 1.13", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm"},
12 12
   "exjsx": {:hex, :exjsx, "4.0.0", "60548841e0212df401e38e63c0078ec57b33e7ea49b032c796ccad8cde794b5c", [:mix], [{:jsx, "~> 2.8.0", [hex: :jsx, repo: "hexpm", optional: false]}], "hexpm"},

+ 3
- 1
test/unit/indieweb/hcard_test.exs View File

@@ -56,7 +56,9 @@ defmodule IndieWeb.HCardTest do
56 56
       <html>
57 57
       <body>
58 58
       <div class="h-card">
59
-      <img class="u-photo" src="#{@hcard["photo"]}" alt="#{Faker.Lorem.sentence()}" />
59
+      <img class="u-photo" src="#{@hcard["photo"]}" alt="#{
60
+        Faker.Lorem.sentence()
61
+      }" />
60 62
       <a href="#{@url}" class="u-url u-uid">
61 63
       <span class="p-name">#{@hcard["name"]}</span>
62 64
       </a>

+ 0
- 1
test/unit/indieweb/post_test.exs View File

@@ -153,7 +153,6 @@ defmodule IndieWeb.PostTest do
153 153
                  },
154 154
                  [:note, :article]
155 155
                )
156
-
157 156
     end
158 157
 
159 158
     test "determines a note" do

+ 0
- 1
test/unit/indieweb/webmention_test.exs View File

@@ -211,7 +211,6 @@ defmodule IndieWeb.WebmentionTest do
211 211
       end
212 212
     end
213 213
 
214
-
215 214
     test "fails if source URI could be obtained" do
216 215
       assert {:error, :webmention_send_failure, reason: :no_endpoint_found} =
217 216
                Subject.send("https://webmention.target/page", :bad_test_source)

Loading…
Cancel
Save