lib/appengine-tools/boot.rb in appengine-tools-0.0.14 vs lib/appengine-tools/boot.rb in appengine-tools-0.0.15.pre
- old
+ new
@@ -16,42 +16,14 @@
require 'appengine-sdk'
module AppEngine
module Development
-
+
BOOT_APP_RB = File.join(File.dirname(__FILE__), 'boot_app.rb')
class << self
- def boot_jruby(root=nil, options={})
- unless defined?(JRUBY_VERSION)
- require 'jruby-jars'
-
- jars = [
- JRubyJars.core_jar_path,
- JRubyJars.stdlib_jar_path,
- AppEngine::SDK::TOOLS_JAR,
- ]
-
- args = options[:args] || ARGV
- should_exec = options[:exec]
- should_exec ||= should_exec.nil?
-
- # TODO This is really ugly. We should just be using -I
- # for the paths we need (appengine-tools and it's deps)
- ENV['GEM_HOME'] = Gem.dir
- ENV['GEM_PATH'] = Gem.path.compact.join(File::SEPARATOR)
- appcfg = [File.expand_path(File.join(File.dirname($0),
- 'appcfg.rb'))]
- if should_exec
- exec_jruby(root, jars, appcfg + args)
- else
- run_jruby(root, jars, appcfg + args)
- end
- end
- end
-
def boot_app(root, args)
root = File.expand_path(root)
jars = AppEngine::SDK::RUNTIME_JARS
@@ -59,31 +31,24 @@
ENV['APPLICATION_ROOT'] = root
ENV.delete 'GEM_HOME'
exec_jruby(root, jars, jruby_args)
end
-
+
def build_command(root, jars, args)
app_jars = root ? Dir.glob("#{root}/WEB-INF/lib/*.jar") : []
classpath = (app_jars + jars).join(File::PATH_SEPARATOR)
utf = "-Dfile.encoding=UTF-8"
command = %W(java #{utf} -cp #{classpath} org.jruby.Main) + args
if ENV['VERBOSE']
puts command.map {|a| a.inspect}.join(' ')
end
command
end
-
+
def exec_jruby(root, jars, args)
java_command = build_command(root, jars, args)
exec *java_command
- end
-
- def run_jruby(root, jars, args)
- java_command = build_command(root, jars, args)
- if !system(*java_command)
- puts 'Error executing jruby'
- end
end
end
end
end