Description:
last commit is a dud...fixing it now.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r152:394121525814 - - 1 file changed: 1 inserted, 1 deleted
@@ -103,25 +103,25 | |||||
|
103 | when "java" |
|
103 | when "java" |
|
104 | #rename the file to the public class name |
|
104 | #rename the file to the public class name |
|
105 |
|
105 | ||
|
106 | #get the class name |
|
106 | #get the class name |
|
107 | classname = 'DUMMY' |
|
107 | classname = 'DUMMY' |
|
108 | File.foreach(params[:source_file]) do |line| |
|
108 | File.foreach(params[:source_file]) do |line| |
|
109 | md = /\s*public\s*class\s*(\w*)/.match(line) |
|
109 | md = /\s*public\s*class\s*(\w*)/.match(line) |
|
110 | classname=md[1] if md |
|
110 | classname=md[1] if md |
|
111 | end |
|
111 | end |
|
112 | system("cp #{params[:source_file]} #{classname}.java") |
|
112 | system("cp #{params[:source_file]} #{classname}.java") |
|
113 | command = "#{JAVA_COMPILER} #{classname}.java 2> #{params[:message_file]}" |
|
113 | command = "#{JAVA_COMPILER} #{classname}.java 2> #{params[:message_file]}" |
|
114 | system(command) |
|
114 | system(command) |
|
115 |
- if File.exists?(classname + ".class") |
|
115 | + if File.exists?(classname + ".class") |
|
116 | File.open(params[:output_file],"w") {|file| file.write("#!/bin/sh\n/usr/bin/java #{classname}\n")} |
|
116 | File.open(params[:output_file],"w") {|file| file.write("#!/bin/sh\n/usr/bin/java #{classname}\n")} |
|
117 | File.chmod(0755, params[:output_file]) |
|
117 | File.chmod(0755, params[:output_file]) |
|
118 | end |
|
118 | end |
|
119 |
|
119 | ||
|
120 | when "ruby" |
|
120 | when "ruby" |
|
121 | command = "#{RUBY_INTEPRETER} -c #{params[:source_file]} > #{params[:message_file]}" |
|
121 | command = "#{RUBY_INTEPRETER} -c #{params[:source_file]} > #{params[:message_file]}" |
|
122 | system(command) |
|
122 | system(command) |
|
123 | File.open(params[:output_file],"w") do |out_file| |
|
123 | File.open(params[:output_file],"w") do |out_file| |
|
124 | out_file.puts "#!#{RUBY_INTEPRETER}" |
|
124 | out_file.puts "#!#{RUBY_INTEPRETER}" |
|
125 | File.open(params[:source_file],"r").each do |line| |
|
125 | File.open(params[:source_file],"r").each do |line| |
|
126 | out_file.print line |
|
126 | out_file.print line |
|
127 | end |
|
127 | end |
You need to be logged in to leave comments.
Login now