Sha256: 38562412eaa18cb5310448d4ad9b321fbf349b75dbc0bc9cb8b85a77fd4fc764

Contents?: true

Size: 730 Bytes

Versions: 5

Compression:

Stored size: 730 Bytes

Contents

module Java

  class VM

    def run(classname, options)
      command = [ "java" ]
      command << "-cp \"#{options[:classpath]}\""
      command << classname
      command << jvm_properties(options[:properties])
      command << options[:args].join(' ') if options[:args]
      command << ">\"#{options[:log_file]}\" 2>&1" if options[:log_file]

      if options[:background]
        if PLATFORM['win32']
          command.unshift("start")
        else
          command << "&"
        end
      end

      sh command.join(' ')
    end

    def jvm_properties(property_hash)
      return "" unless property_hash
      property_hash.inject([]) {|memo, (name, value)| memo << "-D#{name}=#{value}" }.join(' ')
    end

  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
selenium-rspec-dsl-1.0.2 vendor/selenium-grid-1.0.4/lib/ruby/java/vm.rb
statt-0.0.4 lib/selenium-grid/lib/ruby/java/vm.rb
statt-0.0.3 lib/selenium-grid/lib/ruby/java/vm.rb
statt-0.0.2 lib/selenium-grid/lib/ruby/java/vm.rb
statt-0.0.1 lib/selenium-grid/lib/ruby/java/vm.rb