diff --git a/installer/install.sh b/installer/install.sh --- a/installer/install.sh +++ b/installer/install.sh @@ -2,7 +2,8 @@ echo "This script will install and configure Cafe grader." -echo "This will install Ruby 1.9.2 under rvm" +RUBY_VERSION=2.1.2 +echo "This will install Ruby $RUBY_VERSION under RVM" echo "Installing required apts" @@ -19,10 +20,10 @@ curl -k -L https://get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm -echo "Installing Ruby 2.1.2 in RVM" +echo "Installing Ruby $RUBY_VERSION in RVM" -rvm install 2.1.2 -rvm use 2.1.2 +rvm install $RUBY_VERSION +rvm use $RUBY_VERSION echo "Fetching Cafe Grader from Git repositories" @@ -160,10 +161,8 @@ MACHINE_TYPE=`uname -m` if [ ${MACHINE_TYPE} == 'x86_64' ]; then gcc -std=c99 -o scripts/std-script/box scripts/std-script/box64-new.c - # 64-bit stuff here else g++ -o scripts/std-script/box scripts/std-script/box.cc - # 32-bit stuff here fi diff --git a/new_problem b/new_problem --- a/new_problem +++ b/new_problem @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby # new_problem: # * creates a directory for a problem in the current directory, diff --git a/templates/check_wrapper b/templates/check_wrapper --- a/templates/check_wrapper +++ b/templates/check_wrapper @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby # # This is a check script wrapper. It read all required information diff --git a/test/data/ev/test_memory/script/check b/test/data/ev/test_memory/script/check --- a/test/data/ev/test_memory/script/check +++ b/test/data/ev/test_memory/script/check @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby problem_home = ENV['PROBLEM_HOME'] require "#{problem_home}/script/test_dsl.rb" diff --git a/test/data/ev/test_normal/script/check b/test/data/ev/test_normal/script/check --- a/test/data/ev/test_normal/script/check +++ b/test/data/ev/test_normal/script/check @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby problem_home = ENV['PROBLEM_HOME'] require "#{problem_home}/script/test_dsl.rb" diff --git a/test/data/ev/test_timeout/script/check b/test/data/ev/test_timeout/script/check --- a/test/data/ev/test_timeout/script/check +++ b/test/data/ev/test_timeout/script/check @@ -1,4 +1,4 @@ -#!/usr/bin/ruby +#!/usr/bin/env ruby problem_home = ENV['PROBLEM_HOME'] require "#{problem_home}/script/test_dsl.rb" diff --git a/test/engine_spec.rb b/test/engine_spec.rb --- a/test/engine_spec.rb +++ b/test/engine_spec.rb @@ -202,7 +202,7 @@ :grader_comment= => '', :running_stat= => /0.0\d* sec./, :output_file_name= => lambda { |fname| - File.exists?(fname).should be_true + File.exists?(fname).should be true }, :running_time= => nil, :exit_status= => nil, @@ -226,7 +226,7 @@ :exit_status= => nil, :memory_usage= => nil, :save => nil}) - File.exists?(@config.user_result_dir + "/test_request/test_normal/test_cases/1/input-1.txt").should be_false + File.exists?(@config.user_result_dir + "/test_request/test_normal/test_cases/1/input-1.txt").should be false end it "should compile test request with error and report compilation error" do @@ -255,7 +255,7 @@ :grader_comment= => '', :running_stat= => /[Ee]xit.*status.*10.*0\.0\d* sec/m, :output_file_name= => lambda { |fname| - File.exists?(fname).should be_true + File.exists?(fname).should be true }, :running_time= => nil, :exit_status= => /10/, @@ -275,7 +275,7 @@ :grader_comment= => '', :running_stat= => nil, :output_file_name= => lambda { |fname| - File.exists?(fname).should be_true + File.exists?(fname).should be true }, :running_time= => lambda { |t| (t>=0.14) and (t<=0.16)