lib/tomcat-rails/server.rb in calavera-tomcat-rails-0.1.2 vs lib/tomcat-rails/server.rb in calavera-tomcat-rails-0.2.0

- old
+ new

@@ -4,27 +4,35 @@ @@defaults = { :environment => 'development', :context_path => '/', :libs_dir => 'lib', :classes_dir => 'classes', + :default_web_xml => 'config/web.xml', :port => 3000, :jruby_min_runtimes => 1, :jruby_max_runtimes => 5 } def initialize(config = {}) + load_config(config) + load_tomcat_server + create_web_app + end + + def load_config(config) @config = @@defaults.merge!(config) @config[:web_app_dir] = Dir.pwd - + end + + def load_tomcat_server @tomcat = TomcatRails::Tomcat::Tomcat.new @tomcat.setPort(@config[:port].to_i) - - create_web_app end def create_web_app web_app = WebApp.new(@tomcat.addWebapp(@config[:context_path].to_s, @config[:web_app_dir]), @config) - + + web_app.load_default_web_xml web_app.add_rack_filter web_app.add_context_loader web_app.add_init_params web_app.add_web_dir_resources \ No newline at end of file