Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F114214
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/.gitignore b/.gitignore
index 4bd2596..fa8a503 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,19 +1,21 @@
# The directory Mix will write compiled artifacts to.
/_build
# If you run "mix test --cover", coverage assets end up here.
/cover
# The directory Mix downloads your dependencies sources to.
/deps
# Where 3rd-party dependencies like ExDoc output generated docs.
/doc
# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump
# Also ignore archive artifacts (built via "mix archive.build").
*.ez
*.o
+
+priv/captcha
diff --git a/lib/captcha.ex b/lib/captcha.ex
index 336f437..cc041a0 100644
--- a/lib/captcha.ex
+++ b/lib/captcha.ex
@@ -1,14 +1,14 @@
defmodule Captcha do
def get() do
- Port.open({:spawn, "priv/captcha"}, [:binary])
+ Port.open({:spawn, Path.join(Path.dirname(__ENV__.file), "../priv/captcha")}, [:binary])
receive do
{_, {:data, data}} ->
<<text::bytes-size(5), img::binary>> = data
{:ok, text, img }
other -> other
after
1_000 -> { :timeout }
end
end
end
diff --git a/priv/.gitkeep b/priv/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/priv/captcha b/priv/captcha
deleted file mode 100755
index 56dffea..0000000
Binary files a/priv/captcha and /dev/null differ
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 11:23 PM (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40110
Default Alt Text
(1 KB)
Attached To
Mode
R13 elixir-captcha
Attached
Detach File
Event Timeline
Log In to Comment