#!/usr/bin/env ruby if ARGV.size > 4 || ARGV[0] == "--help" || ARGV[0] == "-h" || ARGV[0] == "-?" puts "usage: #{File.basename($0)} [-e ] [--war []]" puts "\tdefault environment: development" exit 1 end args = [__FILE__.gsub(/-/, ':').gsub(/.*[\/\\]/, '')] if ARGV.size == 2 && ARGV[0] == "-e" args << "-Drails.env=#{ARGV[1]}" args << "-Prun" elsif ARGV.size == 1 && ARGV[0] == "--war" args = ["jetty:run-war", "-Pwar"] elsif ARGV.size == 2 && ARGV[0] == "--war" args = ["jetty:deploy-war", "-DwebApp=#{ARGV[1]}", "-Pwar"] elsif ARGV.size == 3 && ARGV[0] == "-e" && ARGV[2] == "--war" args = ["jetty:run-war", "-Pwar", "-Drails.env=#{ARGV[1]}"] elsif ARGV.size == 3 && ARGV[1] == "-e" && ARGV[0] == "--war" args = ["jetty:run-war", "-Pwar", "-Drails.env=#{ARGV[2]}"] elsif ARGV.size == 4 && ARGV[0] == "-e" && ARGV[2] == "--war" args = ["jetty:deploy-war", "-Pwar", "-DwebApp=#{ARGV[3]}", "-Drails.env=#{ARGV[1]}"] elsif ARGV.size == 4 && ARGV[2] == "-e" && ARGV[0] == "--war" args = ["jetty:deploy-war", "-Pwar", "-DwebApp=#{ARGV[1]}", "-Drails.env=#{ARGV[3]}"] end ARGV.replace(args) load File.join(File.dirname(__FILE__), "rmvn")