From 47f5a787990614093fb1724b12074cdae0586cc1 Mon Sep 17 00:00:00 2001 From: 1computer1 Date: Fri, 15 Mar 2019 00:06:59 -0400 Subject: [PATCH] Add Clojure, Elixir, Java, Ruby, Rust --- README.md | 4 ++++ docker/clojure/Dockerfile | 5 +++++ docker/clojure/run.sh | 2 ++ docker/elixir/Dockerfile | 5 +++++ docker/elixir/run.sh | 2 ++ docker/java/Dockerfile | 5 +++++ docker/java/run.sh | 2 ++ docker/ruby/Dockerfile | 5 +++++ docker/ruby/run.sh | 2 ++ docker/rust/Dockerfile | 5 +++++ docker/rust/run.sh | 2 ++ src/languages/clojure.js | 11 +++++++++++ src/languages/elixir.js | 11 +++++++++++ src/languages/java.js | 11 +++++++++++ src/languages/ruby.js | 11 +++++++++++ src/languages/rust.js | 11 +++++++++++ 16 files changed, 94 insertions(+) create mode 100644 docker/clojure/Dockerfile create mode 100644 docker/clojure/run.sh create mode 100644 docker/elixir/Dockerfile create mode 100644 docker/elixir/run.sh create mode 100644 docker/java/Dockerfile create mode 100644 docker/java/run.sh create mode 100644 docker/ruby/Dockerfile create mode 100644 docker/ruby/run.sh create mode 100644 docker/rust/Dockerfile create mode 100644 docker/rust/run.sh create mode 100644 src/languages/clojure.js create mode 100644 src/languages/elixir.js create mode 100644 src/languages/java.js create mode 100644 src/languages/ruby.js create mode 100644 src/languages/rust.js diff --git a/README.md b/README.md index cd8baea..4b27507 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/docker/clojure/Dockerfile b/docker/clojure/Dockerfile new file mode 100644 index 0000000..b3a8421 --- /dev/null +++ b/docker/clojure/Dockerfile @@ -0,0 +1,5 @@ +FROM clojure:tools-deps-alpine +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/clojure/run.sh b/docker/clojure/run.sh new file mode 100644 index 0000000..1804e0a --- /dev/null +++ b/docker/clojure/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.clj +clojure program.clj diff --git a/docker/elixir/Dockerfile b/docker/elixir/Dockerfile new file mode 100644 index 0000000..c316018 --- /dev/null +++ b/docker/elixir/Dockerfile @@ -0,0 +1,5 @@ +FROM elixir:alpine +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/elixir/run.sh b/docker/elixir/run.sh new file mode 100644 index 0000000..6520a90 --- /dev/null +++ b/docker/elixir/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.exs +elixir program.exs diff --git a/docker/java/Dockerfile b/docker/java/Dockerfile new file mode 100644 index 0000000..0087d2d --- /dev/null +++ b/docker/java/Dockerfile @@ -0,0 +1,5 @@ +FROM openjdk:13-alpine +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/java/run.sh b/docker/java/run.sh new file mode 100644 index 0000000..46b2f03 --- /dev/null +++ b/docker/java/run.sh @@ -0,0 +1,2 @@ +echo "$1" > Main.java +javac Main.java && java Main diff --git a/docker/ruby/Dockerfile b/docker/ruby/Dockerfile new file mode 100644 index 0000000..563e2e9 --- /dev/null +++ b/docker/ruby/Dockerfile @@ -0,0 +1,5 @@ +FROM ruby:alpine +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/ruby/run.sh b/docker/ruby/run.sh new file mode 100644 index 0000000..457bd54 --- /dev/null +++ b/docker/ruby/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.rb +ruby program.rb diff --git a/docker/rust/Dockerfile b/docker/rust/Dockerfile new file mode 100644 index 0000000..9e617fe --- /dev/null +++ b/docker/rust/Dockerfile @@ -0,0 +1,5 @@ +FROM rust:slim +LABEL author="1Computer1" + +COPY run.sh /var/run/ +WORKDIR /var/ws diff --git a/docker/rust/run.sh b/docker/rust/run.sh new file mode 100644 index 0000000..ff63881 --- /dev/null +++ b/docker/rust/run.sh @@ -0,0 +1,2 @@ +echo "$1" > program.rs +rustc -C opt-level=0 --color never program.rs && ./program diff --git a/src/languages/clojure.js b/src/languages/clojure.js new file mode 100644 index 0000000..d05ceeb --- /dev/null +++ b/src/languages/clojure.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Clojure extends Language { + constructor() { + super('clojure', { + aliases: ['clojure', 'clj'] + }); + } +} + +module.exports = Clojure; diff --git a/src/languages/elixir.js b/src/languages/elixir.js new file mode 100644 index 0000000..d7c6dd3 --- /dev/null +++ b/src/languages/elixir.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Elixir extends Language { + constructor() { + super('elixir', { + aliases: ['elixir'] + }); + } +} + +module.exports = Elixir; diff --git a/src/languages/java.js b/src/languages/java.js new file mode 100644 index 0000000..2c4ce4e --- /dev/null +++ b/src/languages/java.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Java extends Language { + constructor() { + super('java', { + aliases: ['java'] + }); + } +} + +module.exports = Java; diff --git a/src/languages/ruby.js b/src/languages/ruby.js new file mode 100644 index 0000000..f04f894 --- /dev/null +++ b/src/languages/ruby.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Ruby extends Language { + constructor() { + super('ruby', { + aliases: ['ruby', 'rb'] + }); + } +} + +module.exports = Ruby; diff --git a/src/languages/rust.js b/src/languages/rust.js new file mode 100644 index 0000000..b4f036a --- /dev/null +++ b/src/languages/rust.js @@ -0,0 +1,11 @@ +const Language = require('../struct/Language'); + +class Rust extends Language { + constructor() { + super('rust', { + aliases: ['rust', 'rs'] + }); + } +} + +module.exports = Rust;