Add javascript master
authorPetru Trimbitas <petru@wellcode.com>
Fri, 15 Apr 2022 18:26:23 +0000 (21:26 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 17 Apr 2022 18:38:46 +0000 (21:38 +0300)
README [deleted file]
gruntmaster-compile
lib/Gruntmaster/Daemon.pm
t/01-jobs.t
t/problems/hello/tests/javascript/meta.yml [new file with mode: 0644]
t/problems/hello/tests/javascript/prog.js [new file with mode: 0644]

diff --git a/README b/README
deleted file mode 100644 (file)
index 1b0e7ab..0000000
--- a/README
+++ /dev/null
@@ -1,40 +0,0 @@
-Gruntmaster-Daemon version 0.001
-================================
-
-The README is used to introduce the module and provide instructions on
-how to install the module, any machine dependencies it may have (for
-example C compilers and installed libraries) and any other information
-that should be provided before the module is installed.
-
-A README file is required for CPAN modules since CPAN extracts the
-README file from a module distribution so that people browsing the
-archive can use it get an idea of the modules uses. It is usually a
-good idea to provide version information here so that people can
-decide whether fixes for the module are worth downloading.
-
-INSTALLATION
-
-To install this module type the following:
-
-   perl Makefile.PL
-   make
-   make test
-   make install
-
-DEPENDENCIES
-
-This module requires these other modules and libraries:
-
-  blah blah blah
-
-COPYRIGHT AND LICENCE
-
-Put the correct copyright and licence information here.
-
-Copyright (C) 2013 by Marius Gavrilescu
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.18.1 or,
-at your option, any later version of Perl 5 you may have available.
-
-
index 2538cde310777a7dcd17f43f34e1128bfcbbe085..3599621a741b3dab66170af972b7d349575b31e7 100755 (executable)
@@ -41,11 +41,12 @@ given ($format){
                exit
        }
 
-       when ([qw/GOLFSCRIPT JULIA PERL PHP PYTHON PYTHON3 RUBY SBCL/]){
+       when ([qw/GOLFSCRIPT JAVASCRIPT JULIA PERL PHP PYTHON PYTHON3 RUBY SBCL/]){
                open IN, '<', $name;
                open OUT, '>', $basename;
                print OUT "#!/usr/bin/golfscript\n"                                                             if $_ eq 'GOLFSCRIPT';
                print OUT "#!/usr/bin/julia -O\n"                                                               if $_ eq 'JULIA';
+               print OUT "#!/usr/bin/node\n"                                                                   if $_ eq 'JAVASCRIPT';
                print OUT "#!/usr/bin/perl\n"                                                                   if $_ eq 'PERL';
                print OUT "#!/usr/bin/php -d ONLINE_JUDGE=true\n"                                               if $_ eq 'PHP';
                print OUT "#!/usr/bin/python2.7\n"                                                              if $_ eq 'PYTHON';
index ef24364184c6ef403ae898acee7d2cf7046c2af3..9597572cbbdb8cd31bc33ecde60d7ad07dc5be97 100644 (file)
@@ -27,6 +27,7 @@ use constant FORMAT_EXTENSION => {
        GOLFSCRIPT => 'gs',
        HASKELL => 'hs',
        JAVA => 'java',
+       JAVASCRIPT => 'js',
        JULIA => 'jl',
        MONO => 'cs',
        OBERON => 'm',
index 0bb2350a0c18b29e5f39cfbce3d5d68efa7c831f..c37e081b368c74df76c63049f9ca2e7196cc2d05 100644 (file)
@@ -26,6 +26,7 @@ use constant COMPILER => {
           GOLFSCRIPT golfscript
           MONO gmcs
           JAVA javac
+          JAVASCRIPT node
           JULIA julia
           PASCAL fpc
           GOLANG go
@@ -40,7 +41,7 @@ use constant COMPILER => {
           OCAML ocaml
           SBCL sbcl/};
 
-my %needs_fork = map { $_ => 1 } qw/GOLANG GOLFSCRIPT GCCGO JAVA JULIA RUBY/;
+my %needs_fork = map { $_ => 1 } qw/GOLANG GOLFSCRIPT GCCGO JAVA JAVASCRIPT JULIA RUBY SBCL/;
 
 my $loglevel = $ENV{TEST_LOG_LEVEL} // ($ENV{TEST_VERBOSE} ? 'TRACE' : 'OFF');
 my $log_conf = <<CONF;
diff --git a/t/problems/hello/tests/javascript/meta.yml b/t/problems/hello/tests/javascript/meta.yml
new file mode 100644 (file)
index 0000000..c7be177
--- /dev/null
@@ -0,0 +1,7 @@
+test_name: Javascript
+test_description: Hello world in Javascript
+problem: hello
+files:
+  prog:
+    format: JAVASCRIPT
+    name: prog.js
diff --git a/t/problems/hello/tests/javascript/prog.js b/t/problems/hello/tests/javascript/prog.js
new file mode 100644 (file)
index 0000000..7e2c877
--- /dev/null
@@ -0,0 +1 @@
+console.log('Hello World!')
This page took 0.017047 seconds and 4 git commands to generate.