Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sudo: false
language: elixir
otp_release:
- 18.1
- 20.3
elixir:
- 1.2.6
- 1.3.2
- 1.4.5
- 1.5.3
script: "script/ci_build"
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### Unreleased

* Update IDNA to support version 6.0.0
* Also bump dev dependecies for earmark and ex_doc

Breaking:
* Raise minimum Elixir version to 1.4

### 0.6.0 / 2018-02-28
[Full Changelog](https://github.com/seomoz/publicsuffix-elixir/compare/v0.5.0...v0.4.0)

Expand Down
8 changes: 6 additions & 2 deletions lib/public_suffix/rules_parser.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ defmodule PublicSuffix.RulesParser do
end

@doc false
# We can only convert domain's to punycode so do not pass through operators
def punycode_domain("*" <> rule), do: "*" <> punycode_domain(rule)
def punycode_domain("!" <> rule), do: "!" <> punycode_domain(rule)

def punycode_domain(rule) do
rule
|> :unicode.characters_to_list
|> :idna.to_ascii
|> to_string
|> :idna.encode(uts46: true)
|> to_string()
end

defp to_domain_label_map(rules, type) do
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule PublicSuffix.Mixfile do
def project do
[app: :public_suffix,
version: "0.6.0",
elixir: "~> 1.2",
elixir: "~> 1.4",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
aliases: aliases(),
Expand All @@ -26,7 +26,7 @@ defmodule PublicSuffix.Mixfile do

defp deps do
[
{:idna, ">= 1.2.0 and < 6.0.0"},
{:idna, ">= 1.2.0 and < 7.0.0"},
# ex_doc and earmark are necessary to publish docs to hexdocs.pm.
{:ex_doc, ">= 0.0.0", only: :dev},
{:earmark, ">= 0.0.0", only: :dev},
Expand Down
11 changes: 7 additions & 4 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
%{
"earmark": {:hex, :earmark, "0.2.1", "ba6d26ceb16106d069b289df66751734802777a3cbb6787026dd800ffeb850f3", [:mix], []},
"ex_doc": {:hex, :ex_doc, "0.11.5", "0dc51cb84f8312162a2313d6c71573a9afa332333d8a332bb12540861b9834db", [:mix], [{:earmark, "~> 0.1.17 or ~> 0.2", [hex: :earmark, optional: true]}]},
"idna": {:hex, :idna, "5.1.0", "d72b4effeb324ad5da3cab1767cb16b17939004e789d8c0ad5b70f3cea20c89a", [:rebar3], [{:unicode_util_compat, "0.3.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.3.1", "a1f612a7b512638634a603c8f401892afbf99b8ce93a45041f8aaca99cadb85e", [:rebar3], [], "hexpm"},
"earmark": {:hex, :earmark, "1.3.1", "73812f447f7a42358d3ba79283cfa3075a7580a3a2ed457616d6517ac3738cb9", [:mix], [], "hexpm"},
"ex_doc": {:hex, :ex_doc, "0.19.3", "3c7b0f02851f5fc13b040e8e925051452e41248f685e40250d7e40b07b9f8c10", [:mix], [{:earmark, "~> 1.2", [hex: :earmark, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.10", [hex: :makeup_elixir, repo: "hexpm", optional: false]}], "hexpm"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm"},
"makeup": {:hex, :makeup, "0.8.0", "9cf32aea71c7fe0a4b2e9246c2c4978f9070257e5c9ce6d4a28ec450a839b55f", [:mix], [{:nimble_parsec, "~> 0.5.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm"},
"makeup_elixir": {:hex, :makeup_elixir, "0.13.0", "be7a477997dcac2e48a9d695ec730b2d22418292675c75aa2d34ba0909dcdeda", [:mix], [{:makeup, "~> 0.8", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm"},
"nimble_parsec": {:hex, :nimble_parsec, "0.5.0", "90e2eca3d0266e5c53f8fbe0079694740b9c91b6747f2b7e3c5d21966bba8300", [:mix], [], "hexpm"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.4.1", "d869e4c68901dd9531385bb0c8c40444ebf624e60b6962d95952775cac5e90cd", [:rebar3], [], "hexpm"},
}
2 changes: 1 addition & 1 deletion test/public_suffix_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ defmodule PublicSuffix.PublicSuffixTest do
domain
|> PublicSuffix.RulesParser.punycode_domain
|> to_char_list
|> :idna.from_ascii
|> :idna.decode(uts46: true)
|> to_string
end
end