Index: war_config.rb
===================================================================
--- war_config.rb	(revision 563)
+++ war_config.rb	(working copy)
@@ -35,7 +35,7 @@
     # if you set this to false gems will fail to load if their dependencies aren't available
     attr_accessor :add_gem_dependencies
     # standalone?
-    attr_accessor :standalone
+    attr_reader :standalone
     # rails environment?
     attr_accessor :rails_env
 
@@ -64,8 +64,9 @@
       @keep_source =  false
       @add_gem_dependencies = true
       @servlet = 'org.jruby.webapp.RailsServlet'
-      @rails_env = 'production'
+      @rails_env = ENV['RAILS_ENV'] || 'production'
       @datasource_jndi = false
+      @standalone = false
 
       home = ENV['HOME'] || ENV['USERPROFILE']
       @jruby_home = ENV['JRUBY_HOME']
@@ -120,7 +121,12 @@
       # load user configuration
       load_user_configuration
     end # initialize
-    
+   
+    def standalone=(value)
+      @standalone = value 
+      @staging = '.' if @standalone
+    end 
+
     def exclude_files(pattern)
       @excludes << pattern
     end
Index: packer.rb
===================================================================
--- packer.rb	(revision 563)
+++ packer.rb	(working copy)
@@ -1,3 +1,4 @@
+require 'fileutils'
 
 module War
   
@@ -12,6 +13,10 @@
     def install(source, dest, mode=0644)
       File.install(source, dest, mode)
     end
+    
+    def copy(source, dest)
+      File.copy(source, dest)
+    end
 	  
 	  def copy_tree(files, target, strip_prefix='')
 	    files.each do |f|
@@ -24,9 +29,14 @@
 	        File.makedirs(File.dirname(target_file))
 	        install(f, target_file)
 	      end
-	    end    
+	    end
 	  end
 	  
+	  def copy_dir(source, target, mode=0644)
+	    #print " copy_dir(#{source}, #{target}, #{mode.to_s})\n"
+	    FileUtils.cp_r(source, target)
+    end
+	  
 	  def compile_tree(dir, config)
 	    return unless config.compile_ruby
 	    # find the libraries
@@ -113,8 +125,10 @@
         install(gem.loaded_from, File.join(target_gem_home, 'specifications'), 0644)
         # copy the files
         File.makedirs(gem_target)
-        gem_files = Rake::FileList.new(File.join(gem.full_gem_path, '**', '*'))
-        copy_tree(gem_files, gem_target, gem.full_gem_path)
+        
+        # recursive copy the tree
+        copy_dir(gem.full_gem_path + '/.', gem_target)
+        
         # compile the .rb files to .rb.ast.ser
         compile_tree(File.join(gem_target, 'lib'), config)
 
@@ -155,6 +169,7 @@
       webapp_files.exclude(File.join('tmp', 'sessions', '*'))
       webapp_files.exclude(File.join('tmp', 'sockets', '*'))
       webapp_files.exclude(File.join('tmp', 'jetty'))
+      webapp_files.exclude(File.join('WEB-INF', '*'))
       config.excludes.each do |exclude|
         webapp_files.exclude(exclude)
       end
Index: create_war.rb
===================================================================
--- create_war.rb	(revision 563)
+++ create_war.rb	(working copy)
@@ -49,7 +49,7 @@
     def assemble
       puts 'Assembling web application'
       add_java_libraries
-      add_webapp
+      add_webapp if not config.standalone
       if config.standalone
         add_ruby_libraries
       end
