Permalink
Browse files

Put everything back into the Rakefile

  • Loading branch information...
1 parent 4439cfb commit 6a107fdd76726ec82f300a3e9b6da2d032818075 @evanphx evanphx committed Dec 2, 2011
Showing with 86 additions and 115 deletions.
  1. +0 −15 Manifest.txt
  2. +86 −8 Rakefile
  3. +0 −28 tasks/gem.rake
  4. +0 −8 tasks/java.rake
  5. +0 −32 tasks/native.rake
  6. +0 −24 tasks/ragel.rake
View
@@ -7,17 +7,6 @@ README.md
Rakefile
TODO
bin/puma
-examples/builder.rb
-examples/camping/README
-examples/camping/blog.rb
-examples/camping/tepee.rb
-examples/httpd.conf
-examples/mime.yaml
-examples/mongrel.conf
-examples/monitrc
-examples/random_thrash.rb
-examples/simpletest.rb
-examples/webrick_compare.rb
ext/puma_http11/PumaHttp11Service.java
ext/puma_http11/ext_help.h
ext/puma_http11/extconf.rb
@@ -39,10 +28,6 @@ lib/puma/server.rb
lib/puma/thread_pool.rb
lib/rack/handler/puma.rb
puma.gemspec
-tasks/gem.rake
-tasks/java.rake
-tasks/native.rake
-tasks/ragel.rake
test/ab_rs.rb
test/lobster.ru
test/mime.yaml
View
@@ -1,12 +1,90 @@
-#
-# NOTE: Keep this file clean.
-# Add your customizations inside tasks directory.
-# Thank You.
-#
-
require 'rubygems'
+require 'hoe'
+
IS_JRUBY = defined?(RUBY_ENGINE) ? RUBY_ENGINE == "jruby" : false
-# load rakefile extensions (tasks)
-Dir['tasks/*.rake'].sort.each { |f| load f }
+HOE = Hoe.spec 'puma' do
+ self.rubyforge_name = 'puma'
+ self.readme_file = "README.md"
+ developer 'Evan Phoenix', 'evan@phx.io'
+
+ spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
+ spec_extras[:executables] = ['puma']
+
+ dependency 'rack', '~> 1.2'
+
+ extra_dev_deps << ['rake-compiler', "~> 0.7.0"]
+
+ clean_globs.push('test_*.log', 'log')
+end
+
+task :test => [:compile]
+
+# hoe/test and rake-compiler don't seem to play well together, so disable
+# hoe/test's .gemtest touch file thingy for now
+HOE.spec.files -= [".gemtest"]
+
+file "#{HOE.spec.name}.gemspec" => ['Rakefile', 'tasks/gem.rake'] do |t|
+ puts "Generating #{t.name}"
+ File.open(t.name, 'w') { |f| f.puts HOE.spec.to_ruby }
+end
+
+desc "Generate or update the standalone gemspec file for the project"
+task :gemspec => ["#{HOE.spec.name}.gemspec"]
+
+# the following tasks ease the build of C file from Ragel one
+
+file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
+ begin
+ sh "ragel #{t.prerequisites.last} -C -G2 -o #{t.name}"
+ rescue
+ fail "Could not build wrapper using Ragel (it failed or not installed?)"
+ end
+end
+
+file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
+ begin
+ sh "ragel #{t.prerequisites.last} -J -G2 -o #{t.name}"
+ rescue
+ fail "Could not build wrapper using Ragel (it failed or not installed?)"
+ end
+end
+
+if IS_JRUBY
+ require 'rake/javaextensiontask'
+
+ # build http11 java extension
+ Rake::JavaExtensionTask.new('puma_http11', HOE.spec)
+
+ task :ragel => 'ext/puma_http11/org/jruby/puma/Http11Parser.java'
+else
+ # use rake-compiler for building the extension
+ require 'rake/extensiontask'
+
+ # build http11 C extension
+ Rake::ExtensionTask.new('puma_http11', HOE.spec) do |ext|
+ # define target for extension (supporting fat binaries)
+ if RUBY_PLATFORM =~ /mingw|mswin/ then
+ RUBY_VERSION =~ /(\d+\.\d+)/
+ ext.lib_dir = "lib/#{$1}"
+ elsif ENV['CROSS']
+ # define cross-compilation tasks when not on Windows.
+ ext.cross_compile = true
+ ext.cross_platform = ['i386-mswin32', 'i386-mingw32']
+ end
+
+ # cleanup versioned library directory
+ CLEAN.include 'lib/{1.8,1.9}'
+ end
+
+ task :ragel => 'ext/puma_http11/http11_parser.c'
+end
+
+task :ext_clean do
+ sh "rm -rf lib/puma_http11.bundle"
+ sh "rm -rf lib/puma_http11.jar"
+ sh "rm -rf lib/puma_http11.so"
+end
+
+task :clean => :ext_clean
View
@@ -1,28 +0,0 @@
-require 'hoe'
-
-HOE = Hoe.spec 'puma' do
- self.rubyforge_name = 'puma'
- self.readme_file = "README.md"
- developer 'Evan Phoenix', 'evan@phx.io'
-
- spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
- spec_extras[:executables] = ['puma']
-
- dependency 'rack', '~> 1.2'
-
- extra_dev_deps << ['rake-compiler', "~> 0.7.0"]
-
- clean_globs.push('test_*.log', 'log')
-end
-
-# hoe/test and rake-compiler don't seem to play well together, so disable
-# hoe/test's .gemtest touch file thingy for now
-HOE.spec.files -= [".gemtest"]
-
-file "#{HOE.spec.name}.gemspec" => ['Rakefile', 'tasks/gem.rake'] do |t|
- puts "Generating #{t.name}"
- File.open(t.name, 'w') { |f| f.puts HOE.spec.to_ruby }
-end
-
-desc "Generate or update the standalone gemspec file for the project"
-task :gemspec => ["#{HOE.spec.name}.gemspec"]
View
@@ -1,8 +0,0 @@
-if IS_JRUBY
-
- require 'rake/javaextensiontask'
-
- # build http11 java extension
- Rake::JavaExtensionTask.new('puma_http11', HOE.spec)
-
-end
View
@@ -1,32 +0,0 @@
-unless IS_JRUBY
-
- # use rake-compiler for building the extension
- require 'rake/extensiontask'
-
- # build http11 C extension
- Rake::ExtensionTask.new('puma_http11', HOE.spec) do |ext|
- # define target for extension (supporting fat binaries)
- if RUBY_PLATFORM =~ /mingw|mswin/ then
- RUBY_VERSION =~ /(\d+\.\d+)/
- ext.lib_dir = "lib/#{$1}"
- elsif ENV['CROSS']
- # define cross-compilation tasks when not on Windows.
- ext.cross_compile = true
- ext.cross_platform = ['i386-mswin32', 'i386-mingw32']
- end
-
- # cleanup versioned library directory
- CLEAN.include 'lib/{1.8,1.9}'
- end
-end
-
-task :ext_clean do
- sh "rm -rf lib/puma_http11.bundle"
- sh "rm -rf lib/puma_http11.jar"
- sh "rm -rf lib/puma_http11.so"
-end
-
-# ensure things are built prior testing
-task :test => [:compile]
-
-task :clean => :ext_clean
View
@@ -1,24 +0,0 @@
-
-# the following tasks ease the build of C file from Ragel one
-
-file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
- begin
- sh "ragel #{t.prerequisites.last} -C -G2 -o #{t.name}"
- rescue
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
- end
-end
-
-file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
- begin
- sh "ragel #{t.prerequisites.last} -J -G2 -o #{t.name}"
- rescue
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
- end
-end
-
-if IS_JRUBY
- task :ragel => 'ext/puma_http11/org/jruby/puma/Http11Parser.java'
-else
- task :ragel => 'ext/puma_http11/http11_parser.c'
-end

0 comments on commit 6a107fd

Please sign in to comment.