Show More
Commit Description:
add option -A <opt> to box. This options allow more argument to be explicitly passed to the program...
Commit Description:
add option -A <opt> to box. This options allow more argument to be explicitly passed to the program We have to use this because if the argument we wish to pass to the program is option (in -? format), box will intepret it as its option and failed accordingly. be noted that, by the definition of getopt, these options will be put after original argument (check the code for more info)
References:
File last commit:
Show/Diff file:
Action:
lib/configuration.rb | 84 lines | 2.4 KiB | text/x-ruby | RubyLexer |
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22 module Grader
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 # This singleton class holds basic configurations for grader. When
# running in each mode, grader uses resources from different
# directories and outputs differently. Usually the attributes name
# are descriptive; below we explain more on each attributes.
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22 class Configuration
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 # Rails' environment: "development", "production"
attr_accessor :rails_env
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 # Grader looks for problem [prob] in problem_dir/[prob], and store
# execution results for submission [x] of user [u] in directory
# user_result_dir/[u]/[x]
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22 attr_accessor :problems_dir
attr_accessor :user_result_dir
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23
# If report_grader=true, the grader would add a row in model
# GraderProcess. It would report itself with grader_hostname and
# process id.
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22 attr_accessor :report_grader
attr_accessor :grader_hostname
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23
# If talkative=true, grader would report status to console. If
# logging=true, grader would report status to a log file located
# in log_dir, in a file name mode.options.pid. TODO: defined
# log file naming.
attr_accessor :talkative
attr_accessor :logging
attr_accessor :log_dir
# These are directories related to the test interface.
attr_accessor :test_request_input_base_dir
attr_accessor :test_request_output_base_dir
attr_accessor :test_request_problem_templates_dir
# Comment received from the grading script will be filtered
# through Configuration#report_comment. How this method behave
# depends on this option; right now only two formats, :short and
# :long
attr_accessor :comment_report_style
def report_comment(comment)
case comment_report_style
when :short
jittat
[grader] fixed bug #6 and #9...
r37 if comment.chomp =~ /^[\[\]P]+$/ # all P's
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 'passed'
jittat
[grader] fixed bug #6 and #9...
r37 elsif comment.chomp =~ /[Cc]ompil.*[Ee]rror/
'compilation error'
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 else
'failed'
end
when :full
comment.chomp
end
end
# Codes for singleton
private_class_method :new
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22
@@instance = nil
def self.get_instance
if @@instance==nil
@@instance = new
end
@@instance
end
private
def initialize
@talkative = false
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 @log_file = nil
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22 @report_grader = false
@grader_hostname = `hostname`.chomp
@rails_env = 'development'
jittat
[grader] [MERGED] Merged new-arch-branch changes 74:105 into the trunk...
r23 @comment_report_style = :full
jittat
Merged new-arch-branch changes 61:73 into the trunk...
r22 end
end
end