class Closure::Compiler

much to see here.
The Closure::Compiler is a basic wrapper around the actual JAR. There’s not

def command

def command
  [@java, '-jar', @jar, @options].flatten
end

def compile(io)

block, for streaming.
JavaScript as a string or yields an IO object containing the response to a
Can compile a JavaScript string or open IO object. Returns the compiled
def compile(io)
  Open3.popen3(*command) do |stdin, stdout, stderr|
    if io.respond_to? :read
      while buffer = io.read(4096) do
        stdin.write(buffer)
      end
    else
      stdin.write(io.to_s)
    end
    stdin.close
    block_given? ? yield(stdout) : stdout.read
  end
end

def initialize(options={})

When you create a Compiler, pass in the flags and options.
def initialize(options={})
  @java     = options.delete(:java)     || JAVA_COMMAND
  @jar      = options.delete(:jar_file) || COMPILER_JAR
  @options  = serialize_options(options)
end

def serialize_options(options)

Serialize hash options to the command-line format.
def serialize_options(options)
  options.map {|k, v| ["--#{k}", v.to_s] }.flatten
end