Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e0cf5bf

Browse files
committedMar 27, 2019
Make gnuplot_bin private
1 parent 8bbc93f commit e0cf5bf

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed
 

‎README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ by adding `gnuplot` to your list of dependencies in `mix.exs`:
100100
```elixir
101101
def deps do
102102
[
103-
{:gnuplot, "~> 0.19.86"}
103+
{:gnuplot, "~> 0.19.87"}
104104
]
105105
end
106106
```

‎lib/gnuplot.ex

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ defmodule Gnuplot do
2424

2525
alias Gnuplot.Commands
2626
import Gnuplot.Dataset
27+
import Gnuplot.Bin
2728

2829
@type command_term :: atom() | charlist() | number() | Range.t() | String.t()
2930

@@ -65,17 +66,6 @@ defmodule Gnuplot do
6566
|> Stream.run()
6667
end
6768

68-
@doc """
69-
Find the gnuplot executable.
70-
"""
71-
@spec gnuplot_bin() :: {:error, :gnuplot_missing} | {:ok, :file.name()}
72-
def gnuplot_bin do
73-
case :os.find_executable(String.to_charlist("gnuplot")) do
74-
false -> {:error, :gnuplot_missing}
75-
path -> {:ok, path}
76-
end
77-
end
78-
7969
@doc "Build a comma separated list from a list of terms."
8070
def list(xs) when is_list(xs), do: %Commands.List{xs: xs}
8171

‎lib/gnuplot/bin.ex

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
defmodule Gnuplot.Bin do
2+
@moduledoc false
3+
4+
@doc """
5+
Find the gnuplot executable.
6+
"""
7+
@spec gnuplot_bin() :: {:error, :gnuplot_missing} | {:ok, :file.name()}
8+
def gnuplot_bin do
9+
case :os.find_executable(String.to_charlist("gnuplot")) do
10+
false -> {:error, :gnuplot_missing}
11+
path -> {:ok, path}
12+
end
13+
end
14+
end

‎lib/gnuplot/commands.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ defmodule Gnuplot.Commands do
55

66
defprotocol Command do
77
@spec formatg(term()) :: String.t()
8+
9+
@doc "Format Elixir term as a Gnuplot String"
810
def formatg(cmd)
911
end
1012

‎mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Gnuplot.MixProject do
44
def project do
55
[
66
app: :gnuplot,
7-
version: "0.19.86",
7+
version: "0.19.87",
88
elixir: "~> 1.6",
99
start_permanent: Mix.env() == :prod,
1010
description: "Interface between Elixir and Gnuplot graphing library",

‎test/gnuplot_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ defmodule GnuplotTest do
5454

5555
@tag gnuplot: true
5656
test "Gnuplot is installed" do
57-
assert {:ok, path} = G.gnuplot_bin()
57+
assert {:ok, path} = Gnuplot.Bin.gnuplot_bin()
5858
assert File.exists?(path)
5959
end
6060

0 commit comments

Comments
 (0)
Please sign in to comment.