add bin/ruby command to launch ruby scripts using the logstash launcher

use bin/ruby instead of hardcoded vendorized jruby

without :development

remove symlink check per PR discussiom, will re-introduce in a followup PR
This commit is contained in:
Colin Surprenant 2016-11-22 16:38:04 -05:00
parent 23584a0799
commit ca9ff9172d
2 changed files with 26 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env vendor/jruby/bin/jruby
#!/usr/bin/env bin/ruby
require_relative "../lib/bootstrap/environment"
LogStash::Bundler.setup!({:without => [:build]})
LogStash::Bundler.setup!({:without => [:build, :development]})
require "logstash-core"
require "logstash/environment"
require "logstash/settings"

24
bin/ruby Executable file
View file

@ -0,0 +1,24 @@
#!/bin/sh
# Run a ruby script using the logstash jruby launcher
#
# Usage:
# bin/ruby [arguments]
#
# Supported environment variables:
# LS_JVM_OPTS="xxx" path to file with JVM options
# LS_JAVA_OPTS="xxx" to append extra options to the defaults JAVA_OPTS provided by logstash
# JAVA_OPTS="xxx" to *completely override* the defauls set of JAVA_OPTS provided by logstash
#
# Development environment variables:
# USE_RUBY=1 to force use the local "ruby" command to launch logstash instead of using the vendored JRuby
# DEBUG=1 to output debugging information
# use faster starting JRuby options see https://github.com/jruby/jruby/wiki/Improving-startup-time
export JRUBY_OPTS="$JRUBY_OPTS -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1"
unset CDPATH
. "$(cd `dirname $0`/..; pwd)/bin/logstash.lib.sh"
setup
ruby_exec "$@"