Sha256: 59162e22b46c37529b79a10a14f40851bb30480fc460bbab2b179b6c3b5df2ab
Contents?: true
Size: 1.62 KB
Versions: 18
Compression:
Stored size: 1.62 KB
Contents
#!/usr/bin/env ruby require 'drb' require 'pry' begin begin DRb.start_service("druby://localhost:0") rescue SocketError, Errno::EADDRNOTAVAIL DRb.start_service("druby://:0") end $spec_server = DRbObject.new_with_uri("druby://127.0.0.1:8989") rescue DRb::DRbConnError err.puts "No DRb server is running. Running in local process instead ..." end def rspec(file=nil) if file $spec_server.run(["--color", "--format", "s", file], STDERR, STDOUT) else $spec_server.run(["--color", 'spec'], STDERR, STDOUT) end end $service = nil def service $service ||= com.espertech.esper.client.EPServiceProviderManager.getDefaultProvider end $administrator = nil def administrator $administrator ||= service.getEPAdministrator end def compileEPL(query_str) administrator.compileEPL(query_str) end def query_string(model) writer = java.io.StringWriter.new formatter = com.espertech.esper.client.soda.EPStatementFormatter.new if model.respond_to?(:toEPLElement) model.toEPLElement(writer) writer.toString elsif model.respond_to?(:toPrecedenceFreeEPL) model.toPrecedenceFreeEPL(writer) writer.toString elsif model.is_a?(Java::ComEspertechEsperClientSoda::EPStatementObjectModel) model.toEPL else model.toEPL(writer, formatter) writer.toString end end puts <<DESC Example: > rspec 'spec/xxx_spec.rb' or (for all tests) > rspec DESC $LOAD_PATH.push './lib' $LOAD_PATH.push './esper' require 'norikra' require 'java' require 'esper-4.9.0.jar' require 'esper/lib/commons-logging-1.1.1.jar' require 'esper/lib/antlr-runtime-3.2.jar' require 'esper/lib/cglib-nodep-2.2.jar' Pry.start
Version data entries
18 entries across 18 versions & 1 rubygems