Skip to content
This repository was archived by the owner on Nov 12, 2018. It is now read-only.

Add Elixir, please test #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
181 changes: 181 additions & 0 deletions src/languages/elixir.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
export const lang = {



name: "elixir",



sourceFileName: "a.ex",



fileExtension: "ex",



binarySizeLimit: 5000 * 1024,







// Note that these two paths are in the sandboxed environment.



compile: (sourcePath, outputDirectory) => ({



// To customize the compilation process,



// write a shell script or some other stuff,



// and put it to your sandbox.



executable: "/usr/bin/elixirc",



parameters: ["elixirc", sourcePath, outputDirectory, "elixirc a.ex"],



time: 5000,



memory: 1024 * 1024 * 1024,



process: 10,



// This is just a redirection. You can simply ignore this



// if you can specify custom location for message output



// in the parameter of the compiler, or have redirected the compilation



// message to somewhere.



// An example will be available soon.



stderr: `${outputDirectory}/message.txt`,



// We will read this file for message in the output directory.



messageFile: 'message.txt',



workingDirectory: outputDirectory



}),







run: (binaryDirectory: string,



workingDirectory: string,



time: number,



memory: number,



stdinFile = null,



stdoutFile = null,



stderrFile = null



) => ({



executable: "/usr/bin/elixir",



parameters: ["elixir", `${binaryDirectory}/a.ex`, "-e \"Main.main()\""],



time: time,



memory: memory,



process: 1,



stdin: stdinFile,



stdout: stdoutFile,



stderr: stderrFile,



workingDirectory: workingDirectory



})



};
3 changes: 2 additions & 1 deletion src/languages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ export const languages : Language[] = [
require('./python3'),
require('./ruby'),
require('./vala'),
require('./elixir'),
require('./vbnet')
].map(f => f.lang);
].map(f => f.lang);