Sha256: 9b6c3ad8ab680d6f1c3ec7b42dca0c8ad533bee78c3d9f1febe48fb5f7d5f42a

Contents?: true

Size: 815 Bytes

Versions: 5

Compression:

Stored size: 815 Bytes

Contents

module Jstdutil
  #
  # <tt>Jstdutil::Cli</tt> is a tiny wrapper to the JsTestDriver
  # jar, simply allowing you to avoid the clunkiness of <tt>`java -jar FILE [ARGS]`</tt>
  #
  # The wrapper also formats output with <tt>JsRedGreen</tt>, yielding
  # beautiful test reports.
  #
  # In addition to the JsTestDriver arguments you can specify the path
  # to the jar file by --jar. This kinda defeats the purpose, though,
  # so a better solution is to set the environment variable
  # $JSTESTDRIVER_HOME to where the jar file lives (see <tt>JsTestDriver.jar</tt>).
  #
  class Cli
    def self.run(args = [])
      args = args.join(" ")
      jar = (args.match(/--jar\s+([^\s]+)/) || [])[1] || Jstdutil.jar

      Jstdutil::RedGreen.format(Jstdutil.run("#{args.sub(/--jar\s+[^\s]+/, '')}", jar))
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
jstdutil-0.1.2 lib/jstdutil/cli.rb
jstdutil-0.1.1 lib/jstdutil/cli.rb
jstdutil-0.1.0 lib/jstdutil/cli.rb
jstdutil-0.0.2 lib/jstdutil/cli.rb
jstdutil-0.0.1 lib/jstdutil/cli.rb