From a4a346877b799f039d62a3751cdd94730d695fdb Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 14:06:50 -0300 Subject: [PATCH 01/15] Initial cleanup of Rakefile --- Rakefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Rakefile b/Rakefile index 66e63886..2f7a33d2 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,33 @@ +require "hoe" +require "rake/extensiontask" + +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', 'pumactl'] + + dependency "rack", "~> 1.2" + + extra_dev_deps << ["rake-compiler", "~> 0.8.0"] +end + +# puma.gemspec +file "#{HOE.spec.name}.gemspec" => ['Rakefile'] do |t| + puts "Generating #{t.name}" + File.open(t.name, 'wb') { |f| f.write HOE.spec.to_ruby } +end + +desc "Generate or update the standalone gemspec file for the project" +task :gemspec => ["#{HOE.spec.name}.gemspec"] + +# tests require extension be compiled +task :test => [:compile] + +__END__ require 'rubygems' require 'hoe' From 3e98339c31f7ef60c15ecff123a15c56922b6f87 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 15:53:28 -0300 Subject: [PATCH 02/15] Make 'ragel' task actually work --- Rakefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Rakefile b/Rakefile index 2f7a33d2..7a1837e2 100644 --- a/Rakefile +++ b/Rakefile @@ -16,6 +16,7 @@ HOE = Hoe.spec "puma" do end # puma.gemspec + file "#{HOE.spec.name}.gemspec" => ['Rakefile'] do |t| puts "Generating #{t.name}" File.open(t.name, 'wb') { |f| f.write HOE.spec.to_ruby } @@ -24,6 +25,28 @@ end desc "Generate or update the standalone gemspec file for the project" task :gemspec => ["#{HOE.spec.name}.gemspec"] +# generate extension code using Ragel (C and Java) +desc "Generate extension code (C and Java) using Ragel" +task :ragel + +file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t| + begin + sh "ragel #{t.prerequisites.last} -C -G2 -I ext/puma_http11 -o #{t.name}" + rescue + fail "Could not build wrapper using Ragel (it failed or not installed?)" + end +end +task :ragel => ['ext/puma_http11/http11_parser.c'] + +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 -I ext/puma_http11 -o #{t.name}" + rescue + fail "Could not build wrapper using Ragel (it failed or not installed?)" + end +end +task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java'] + # tests require extension be compiled task :test => [:compile] From 9cb0d940874c170a3b601e1f3e14c3a7ae584ff8 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 15:59:23 -0300 Subject: [PATCH 03/15] Compile extensions Thanks to rake-compiler 0.8.0, there is no longer a need to be exclusive about adding either C or Java type of extensions to the Rakefile. --- Rakefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Rakefile b/Rakefile index 7a1837e2..81d5c057 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ require "hoe" require "rake/extensiontask" +require "rake/javaextensiontask" HOE = Hoe.spec "puma" do self.rubyforge_name = 'puma' @@ -47,6 +48,15 @@ file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/htt end task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java'] +# compile extensions using rake-compiler +# C (MRI, Rubinius) +Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext| +end + +# Java (JRuby) +Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext| +end + # tests require extension be compiled task :test => [:compile] From 474ba706475f8e613b8e9443bbc61a2f2caa6d56 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:32:32 -0300 Subject: [PATCH 04/15] Build extensions And place the resulting extension in 'puma' namespace --- Rakefile | 17 +++++++++++++++-- ext/puma_http11/extconf.rb | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 81d5c057..1501b1e6 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,8 @@ require "hoe" require "rake/extensiontask" require "rake/javaextensiontask" +IS_JRUBY = defined?(RUBY_ENGINE) ? RUBY_ENGINE == "jruby" : false + HOE = Hoe.spec "puma" do self.rubyforge_name = 'puma' self.readme_file = "README.md" @@ -16,6 +18,10 @@ HOE = Hoe.spec "puma" do extra_dev_deps << ["rake-compiler", "~> 0.8.0"] 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"] + # puma.gemspec file "#{HOE.spec.name}.gemspec" => ['Rakefile'] do |t| @@ -51,14 +57,21 @@ task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java'] # compile extensions using rake-compiler # C (MRI, Rubinius) Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext| + # place extension inside namespace + ext.lib_dir = "lib/puma" end # Java (JRuby) Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext| + ext.lib_dir = "lib/puma" end -# tests require extension be compiled -task :test => [:compile] +# tests require extension be compiled, but depend on the platform +if IS_JRUBY + task :test => [:java] +else + task :test => [:compile] +end __END__ require 'rubygems' diff --git a/ext/puma_http11/extconf.rb b/ext/puma_http11/extconf.rb index 5ede0561..8e84e042 100644 --- a/ext/puma_http11/extconf.rb +++ b/ext/puma_http11/extconf.rb @@ -2,4 +2,4 @@ require 'mkmf' dir_config("puma_http11") -create_makefile("puma_http11") +create_makefile("puma/puma_http11") From 36fd245bd22067e89aad450cec0928ce68ef3cbd Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:37:59 -0300 Subject: [PATCH 05/15] Require extension from namespace puma --- lib/puma/server.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/puma/server.rb b/lib/puma/server.rb index 03a6f618..cb720e94 100644 --- a/lib/puma/server.rb +++ b/lib/puma/server.rb @@ -1,4 +1,3 @@ -require 'rubygems' require 'rack' require 'stringio' @@ -7,7 +6,7 @@ require 'puma/const' require 'puma/events' require 'puma/null_io' -require 'puma_http11' +require 'puma/puma_http11' require 'socket' From 942c1ad7e10fc353f5832a0ecd9b3da1396a61ef Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:42:07 -0300 Subject: [PATCH 06/15] Enable cross-compilation of C extension --- Rakefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Rakefile b/Rakefile index 1501b1e6..9291fc32 100644 --- a/Rakefile +++ b/Rakefile @@ -59,6 +59,11 @@ task :ragel => ['ext/puma_http11/org/jruby/puma/Http11Parser.java'] Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext| # place extension inside namespace ext.lib_dir = "lib/puma" + + ext.cross_compile = true + ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32'] + + CLEAN.include "lib/puma/{1.8,1.9}" end # Java (JRuby) From d86b169d9d178d7021a3fd9785983eccb37b6b71 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:42:19 -0300 Subject: [PATCH 07/15] Remove old Rakefile --- Rakefile | 92 -------------------------------------------------------- 1 file changed, 92 deletions(-) diff --git a/Rakefile b/Rakefile index 9291fc32..f37ed507 100644 --- a/Rakefile +++ b/Rakefile @@ -77,95 +77,3 @@ if IS_JRUBY else task :test => [:compile] end - -__END__ -require 'rubygems' - -require 'hoe' - -IS_JRUBY = defined?(RUBY_ENGINE) ? RUBY_ENGINE == "jruby" : false - -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', 'pumactl'] - - 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'] 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 From 9470937da9be165f716cd5aeb5bcfa5a38ed9838 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:48:51 -0300 Subject: [PATCH 08/15] Remove non-required dirs from $LOAD_PATH --- lib/puma.rb | 1 - test/testhelp.rb | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/puma.rb b/lib/puma.rb index a49e7f49..49792e14 100644 --- a/lib/puma.rb +++ b/lib/puma.rb @@ -1,4 +1,3 @@ - # Standard libraries require 'socket' require 'tempfile' diff --git a/test/testhelp.rb b/test/testhelp.rb index 94a5a8cd..8d7dc200 100644 --- a/test/testhelp.rb +++ b/test/testhelp.rb @@ -2,8 +2,9 @@ # Copyright (c) 2005 Zed A. Shaw -%w(lib ext bin test).each do |dir| - $LOAD_PATH.unshift File.expand_path("../../#{dir}", __FILE__) +%w(lib test).each do |d| + dir = File.expand_path("../../#{d}", __FILE__) + $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir) end require 'rubygems' @@ -18,7 +19,7 @@ require 'puma' def redirect_test_io yield end - + # Either takes a string to do a get request against, or a tuple of [URI, HTTP] where # HTTP is some kind of Net::HTTP request object (POST, HEAD, etc.) def hit(uris) From af609a1f90009d7f7c286b934ac57c1d7d1734f1 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:55:57 -0300 Subject: [PATCH 09/15] Exclude UNIXSocket tests under Windows --- test/test_integration.rb | 4 ++-- test/test_unix_socket.rb | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/test_integration.rb b/test/test_integration.rb index ece2c21e..b56e1873 100644 --- a/test/test_integration.rb +++ b/test/test_integration.rb @@ -1,5 +1,5 @@ +require "rbconfig" require 'test/unit' -require 'rubygems' require 'socket' require 'puma/cli' @@ -19,7 +19,7 @@ class TestIntegration < Test::Unit::TestCase end def test_stop_via_pumactl - if defined? JRUBY_VERSION + if defined?(JRUBY_VERSION) || RbConfig::CONFIG["host_os"] =~ /mingw|mswin/ assert true return end diff --git a/test/test_unix_socket.rb b/test/test_unix_socket.rb index 1204c8df..f649104f 100644 --- a/test/test_unix_socket.rb +++ b/test/test_unix_socket.rb @@ -1,10 +1,12 @@ +require "rbconfig" require 'test/unit' require 'puma/server' require 'socket' # UNIX sockets are not recommended on JRuby -unless defined?(JRUBY_VERSION) +# (or Windows) +unless defined?(JRUBY_VERSION) || RbConfig::CONFIG["host_os"] =~ /mingw|mswin/ class TestPumaUnixSocket < Test::Unit::TestCase App = lambda { |env| [200, {}, ["Works"]] } @@ -34,4 +36,4 @@ unless defined?(JRUBY_VERSION) sock.close end end -end \ No newline at end of file +end From 3e2ca26b83603a88dfd2d30961d09e31e9d7fd47 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 16:57:55 -0300 Subject: [PATCH 10/15] Exclude more UNIXSocket tests under Windows --- test/test_cli.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_cli.rb b/test/test_cli.rb index bf965d4c..bf4640f2 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -1,3 +1,4 @@ +require "rbconfig" require 'test/unit' require 'puma/cli' require 'tempfile' @@ -27,7 +28,7 @@ class TestCLI < Test::Unit::TestCase assert_equal File.read(@tmp_path).strip.to_i, Process.pid end - unless defined? JRUBY_VERSION + unless defined?(JRUBY_VERSION) || RbConfig::CONFIG["host_os"] =~ /mingw|mswin/ def test_control url = "unix://#{@tmp_path}" @@ -95,7 +96,7 @@ class TestCLI < Test::Unit::TestCase assert m, "'#{url}' is not a URL" end - end + end # JRUBY or Windows def test_state url = "tcp://127.0.0.1:8232" From 935a5569eaf0a805bd68ba7886c0bcc44849d171 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 17:01:03 -0300 Subject: [PATCH 11/15] Psych::load_file leaves file handles open (leak) Fixed in Ruby trunk and 1_9_3 branch but not yet released. Avoid that by doing a old-school File.open { |f| f.read } --- lib/puma/control_cli.rb | 2 +- test/test_cli.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puma/control_cli.rb b/lib/puma/control_cli.rb index b8a0919f..52a2c9cf 100644 --- a/lib/puma/control_cli.rb +++ b/lib/puma/control_cli.rb @@ -46,7 +46,7 @@ module Puma @parser.parse! @argv - @state = YAML.load_file(@path) + @state = YAML.load File.open(@path, "r") { |f| f.read } @config = @state['config'] cmd = @argv.shift diff --git a/test/test_cli.rb b/test/test_cli.rb index bf4640f2..035c77f3 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -86,7 +86,7 @@ class TestCLI < Test::Unit::TestCase cli.parse_options cli.write_state - data = YAML.load_file(@tmp_path) + data = YAML.load File.open(@tmp_path, "r") { |f| f.read } assert_equal Process.pid, data["pid"] @@ -104,7 +104,7 @@ class TestCLI < Test::Unit::TestCase cli.parse_options cli.write_state - data = YAML.load_file(@tmp_path) + data = YAML.load File.open(@tmp_path, "r") { |f| f.read } assert_equal Process.pid, data["pid"] assert_equal url, data["config"].options[:control_url] From 38ab15dc9a4ea81b9d7b437f78a6699a279852c4 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 17:12:20 -0300 Subject: [PATCH 12/15] A rack app needs to set Content-Type If not Rack Lint complains :-( --- test/hello.ru | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/hello.ru b/test/hello.ru index 3162ff79..deb8fc82 100644 --- a/test/hello.ru +++ b/test/hello.ru @@ -1 +1 @@ -run lambda { |env| [200, {}, ["Hello World"]] } +run lambda { |env| [200, {"Content-Type" => "text/plain"}, ["Hello World"]] } From 21327cad9bee7b80db0d8e3d4a2e56699dc80fc7 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 17:23:37 -0300 Subject: [PATCH 13/15] Add fat-binary stub when cross compiling And generate it using RUBY_VERSION and proper require. --- Rakefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Rakefile b/Rakefile index f37ed507..0dc69207 100644 --- a/Rakefile +++ b/Rakefile @@ -62,8 +62,13 @@ Rake::ExtensionTask.new("puma_http11", HOE.spec) do |ext| ext.cross_compile = true ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32'] + ext.cross_compiling do |spec| + # add fat-binary stub only when cross compiling + spec.files << "lib/puma/puma_http11.rb" + end CLEAN.include "lib/puma/{1.8,1.9}" + CLEAN.include "lib/puma/puma_http11.rb" end # Java (JRuby) @@ -71,6 +76,16 @@ Rake::JavaExtensionTask.new("puma_http11", HOE.spec) do |ext| ext.lib_dir = "lib/puma" end +# the following is a fat-binary stub that will be used when +# require 'puma/puma_http11' and will use either 1.8 or 1.9 version depending +# on RUBY_VERSION +file "lib/puma/puma_http11.rb" do |t| + File.open(t.name, "w") do |f| + f.puts "RUBY_VERSION =~ /(\d+.\d+)/" + f.puts 'require "puma/#{$1}/puma_http11"' + end +end + # tests require extension be compiled, but depend on the platform if IS_JRUBY task :test => [:java] From 0fee5c806484e47137dfdf2cb73d579fe2f4c86d Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 17:46:10 -0300 Subject: [PATCH 14/15] Change YAML.load trick to use File.read instead And move required Ruby version to 1.8.7 or greater. (sorry folks on 1.8.6, time to upgrade anyway) --- Rakefile | 2 ++ lib/puma/control_cli.rb | 2 +- test/test_cli.rb | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 0dc69207..4a09c648 100644 --- a/Rakefile +++ b/Rakefile @@ -13,6 +13,8 @@ HOE = Hoe.spec "puma" do spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"] spec_extras[:executables] = ['puma', 'pumactl'] + require_ruby_version ">= 1.8.7" + dependency "rack", "~> 1.2" extra_dev_deps << ["rake-compiler", "~> 0.8.0"] diff --git a/lib/puma/control_cli.rb b/lib/puma/control_cli.rb index 52a2c9cf..4a2bdc22 100644 --- a/lib/puma/control_cli.rb +++ b/lib/puma/control_cli.rb @@ -46,7 +46,7 @@ module Puma @parser.parse! @argv - @state = YAML.load File.open(@path, "r") { |f| f.read } + @state = YAML.load File.read(@path) @config = @state['config'] cmd = @argv.shift diff --git a/test/test_cli.rb b/test/test_cli.rb index 035c77f3..6f927935 100644 --- a/test/test_cli.rb +++ b/test/test_cli.rb @@ -86,7 +86,7 @@ class TestCLI < Test::Unit::TestCase cli.parse_options cli.write_state - data = YAML.load File.open(@tmp_path, "r") { |f| f.read } + data = YAML.load File.read(@tmp_path) assert_equal Process.pid, data["pid"] @@ -104,7 +104,7 @@ class TestCLI < Test::Unit::TestCase cli.parse_options cli.write_state - data = YAML.load File.open(@tmp_path, "r") { |f| f.read } + data = YAML.load File.read(@tmp_path) assert_equal Process.pid, data["pid"] assert_equal url, data["config"].options[:control_url] From 717b1456d53a30d3e6a1ef83a64ae8f6c588ba38 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Sun, 8 Jan 2012 17:49:26 -0300 Subject: [PATCH 15/15] Updated gemspec to reflect changes --- puma.gemspec | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/puma.gemspec b/puma.gemspec index fcfbb020..f3043cbc 100644 --- a/puma.gemspec +++ b/puma.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |s| s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Evan Phoenix"] - s.date = "2011-12-19" - s.description = "Puma is a small library that provides a very fast and concurrent HTTP 1.1 server for Ruby web applications. It is designed for running rack apps only.\n\nWhat makes Puma so fast is the careful use of an Ragel extension to provide fast, accurate HTTP 1.1 protocol parsing. This makes the server scream without too many portability issues." + s.date = "2012-01-08" + s.description = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for [Rubinius](http://rubini.us), but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.\n\nUnder the hood, Puma processes requests using a C-optimized Ragel extension (inherited from Mongrel) that provides fast, accurate HTTP 1.1 protocol parsing in a portable way. Puma then serves the request in a thread from an internal thread pool (which you can control). This allows Puma to provide real concurrency for your web application!\n\nWith Rubinius 2.0, Puma will utilize all cores on your CPU with real threads, meaning you won't have to spawn multiple processes to increase throughput. You can expect to see a similar benefit from JRuby.\n\nOn MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries). Your mileage may vary.. in order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like [Rubinius](http://rubini.us) or [JRuby](http://jruby.org)." s.email = ["evan@phx.io"] s.executables = ["puma", "pumactl"] s.extensions = ["ext/puma_http11/extconf.rb"] @@ -15,9 +15,10 @@ Gem::Specification.new do |s| s.files = ["COPYING", "Gemfile", "History.txt", "LICENSE", "Manifest.txt", "README.md", "Rakefile", "TODO", "bin/puma", "bin/pumactl", "examples/config.rb", "ext/puma_http11/PumaHttp11Service.java", "ext/puma_http11/ext_help.h", "ext/puma_http11/extconf.rb", "ext/puma_http11/http11_parser.c", "ext/puma_http11/http11_parser.h", "ext/puma_http11/http11_parser.java.rl", "ext/puma_http11/http11_parser.rl", "ext/puma_http11/http11_parser_common.rl", "ext/puma_http11/org/jruby/puma/Http11.java", "ext/puma_http11/org/jruby/puma/Http11Parser.java", "ext/puma_http11/puma_http11.c", "lib/puma.rb", "lib/puma/app/status.rb", "lib/puma/cli.rb", "lib/puma/configuration.rb", "lib/puma/const.rb", "lib/puma/control_cli.rb", "lib/puma/events.rb", "lib/puma/jruby_restart.rb", "lib/puma/null_io.rb", "lib/puma/rack_patch.rb", "lib/puma/server.rb", "lib/puma/thread_pool.rb", "lib/rack/handler/puma.rb", "puma.gemspec", "test/ab_rs.rb", "test/config/app.rb", "test/hello.ru", "test/lobster.ru", "test/mime.yaml", "test/slow.ru", "test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb", "test/testhelp.rb", "tools/trickletest.rb"] s.rdoc_options = ["--main", "README.md"] s.require_paths = ["lib"] + s.required_ruby_version = Gem::Requirement.new(">= 1.8.7") s.rubyforge_project = "puma" - s.rubygems_version = "1.8.12" - s.summary = "Puma is a small library that provides a very fast and concurrent HTTP 1.1 server for Ruby web applications" + s.rubygems_version = "1.8.15" + s.summary = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications" s.test_files = ["test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb"] if s.respond_to? :specification_version then @@ -25,19 +26,19 @@ Gem::Specification.new do |s| if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q, ["~> 1.2"]) - s.add_development_dependency(%q, ["~> 0.7.0"]) - s.add_development_dependency(%q, ["~> 2.12"]) + s.add_development_dependency(%q, ["~> 0.8.0"]) s.add_development_dependency(%q, ["~> 3.10"]) + s.add_development_dependency(%q, ["~> 2.12"]) else s.add_dependency(%q, ["~> 1.2"]) - s.add_dependency(%q, ["~> 0.7.0"]) - s.add_dependency(%q, ["~> 2.12"]) + s.add_dependency(%q, ["~> 0.8.0"]) s.add_dependency(%q, ["~> 3.10"]) + s.add_dependency(%q, ["~> 2.12"]) end else s.add_dependency(%q, ["~> 1.2"]) - s.add_dependency(%q, ["~> 0.7.0"]) - s.add_dependency(%q, ["~> 2.12"]) + s.add_dependency(%q, ["~> 0.8.0"]) s.add_dependency(%q, ["~> 3.10"]) + s.add_dependency(%q, ["~> 2.12"]) end end