app/controllers/compiles_controller.rb
# GET /compiles/new
# GET /compiles/new.json
#
# Executes when user clicks the save button
# Saves code to disk and returns a UUID to the 
# browser. If the code is compilable it will also
# be compiled.


Executes when user clicks the save button
Saves code to disk and returns a UUID to the
browser. If the code is compilable it will also
be compiled.
Executes when user clicks the save button Saves code to disk and returns a UUID to the browser . If the code is compilable it will also be compiled .
def compile(dir)
    file = "#{dir}/#{@compile[:classname]}.java"
    File.open(file, "w+"  ) do |f|
      f.puts @compile[:code]
    end
    return Open3.popen3("javac #{file}")
  end
def compile ( dir ) file = "#{dir}/#{@compile[:classname]}.java" File . open ( file , "w+" ) do | f | f . puts @compile [ :code ] end return Open3 . popen3 ( "javac #{file}" ) end
GET /compiles/new
GET /compiles/new.json
GET / compiles / new GET / compiles / new . json
dir