Skip to content

Commit

Permalink
Fix deprecations (#52)
Browse files Browse the repository at this point in the history
## Motivation

We have a couple of warnings on elixir 1.11

```
==> xcribe
Compiling 22 files (.ex)
warning: Supervisor.Spec.worker/2 is deprecated. Use the new child specifications outlined in the Supervisor module instead
  lib/xcribe.ex:110: Xcribe.children/0
```

## Proposed solution

- Remove Supervisor.Spec
- Elixir 1.11 was not added to CI, because there isn't any version available of this release to use in the github actions https://www.erlang-solutions.com/resources/download.html
  • Loading branch information
thiamsantos authored Oct 19, 2020
1 parent 00cbcaf commit 33c7052
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 14 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.7.4] - 2020-10-19

- Remove usage of deprecated `Supervisor.Spec`

## [0.7.2] - 2020-06-11

### Enhancements
Expand Down Expand Up @@ -85,7 +89,8 @@ Improve CI/CD flow:
- New "tags" parameter to operations object in Swagger format.
- Add changelog and Makefile.

[unreleased]: https://github.com/brainn-co/xcribe/compare/v0.7.3...master
[unreleased]: https://github.com/brainn-co/xcribe/compare/v0.7.4...master
[0.7.4]: https://github.com/brainn-co/xcribe/compare/v0.7.3...v0.7.4
[0.7.3]: https://github.com/brainn-co/xcribe/compare/v0.7.2...v0.7.3
[0.7.2]: https://github.com/brainn-co/xcribe/compare/v0.7.1...v0.7.2
[0.7.1]: https://github.com/brainn-co/xcribe/compare/v0.7.0...v0.7.1
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ release: ## Bumps the version and creates the new tag
perl -p -i -e "s/\"\~> ${VERSION}\"/\"\~> $$NEW_VERSION\"/g" ${README_FILE} && \
printf "\t${DIM_COLOR}Updating ${CHANGELOG_FILE} version${DEFAULT_COLOR}\n" && \
perl -p -i -e "s/## \[Unreleased\]/## \[Unreleased\]\\n\\n## \[$$NEW_VERSION\] - ${DATE}/g" ${CHANGELOG_FILE} && \
perl -p -i -e "s/${REPO}\/${VERSION}...master/${REPO}\/$$NEW_VERSION...master/g" ${CHANGELOG_FILE} && \
perl -p -i -e "s/...master/...master\\n\[$$NEW_VERSION\]: ${REPO}\/${VERSION}...$$NEW_VERSION/g" ${CHANGELOG_FILE} && \
perl -p -i -e "s/${REPO}\/v${VERSION}...master/${REPO}\/v$$NEW_VERSION...master/g" ${CHANGELOG_FILE} && \
perl -p -i -e "s/...master/...master\\n\[$$NEW_VERSION\]: ${REPO}\/v${VERSION}...v$$NEW_VERSION/g" ${CHANGELOG_FILE} && \
printf "\t${DIM_COLOR}Recording changes to the repository${DEFAULT_COLOR}\n"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mix.exs
```elixir
def deps do
[
{:xcribe, "~> 0.7.3"}
{:xcribe, "~> 0.7.4"}
]
end
```
Expand Down
8 changes: 3 additions & 5 deletions lib/xcribe.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ defmodule Xcribe do
description "The best API in the world"
host "http://your-api.us"
end
end
end
See `Xcribe.Information` for more details about custom information.
Expand All @@ -61,7 +61,7 @@ defmodule Xcribe do
eg
config :xcribe,
config :xcribe,
information_source: YourApp.YouModuleInformation,
format: :swagger
Expand Down Expand Up @@ -105,8 +105,6 @@ defmodule Xcribe do
end

defp children do
import Supervisor.Spec

[worker(Xcribe.Recorder, [])]
[{Xcribe.Recorder, []}]
end
end
2 changes: 1 addition & 1 deletion lib/xcribe/recorder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule Xcribe.Recorder do

alias Xcribe.{Request, Request.Error}

def start_link do
def start_link(_opts \\ []) do
GenServer.start_link(__MODULE__, [], name: __MODULE__)
end

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Xcribe.MixProject do
use Mix.Project

@version "0.7.3"
@version "0.7.4"
@description "A lib to generate API documentation from test specs"
@links %{"GitHub" => "https://github.com/brainn-co/xcribe"}

Expand Down
4 changes: 1 addition & 3 deletions test/support/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ defmodule Xcribe.Support.Application do
use Application

def start(_type, _args) do
import Supervisor.Spec

children = [
supervisor(Xcribe.Endpoint, [])
{Xcribe.Endpoint, []}
]

opts = [strategy: :one_for_one, name: Xcribe.Support.Supervisor]
Expand Down

0 comments on commit 33c7052

Please sign in to comment.