diff --git a/Rakefile b/Rakefile index 16fbcc9d..f758f3d1 100644 --- a/Rakefile +++ b/Rakefile @@ -17,58 +17,60 @@ Echoe.new("mongrel") do |p| p.require_signed = true case RUBY_PLATFORM - when /mswin/ - p.certificate_chain = ['~/gem_certificates/mongrel-public_cert.pem', - '~/gem_certificates/luislavena-mongrel-public_cert.pem'] - else - p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem', - '~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem'] - end + when /mswin/ + p.certificate_chain = ['~/gem_certificates/mongrel-public_cert.pem', + '~/gem_certificates/luislavena-mongrel-public_cert.pem'] + else + p.certificate_chain = ['~/p/configuration/gem_certificates/mongrel/mongrel-public_cert.pem', + '~/p/configuration/gem_certificates/evan_weaver-mongrel-public_cert.pem'] end p.eval = proc do case RUBY_PLATFORM - when /mswin/ - self.files += ['lib/http11.so'] - extensions.clear - self.platform = Gem::Platform::WIN32 - when /jruby/ - self.files += ['lib/http11.jar'] - extensions.clear - self.platform = 'jruby' - else - add_dependency('daemons', '>= 1.0.3') - add_dependency('fastthread', '>= 1.0.1') - end + when /mswin/ + extensions.clear + self.files += ['lib/http11.so'] + self.platform = Gem::Platform::WIN32 + when /jruby/ + extensions.clear + self.files += ['lib/http11.jar'] + self.platform = 'jruby' + else + add_dependency('daemons', '>= 1.0.3') + add_dependency('fastthread', '>= 1.0.1') + end end + +end + +#### A hack around RubyGems and Echoe for pre-compiled extensions. + +extension = "ext/http11/extconf.rb" +extension_dir = File.dirname(extension) + +def move_extensions + Dir["#{extension_dir}/*.#{Config::CONFIG['DLEXT']}"].each { |file| cp file, "lib/" } end case RUBY_PLATFORM - # A hack around RubyGems and Echoe for pre-compiled extensions. - when /mswin/ - file "lib/http11.so" do - extension = "ext/http11/extconf.rb" - directory = File.dirname(extension) - Dir.chdir(directory) do - ruby File.basename(extension) - system(PLATFORM =~ /win32/ ? 'nmake' : 'make') - end - move_extensions - end - task :compile => ["lib/http11.so"] - when /jruby/ - file "lib/http11.jar" do - directory = "jruby_ext/http11" - Dir.chdir(directory) { system "ant jar" } - move_extensions - end - task :compile => ["lib/http11.jar"] -end +when /mswin/ + filename = "lib/http11.so" + file filename do + Dir.chdir(extension_dir) do + ruby File.basename(extension) + system(PLATFORM =~ /win32/ ? 'nmake' : 'make') + end + move_extensions + end + task :compile => [filename] -#### Helper - -def move_extensions - Dir["#{directory}/*.#{Config::CONFIG['DLEXT']}"].each { |file| cp file, "lib/" } +when /jruby/ + filename = "lib/http11.jar" + file filename do + Dir.chdir(extension_dir) { sh "ant jar" } + move_extensions + end + task :compile => [filename] end #### Project-wide install and uninstall tasks diff --git a/jruby/src/java/Http11Service.java b/ext/http11/Http11Service.java similarity index 100% rename from jruby/src/java/Http11Service.java rename to ext/http11/Http11Service.java diff --git a/jruby/src/java/org/jruby/mongrel/Http11.java b/ext/http11/org/jruby/mongrel/Http11.java similarity index 100% rename from jruby/src/java/org/jruby/mongrel/Http11.java rename to ext/http11/org/jruby/mongrel/Http11.java diff --git a/jruby/src/java/org/jruby/mongrel/Http11Parser.java b/ext/http11/org/jruby/mongrel/Http11Parser.java similarity index 100% rename from jruby/src/java/org/jruby/mongrel/Http11Parser.java rename to ext/http11/org/jruby/mongrel/Http11Parser.java diff --git a/jruby/src/java/org/jruby/mongrel/URIClassifier.java b/ext/http11/org/jruby/mongrel/URIClassifier.java similarity index 100% rename from jruby/src/java/org/jruby/mongrel/URIClassifier.java rename to ext/http11/org/jruby/mongrel/URIClassifier.java diff --git a/jruby/src/java/org/jruby/mongrel/http11_parser.rl b/ext/http11/org/jruby/mongrel/http11_parser.rl similarity index 100% rename from jruby/src/java/org/jruby/mongrel/http11_parser.rl rename to ext/http11/org/jruby/mongrel/http11_parser.rl diff --git a/jruby/src/java/org/jruby/tst/Node.java b/ext/http11/org/jruby/tst/Node.java similarity index 100% rename from jruby/src/java/org/jruby/tst/Node.java rename to ext/http11/org/jruby/tst/Node.java diff --git a/jruby/src/java/org/jruby/tst/NodeLines.java b/ext/http11/org/jruby/tst/NodeLines.java similarity index 100% rename from jruby/src/java/org/jruby/tst/NodeLines.java rename to ext/http11/org/jruby/tst/NodeLines.java diff --git a/jruby/src/java/org/jruby/tst/TernarySearchTree.java b/ext/http11/org/jruby/tst/TernarySearchTree.java similarity index 100% rename from jruby/src/java/org/jruby/tst/TernarySearchTree.java rename to ext/http11/org/jruby/tst/TernarySearchTree.java diff --git a/jruby/.classpath b/jruby/.classpath deleted file mode 100755 index 2b7bb05e..00000000 --- a/jruby/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/jruby/.project b/jruby/.project deleted file mode 100644 index 28ac06d4..00000000 --- a/jruby/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - mongrel-support - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/jruby/Rakefile b/jruby/Rakefile deleted file mode 100644 index d9f0fa13..00000000 --- a/jruby/Rakefile +++ /dev/null @@ -1,63 +0,0 @@ -# Usage: -# Checkout mongrel from source -# Set the MONGREL_SUPPORT environment variable to the directory -# where this file is located. -# Go to the mongrel source tree -# Run this command -# jruby -S rake -f $MONGREL_SUPPORT/Rakefile -# - -require 'rake' -require 'rake/testtask' -require 'rake/clean' -require 'rake/gempackagetask' -require 'rake/rdoctask' -require 'tools/rakehelp' -require 'fileutils' -include FileUtils - -$mongrel_support = ENV['MONGREL_SUPPORT'] - -unless $mongrel_support - warn "MONGREL_SUPPORT needs to be set to the source directory of Mongrel" - exit 1 -end - -desc "Does a compile and package" -task :default => [:package] - -desc "Compiles Mongrel-support" -task :compile do - Dir.chdir($mongrel_support) do - sh %(ant jar) - end -end - -task :package => [:compile] - -task 'lib/http11.jar' do - cp "#{$mongrel_support}/lib/http11.jar", 'lib' -end - -name="mongrel" -version="1.0.1" - -setup_gem(name, version) do |spec| - spec.summary = "A small fast HTTP library and server that runs Rails, Camping, Nitro and Iowa apps." - spec.description = spec.summary - spec.test_files = Dir.glob("test/test_*.rb") - spec.author="Zed A. Shaw" - spec.executables=['mongrel_rails'] - spec.files += %w(README Rakefile setup.rb lib/mongrel/mime_types.yml) - - spec.required_ruby_version = '>= 1.8.4' - - spec.files += ['lib/http11.jar'] - spec.extensions.clear - spec.platform = 'jruby' - - spec.add_dependency('gem_plugin', '>= 0.2.2') - spec.add_dependency('cgi_multipart_eof_fix', '>= 1.0.0') -end - - diff --git a/jruby/build.properties.SAMPLE b/jruby/build.properties.SAMPLE deleted file mode 100644 index 0d832e28..00000000 --- a/jruby/build.properties.SAMPLE +++ /dev/null @@ -1,2 +0,0 @@ -version.target=1.4 -version.source=1.4 diff --git a/jruby/build.xml b/jruby/build.xml deleted file mode 100644 index 352a6245..00000000 --- a/jruby/build.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jruby/lib/jruby.jar b/jruby/lib/jruby.jar deleted file mode 100644 index 92a87e70..00000000 Binary files a/jruby/lib/jruby.jar and /dev/null differ diff --git a/jruby/src/test/testParser.rb b/test/java/testParser.rb similarity index 100% rename from jruby/src/test/testParser.rb rename to test/java/testParser.rb diff --git a/jruby/src/test/testParserImpl.rb b/test/java/testParserImpl.rb similarity index 100% rename from jruby/src/test/testParserImpl.rb rename to test/java/testParserImpl.rb diff --git a/jruby/src/test/test_http11.rb b/test/java/test_http11.rb similarity index 100% rename from jruby/src/test/test_http11.rb rename to test/java/test_http11.rb diff --git a/jruby/src/test/test_performance.rb b/test/java/test_performance.rb similarity index 100% rename from jruby/src/test/test_performance.rb rename to test/java/test_performance.rb