Merge branch 'develop' into dev_aliyun

dev_forum
daiao 5 years ago
commit 3b6827bb33

@ -124,14 +124,17 @@ module ShixunsHelper
if script.present? if script.present?
source_class_name = [] source_class_name = []
challenge_program_name = [] challenge_program_name = []
logger.info("########-----shixun.challenges.map(&:exec_path):#{shixun.challenges.map(&:exec_path)}")
shixun.challenges.map(&:exec_path).each do |exec_path| shixun.challenges.map(&:exec_path).each do |exec_path|
challenge_program_name << "\"#{exec_path}\"" challenge_program_name << "\"#{exec_path}\""
logger.info("----mirror_name: #{shixun.main_mirror_name.try(:first)}")
if shixun.main_mirror_name.try(:first) == "Java" if shixun.main_mirror_name.try(:first) == "Java"
if exec_path.nil? || exec_path.split("src/")[1].nil? if exec_path.nil? || exec_path.split("src/")[1].nil?
source = "\"\"" source = "\"\""
else else
source = "\"#{exec_path.split("src/")[1].split(".java")[0]}\"" source = "\"#{exec_path.split("src/")[1].split(".java")[0]}\""
end end
logger.info("----source: #{source}")
source_class_name << source.gsub("/", ".") if source.present? source_class_name << source.gsub("/", ".") if source.present?
elsif shixun.main_mirror_name.try(:first) == "C#" elsif shixun.main_mirror_name.try(:first) == "C#"
if exec_path.nil? || exec_path.split(".")[1].nil? if exec_path.nil? || exec_path.split(".")[1].nil?
@ -142,6 +145,7 @@ module ShixunsHelper
source_class_name << source if source.present? source_class_name << source if source.present?
end end
end end
logger.info("######source_class_name: #{source_class_name}")
script = if script.include?("sourceClassName") && script.include?("challengeProgramName") script = if script.include?("sourceClassName") && script.include?("challengeProgramName")
script.gsub(/challengeProgramNames=\(.*\)/,"challengeProgramNames=\(#{challenge_program_name.reject(&:blank?).join(" ")}\)").gsub(/sourceClassNames=\(.*\)/, "sourceClassNames=\(#{source_class_name.reject(&:blank?).join(" ")}\)") script.gsub(/challengeProgramNames=\(.*\)/,"challengeProgramNames=\(#{challenge_program_name.reject(&:blank?).join(" ")}\)").gsub(/sourceClassNames=\(.*\)/, "sourceClassNames=\(#{source_class_name.reject(&:blank?).join(" ")}\)")
else else

Loading…
Cancel
Save