Skip to content

Commit

Permalink
Swap out yomel for yaml_elixir
Browse files Browse the repository at this point in the history
Yomel depends on libyaml which isn't always available. YamlElixir, on the
other hand, wraps around the native Erlang yaml parser (yamerl).

This commit will reduce our external dependencies and make CI/release building
run a bit smoother.
  • Loading branch information
mertonium committed May 24, 2018
1 parent 3cf9b44 commit 56ac5ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/linguist/memorized_vocabulary.ex
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ defmodule Linguist.MemorizedVocabulary do
:ets.new(:translations_registry, [:named_table, :set, :protected])
end

{decode_status, [file_data]} = Yomel.decode_file(source)
{decode_status, [file_data]} = YamlElixir.read_all_from_file(source)
if decode_status != :ok do
raise %TranslationDecodeError{message: "Decode failed for file #{source}"}
end
Expand All @@ -144,7 +144,7 @@ defmodule Linguist.MemorizedVocabulary do
"#{acc.current_prefix}.#{key}"
end

%{
%{
paths: Map.put(acc.paths, key_name, value),
current_prefix: acc.current_prefix
}
Expand Down
2 changes: 1 addition & 1 deletion lib/linguist/vocabulary.ex
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ defmodule Linguist.Vocabulary do
will not work as expected if called directly.
"""
def _load_yaml_file(source) do
{:ok, [result]} = Yomel.decode_file(source)
{:ok, [result]} = YamlElixir.read_all_from_file(source)
result
|> Enum.reduce([], &Linguist.Vocabulary._yaml_reducer/2)
end
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ defmodule Linguist.Mixfile do
end

def application do
[applications: []]
[applications: [:yaml_elixir]]
end

defp deps do
[
{:ex_cldr, "~> 1.5"},
{:jason, "~> 1.0"},
{:yomel, "~> 0.5"},
{:yaml_elixir, "~> 2.0"},
{:credo, "~> 0.9.0", only: [:dev, :test], runtime: false}
]
end
Expand Down

0 comments on commit 56ac5ee

Please sign in to comment.