Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Ruby/BF/Chapel Updates #458

Merged
merged 6 commits into from
Jul 14, 2017
Merged
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
4 changes: 1 addition & 3 deletions docker/ruby.docker
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ RUN gem install statsample-timeseries --no-ri --no-rdoc
RUN gem install stuff-classifier --no-ri --no-rdoc
RUN gem install symbolic --no-ri --no-rdoc
RUN gem install unit --no-ri --no-rdoc

RUN gem install chronic --no-ri --no-rdoc

# partner packages
RUN gem install ably --no-ri --no-rdoc
RUN gem install bcrypt --no-ri --no-rdoc

USER codewarrior

Expand Down
1 change: 1 addition & 0 deletions lib/runners/bf.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports.run = function run(opts, cb) {
case 'cw-2':
var fixture = `
require('/runner/frameworks/javascript/cw-2');
${opts.setup};
const runBF = require('/runner/frameworks/bf/run-bf.js');
${opts.fixture};
`;
Expand Down
10 changes: 3 additions & 7 deletions lib/runners/chapel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module.exports.run = function run(opts, cb) {
const dir = temp.mkdirSync('chpl');
shovel.start(opts, cb, {
solutionOnly: function(runCode, fail) {
if (opts.setup) handleSetup(opts, dir);
const code = [opts.setup, opts.solution].filter(l => !!l).join("\n");
const executable = path.join(dir, 'solution');
const solutionFile = util.codeWriteSync('chpl', opts.solution, dir, 'solution.chpl');
const solutionFile = util.codeWriteSync('chpl', code, dir, 'solution.chpl');

compile([solutionFile, '-o', executable], function(error, stdout, stderr) {
if (error) return fail(error, stdout, stderr);
Expand All @@ -24,10 +24,10 @@ module.exports.run = function run(opts, cb) {
},

testIntegration: function(runCode, fail) {
if (opts.setup) handleSetup(opts, dir);
const executable = path.join(dir, 'solution');
const solutionFile = util.codeWriteSync('chpl', [
cw2,
opts.setup,
opts.solution,
opts.fixture,
].join('\n'), dir, 'solution.chpl');
Expand Down Expand Up @@ -56,7 +56,3 @@ module.exports.run = function run(opts, cb) {
function compile(args, cb) {
exec(`chpl ${args.join(' ')}`, cb);
}

function handleSetup(opts, dir) {
opts.solution = opts.setup + '\n' + opts.solution;
}