Skip to content

Commit

Permalink
Require Elixir v1.11+
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jan 24, 2022
1 parent b91cffc commit e02de9f
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
include:
- pair:
elixir: "1.10"
elixir: "1.11"
otp: 21
- pair:
elixir: "1.13"
Expand Down
11 changes: 0 additions & 11 deletions lib/ex_doc/language/erlang.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,7 @@ defmodule ExDoc.Language.Erlang do
alias ExDoc.{Autolink, Refs}

@impl true
# TODO: Move :hidden handling to retriever, as it is shared across all BEAM languages
def module_data(module, docs_chunk, _config) do
{:docs_v1, _, _, _, doc, _, _} = docs_chunk

if doc != :hidden do
module_data(module, docs_chunk)
else
:skip
end
end

def module_data(module, docs_chunk) do
# Make sure the module is loaded for future checks
_ = Code.ensure_loaded(module)
id = Atom.to_string(module)
Expand Down
2 changes: 1 addition & 1 deletion lib/ex_doc/refs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ defmodule ExDoc.Refs do
end

defp fetch({:module, module} = ref) do
entries = fetch_entries(module, ExDoc.Utils.Code.fetch_docs(module))
entries = fetch_entries(module, Code.fetch_docs(module))
insert(entries)
Map.get(Map.new(entries), ref, :undefined)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ex_doc/retriever.ex
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ defmodule ExDoc.Retriever do
end

defp docs_chunk(module) do
result = ExDoc.Utils.Code.fetch_docs(module)
result = Code.fetch_docs(module)
Refs.insert_from_chunk(module, result)

case result do
Expand Down
73 changes: 0 additions & 73 deletions lib/ex_doc/utils/code.ex

This file was deleted.

2 changes: 1 addition & 1 deletion lib/mix/tasks/docs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ defmodule Mix.Tasks.Docs do
use Mix.Task

@shortdoc "Generate documentation for the project"
@requirements ["compile"]

@moduledoc ~S"""
Uses ExDoc to generate a static web page from the project documentation.
Expand Down Expand Up @@ -315,7 +316,6 @@ defmodule Mix.Tasks.Docs do

@doc false
def run(args, config \\ Mix.Project.config(), generator \\ &ExDoc.generate_docs/3) do
Mix.Task.run("compile")
{:ok, _} = Application.ensure_all_started(:ex_doc)

unless Code.ensure_loaded?(ExDoc.Config) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule ExDoc.Mixfile do
[
app: :ex_doc,
version: @version,
elixir: "~> 1.10",
elixir: "~> 1.11",
deps: deps(),
aliases: aliases(),
package: package(),
Expand Down
2 changes: 1 addition & 1 deletion test/ex_doc/refs_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ defmodule ExDoc.RefsTest do
end

test "insert_from_chunk/2 with module that doesn't exist" do
result = ExDoc.Utils.Code.fetch_docs(:elixir)
result = Code.fetch_docs(:elixir)
assert :ok = ExDoc.Refs.insert_from_chunk(Elixir, result)
end
end

0 comments on commit e02de9f

Please sign in to comment.