lib/java_head/class.rb
# Take given command line arguments, check them for validity, add them to a java command and run the command to execute the class
#
# @param [Array] args the command-line arguments to be passed to the Java program
# @return [String] the output of the program execution
Take given command line arguments, check them for validity, add them to a java command and run the command to execute the class
Take given command line arguments check them for validity add them to a java command and run the command to execute the class
def exec(*args)
      raise RunnerException, "Class #{fullname} cannot be run because it is not compiled" unless compiled?
      command = "java #{fullname}"
      args.each do |arg|
        arg = arg.to_s
        raise RunnerException, "Invalid command-line argument: #{arg}" unless arg.match ARGFORMAT
        command << ' '
        command << arg
      end
      `#{command}`
    end
def exec ( * args ) raise RunnerException , "Class #{fullname} cannot be run because it is not compiled" unless compiled? command = "java #{fullname}" args . each do | arg | arg = arg . to_s raise RunnerException , "Invalid command-line argument: #{arg}" unless arg . match ARGFORMAT command << ' ' command << arg end ` #{ command } ` end
Take given command line arguments, check them for validity, add them to a java command and run the command to execute the class
Take given command line arguments check them for validity add them to a java command and run the command to execute the class
the output of the program execution
the output of the program execution
String
args
args the command-line arguments to be passed to the Java program
args the command - line arguments to be passed to the Java program