Skip to content
Browse files

amend for jruby, setup warbler to generate a war

  • Loading branch information...
1 parent 14e458d commit c3d85f8e70ce0ca0a6bcc77f491e453eacce9a6f @siuying committed
Showing with 23 additions and 4 deletions.
  1. +2 −1 .rvmrc
  2. +2 −1 Gemfile
  3. +4 −0 bin/rackup
  4. +2 −2 config.ru
  5. +13 −0 config/warble.rb
View
3 .rvmrc
@@ -1 +1,2 @@
-rvm use 1.9.3-p194
+rvm use jruby
+export JRUBY_OPTS='-X+O --1.9 -J-d32'
View
3 Gemfile
@@ -13,5 +13,6 @@ group :development do
end
group :production do
- gem "sinatra", "~> 1.3.2"
+ gem "sinatra", "~> 1.3.1"
+ gem "warbler" if RUBY_PLATFORM =~ /java/
end
View
4 bin/rackup
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+
+require "rack"
+Rack::Server.start
View
4 config.ru
@@ -1,9 +1,9 @@
require 'rubygems'
require 'bundler'
-Bundler.require :default
+Bundler.require :default, :production
$LOAD_PATH << "lib"
require 'instant'
require 'instant/sinatra/app'
-run Instant::Sinatra::App
+run Instant::Sinatra::App
View
13 config/warble.rb
@@ -0,0 +1,13 @@
+# Warbler web application assembly configuration file
+Warbler::Config.new do |config|
+ config.features = %w(executable)
+ config.dirs = %w(config lib views public)
+ config.includes = FileList["config.ru", "Gemfile", "Gemfile.lock"]
+ config.gem_excludes = [/^(test|spec)\//]
+
+ config.jar_name = "instant"
+ config.public_html = FileList["public/**/*"]
+
+ config.webxml.jruby.compat.version = "1.9"
+ config.webxml.rackup = File.read("config.ru")
+end

0 comments on commit c3d85f8

Please sign in to comment.
Something went wrong with that request. Please try again.