Sha256: 479a5e97de0538c51951f56eaa1be62a9122067bc1d904e8c4368cb2d89603ec

Contents?: true

Size: 812 Bytes

Versions: 7

Compression:

Stored size: 812 Bytes

Contents

require 'rbconfig'

# ideas taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
Aruba.configure do |config|
  config.before :command do |command|
    next unless RUBY_PLATFORM == 'java'

    env = command.environment

    jruby_opts = env['JRUBY_OPTS'] || ''

    # disable JIT since these processes are so short lived
    jruby_opts = "-X-C #{jruby_opts}" unless jruby_opts.include? '-X-C'

    # Faster startup for jruby
    jruby_opts = "--dev #{jruby_opts}" unless jruby_opts.include? '--dev'

    env['JRUBY_OPTS'] = jruby_opts

    if RbConfig::CONFIG['host_os'] =~ /solaris|sunos/i
      java_opts = env['JAVA_OPTS'] || ''

      # force jRuby to use client JVM for faster startup times
      env['JAVA_OPTS'] = "-d32 #{java_opts}" unless java_opts.include?('-d32')
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
aruba-0.14.14 lib/aruba/config/jruby.rb
aruba-0.14.13 lib/aruba/config/jruby.rb
aruba-1.0.0.pre.alpha.5 lib/aruba/config/jruby.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/aruba-0.14.12/lib/aruba/config/jruby.rb
aruba-0.14.12 lib/aruba/config/jruby.rb
aruba-0.14.11 lib/aruba/config/jruby.rb
aruba-0.14.10 lib/aruba/config/jruby.rb