Description:
Merge pull request #1 from nattee/master change hashbang to /usr/bin/env ruby
Commit status:
[Not Reviewed]
References:
merge default
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r194:f7ae7aa57090 - - 4 files changed: 4 inserted, 4 deleted

@@ -1,25 +1,25
1 - #!/usr/bin/ruby
1 + #!/usr/bin/env ruby
2
2
3 problem_home = ENV['PROBLEM_HOME']
3 problem_home = ENV['PROBLEM_HOME']
4 require "#{problem_home}/script/test_dsl.rb"
4 require "#{problem_home}/script/test_dsl.rb"
5
5
6 if ARGV.length < 2
6 if ARGV.length < 2
7 puts "Usage: check <language> <test-number> [<output-file>]"
7 puts "Usage: check <language> <test-number> [<output-file>]"
8 exit(0)
8 exit(0)
9 end
9 end
10
10
11 language = ARGV[0]
11 language = ARGV[0]
12 test_num = ARGV[1].to_i
12 test_num = ARGV[1].to_i
13 if ARGV.length >= 3
13 if ARGV.length >= 3
14 output_file_name = ARGV[2]
14 output_file_name = ARGV[2]
15 else
15 else
16 output_file_name = "output.txt"
16 output_file_name = "output.txt"
17 end
17 end
18
18
19 load "#{problem_home}/test_cases/all_tests.cfg"
19 load "#{problem_home}/test_cases/all_tests.cfg"
20 problem = Problem.get_instance
20 problem = Problem.get_instance
21
21
22 output_file = File.new(output_file_name, "r")
22 output_file = File.new(output_file_name, "r")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
24 result_file = File.new("check_result", "w")
24 result_file = File.new("check_result", "w")
25
25
@@ -1,25 +1,25
1 - #!/usr/bin/ruby
1 + #!/usr/bin/env ruby
2
2
3 problem_home = ENV['PROBLEM_HOME']
3 problem_home = ENV['PROBLEM_HOME']
4 require "#{problem_home}/script/test_dsl.rb"
4 require "#{problem_home}/script/test_dsl.rb"
5
5
6 if ARGV.length < 2
6 if ARGV.length < 2
7 puts "Usage: check <language> <test-number> [<output-file>]"
7 puts "Usage: check <language> <test-number> [<output-file>]"
8 exit(0)
8 exit(0)
9 end
9 end
10
10
11 language = ARGV[0]
11 language = ARGV[0]
12 test_num = ARGV[1].to_i
12 test_num = ARGV[1].to_i
13 if ARGV.length >= 3
13 if ARGV.length >= 3
14 output_file_name = ARGV[2]
14 output_file_name = ARGV[2]
15 else
15 else
16 output_file_name = "output.txt"
16 output_file_name = "output.txt"
17 end
17 end
18
18
19 load "#{problem_home}/test_cases/all_tests.cfg"
19 load "#{problem_home}/test_cases/all_tests.cfg"
20 problem = Problem.get_instance
20 problem = Problem.get_instance
21
21
22 output_file = File.new(output_file_name, "r")
22 output_file = File.new(output_file_name, "r")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
24 result_file = File.new("check_result", "w")
24 result_file = File.new("check_result", "w")
25
25
@@ -1,25 +1,25
1 - #!/usr/bin/ruby
1 + #!/usr/bin/env ruby
2
2
3 problem_home = ENV['PROBLEM_HOME']
3 problem_home = ENV['PROBLEM_HOME']
4 require "#{problem_home}/script/test_dsl.rb"
4 require "#{problem_home}/script/test_dsl.rb"
5
5
6 if ARGV.length < 2
6 if ARGV.length < 2
7 puts "Usage: check <language> <test-number> [<output-file>]"
7 puts "Usage: check <language> <test-number> [<output-file>]"
8 exit(0)
8 exit(0)
9 end
9 end
10
10
11 language = ARGV[0]
11 language = ARGV[0]
12 test_num = ARGV[1].to_i
12 test_num = ARGV[1].to_i
13 if ARGV.length >= 3
13 if ARGV.length >= 3
14 output_file_name = ARGV[2]
14 output_file_name = ARGV[2]
15 else
15 else
16 output_file_name = "output.txt"
16 output_file_name = "output.txt"
17 end
17 end
18
18
19 load "#{problem_home}/test_cases/all_tests.cfg"
19 load "#{problem_home}/test_cases/all_tests.cfg"
20 problem = Problem.get_instance
20 problem = Problem.get_instance
21
21
22 output_file = File.new(output_file_name, "r")
22 output_file = File.new(output_file_name, "r")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
24 result_file = File.new("check_result", "w")
24 result_file = File.new("check_result", "w")
25
25
@@ -1,25 +1,25
1 - #!/usr/bin/ruby
1 + #!/usr/bin/env ruby
2
2
3 problem_home = ENV['PROBLEM_HOME']
3 problem_home = ENV['PROBLEM_HOME']
4 require "#{problem_home}/script/test_dsl.rb"
4 require "#{problem_home}/script/test_dsl.rb"
5
5
6 if ARGV.length < 2
6 if ARGV.length < 2
7 puts "Usage: check <language> <test-number> [<output-file>]"
7 puts "Usage: check <language> <test-number> [<output-file>]"
8 exit(0)
8 exit(0)
9 end
9 end
10
10
11 language = ARGV[0]
11 language = ARGV[0]
12 test_num = ARGV[1].to_i
12 test_num = ARGV[1].to_i
13 if ARGV.length >= 3
13 if ARGV.length >= 3
14 output_file_name = ARGV[2]
14 output_file_name = ARGV[2]
15 else
15 else
16 output_file_name = "output.txt"
16 output_file_name = "output.txt"
17 end
17 end
18
18
19 load "#{problem_home}/test_cases/all_tests.cfg"
19 load "#{problem_home}/test_cases/all_tests.cfg"
20 problem = Problem.get_instance
20 problem = Problem.get_instance
21
21
22 output_file = File.new(output_file_name, "r")
22 output_file = File.new(output_file_name, "r")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
23 answer_file = File.new("#{problem_home}/test_cases/#{test_num}/answer-#{test_num}.txt")
24 result_file = File.new("check_result", "w")
24 result_file = File.new("check_result", "w")
25
25
You need to be logged in to leave comments. Login now