Add Clojure, Elixir, Java, Ruby, Rust

This commit is contained in:
1computer1 2019-03-15 00:06:59 -04:00
parent 36bd4d33c3
commit 47f5a78799
16 changed files with 94 additions and 0 deletions

View file

@ -55,6 +55,7 @@ One of the following language codes is set in `lang`.
Options are optionally set in `options`, which is a semicolon-delimited list of `flag` or `flag=value`.
- `c` C (GCC 8.2.0)
- `clj` Clojure (Clojure 1.10)
- `cpp` C++ (G++ 8.2.0)
- `cs` C# (Mono 5.18.0)
- `e` evaluates a single expression instead of a module
@ -62,9 +63,12 @@ Options are optionally set in `options`, which is a semicolon-delimited list of
- `go` Go (Go 1.12)
- `hs` Haskell (GHC 8.6.3)
- `e` evaluates a single expression instead of a module
- `java` Java (OpenJDK 13)
- `js` JavaScript (Node 11.11.0)
- `harmony` enables harmony features (`--harmony` on node)
- `e` prints the result of evaluating the code
- `pas` Pascal (FPC 3.0.4)
- `py` Python (CPython 3.7.2, CPython 2.7.16)
- `2` runs Python 2 instead of Python 3
- `rb` Ruby (Ruby 2.6.2)
- `rs` Rust (Rust 1.33.0)

View file

@ -0,0 +1,5 @@
FROM clojure:tools-deps-alpine
LABEL author="1Computer1"
COPY run.sh /var/run/
WORKDIR /var/ws

2
docker/clojure/run.sh Normal file
View file

@ -0,0 +1,2 @@
echo "$1" > program.clj
clojure program.clj

5
docker/elixir/Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM elixir:alpine
LABEL author="1Computer1"
COPY run.sh /var/run/
WORKDIR /var/ws

2
docker/elixir/run.sh Normal file
View file

@ -0,0 +1,2 @@
echo "$1" > program.exs
elixir program.exs

5
docker/java/Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM openjdk:13-alpine
LABEL author="1Computer1"
COPY run.sh /var/run/
WORKDIR /var/ws

2
docker/java/run.sh Normal file
View file

@ -0,0 +1,2 @@
echo "$1" > Main.java
javac Main.java && java Main

5
docker/ruby/Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM ruby:alpine
LABEL author="1Computer1"
COPY run.sh /var/run/
WORKDIR /var/ws

2
docker/ruby/run.sh Normal file
View file

@ -0,0 +1,2 @@
echo "$1" > program.rb
ruby program.rb

5
docker/rust/Dockerfile Normal file
View file

@ -0,0 +1,5 @@
FROM rust:slim
LABEL author="1Computer1"
COPY run.sh /var/run/
WORKDIR /var/ws

2
docker/rust/run.sh Normal file
View file

@ -0,0 +1,2 @@
echo "$1" > program.rs
rustc -C opt-level=0 --color never program.rs && ./program

11
src/languages/clojure.js Normal file
View file

@ -0,0 +1,11 @@
const Language = require('../struct/Language');
class Clojure extends Language {
constructor() {
super('clojure', {
aliases: ['clojure', 'clj']
});
}
}
module.exports = Clojure;

11
src/languages/elixir.js Normal file
View file

@ -0,0 +1,11 @@
const Language = require('../struct/Language');
class Elixir extends Language {
constructor() {
super('elixir', {
aliases: ['elixir']
});
}
}
module.exports = Elixir;

11
src/languages/java.js Normal file
View file

@ -0,0 +1,11 @@
const Language = require('../struct/Language');
class Java extends Language {
constructor() {
super('java', {
aliases: ['java']
});
}
}
module.exports = Java;

11
src/languages/ruby.js Normal file
View file

@ -0,0 +1,11 @@
const Language = require('../struct/Language');
class Ruby extends Language {
constructor() {
super('ruby', {
aliases: ['ruby', 'rb']
});
}
}
module.exports = Ruby;

11
src/languages/rust.js Normal file
View file

@ -0,0 +1,11 @@
const Language = require('../struct/Language');
class Rust extends Language {
constructor() {
super('rust', {
aliases: ['rust', 'rs']
});
}
}
module.exports = Rust;