changed
CHANGELOG.md
|
@@ -2,6 2,12 @@
|
2
2
|
|
3
3
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
4
4
|
|
5
|
## v0.2.1 (2023-03-19)
|
6
|
|
7
|
### Enhancements
|
8
|
|
9
|
* More consistent formatting between `:semantic` and `:text` diffs.
|
10
|
|
5
11
|
## v0.2.0 (2023-03-18)
|
6
12
|
|
7
13
|
### Breaking
|
changed
hex_metadata.config
|
@@ -46,4 46,4 @@
|
46
46
|
{<<"optional">>,false},
|
47
47
|
{<<"repository">>,<<"hexpm">>},
|
48
48
|
{<<"requirement">>,<<"~> 0.16.0">>}]]}.
|
49
|
- {<<"version">>,<<"0.2.0">>}.
|
49
|
{<<"version">>,<<"0.2.1">>}.
|
changed
lib/mneme/prompter/terminal.ex
|
@@ -96,20 96,14 @@ defmodule Mneme.Prompter.Terminal do
|
96
96
|
|
97
97
|
defp diff(:semantic, source) do
|
98
98
|
case semantic_diff(source) do
|
99
|
- {nil, nil} ->
|
100
|
- diff(:text, source)
|
101
|
-
|
102
|
- {nil, ins} ->
|
103
|
- [Owl.Data.unlines(ins), "\n"]
|
104
|
-
|
105
|
- {del, nil} ->
|
106
|
- [Owl.Data.unlines(del), "\n"]
|
107
|
-
|
108
99
|
{del, ins} ->
|
100
|
deletions = del |> Owl.Data.unlines() |> Owl.Data.add_prefix(tag(" - ", :red))
|
101
|
insertions = ins |> Owl.Data.unlines() |> Owl.Data.add_prefix(tag(" ", :green))
|
102
|
|
109
103
|
[
|
110
|
- del |> Owl.Data.unlines() |> Owl.Data.add_prefix(tag("- ", :red)),
|
104
|
deletions,
|
111
105
|
"\n\n",
|
112
|
- ins |> Owl.Data.unlines() |> Owl.Data.add_prefix(tag(" ", :green)),
|
106
|
insertions,
|
113
107
|
"\n"
|
114
108
|
]
|
115
109
|
|
|
@@ -123,7 117,10 @@ defmodule Mneme.Prompter.Terminal do
|
123
117
|
task = Task.async(Mneme.Diff, :format, [left, right])
|
124
118
|
|
125
119
|
case Task.yield(task, 1500) || Task.shutdown(task, :brutal_kill) do
|
126
|
- {:ok, {:ok, diff}} -> diff
|
120
|
{:ok, {:ok, {nil, nil}}} -> nil
|
121
|
{:ok, {:ok, {nil, ins}}} -> {Owl.Data.lines(left), ins}
|
122
|
{:ok, {:ok, {del, nil}}} -> {del, Owl.Data.lines(right)}
|
123
|
{:ok, {:ok, {del, ins}}} -> {del, ins}
|
127
124
|
{:ok, {:error, {:internal, e, stacktrace}}} -> reraise e, stacktrace
|
128
125
|
_ -> nil
|
129
126
|
end
|
changed
mix.exs
|
@@ -4,7 4,7 @@ defmodule Mneme.MixProject do
|
4
4
|
@app :mneme
|
5
5
|
@source_url "https://github.com/zachallaun/mneme"
|
6
6
|
|
7
|
- def version, do: "0.2.0"
|
7
|
def version, do: "0.2.1"
|
8
8
|
|
9
9
|
def project do
|
10
10
|
[
|
unknown
priv/mneme_0.1.0.gif
CANNOT RENDER FILES LARGER THAN 1MB
unknown
priv/plts/dialyzer.plt
CANNOT RENDER FILES LARGER THAN 1MB