puma 0.8.2-java → 0.9.0-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puma might be problematic. Click here for more details.

@@ -1,44 +0,0 @@
1
- module Puma
2
- module Utils
3
- # Performs URI escaping so that you can construct proper
4
- # query strings faster. Use this rather than the cgi.rb
5
- # version since it's faster. (Stolen from Camping).
6
- def self.escape(s)
7
- s.to_s.gsub(/([^ a-zA-Z0-9_.-]+)/n) {
8
- '%'+$1.unpack('H2'*$1.size).join('%').upcase
9
- }.tr(' ', '+')
10
- end
11
-
12
-
13
- # Unescapes a URI escaped string. (Stolen from Camping).
14
- def self.unescape(s)
15
- s.tr('+', ' ').gsub(/((?:%[0-9a-fA-F]{2})+)/n){
16
- [$1.delete('%')].pack('H*')
17
- }
18
- end
19
-
20
- # Parses a query string by breaking it up at the '&'
21
- # and ';' characters. You can also use this to parse
22
- # cookies by changing the characters used in the second
23
- # parameter (which defaults to '&;'.
24
- def self.query_parse(qs, d = '&;')
25
- params = {}
26
-
27
- qs.split(/[#{d}] */n).each do |p|
28
- k, v = unescape(p).split('=', 2)
29
-
30
- if cur = params[k]
31
- if cur.kind_of? Array
32
- params[k] << v
33
- else
34
- params[k] = [cur, v]
35
- end
36
- else
37
- params[k] = v
38
- end
39
- end
40
-
41
- return params
42
- end
43
- end
44
- end
@@ -1,24 +0,0 @@
1
- require 'hoe'
2
-
3
- HOE = Hoe.spec 'puma' do
4
- self.rubyforge_name = 'puma'
5
- self.readme_file = "README.md"
6
- developer 'Evan Phoenix', 'evan@phx.io'
7
-
8
- spec_extras[:extensions] = ["ext/puma_http11/extconf.rb"]
9
- spec_extras[:executables] = ['puma']
10
-
11
- dependency 'rack', '~> 1.2'
12
-
13
- extra_dev_deps << ['rake-compiler', "~> 0.7.0"]
14
-
15
- clean_globs.push('test_*.log', 'log')
16
- end
17
-
18
- file "#{HOE.spec.name}.gemspec" => ['Rakefile', 'tasks/gem.rake'] do |t|
19
- puts "Generating #{t.name}"
20
- File.open(t.name, 'w') { |f| f.puts HOE.spec.to_ruby }
21
- end
22
-
23
- desc "Generate or update the standalone gemspec file for the project"
24
- task :gemspec => ["#{HOE.spec.name}.gemspec"]
@@ -1,12 +0,0 @@
1
- if IS_JRUBY
2
-
3
- require 'rake/javaextensiontask'
4
-
5
- # build http11 java extension
6
- Rake::JavaExtensionTask.new('puma_http11', HOE.spec) do |ext|
7
- ext.java_compiling do |gs|
8
- gs.dependencies.delete gs.dependencies.find { |d| d.name == 'daemons' }
9
- end
10
- end
11
-
12
- end
@@ -1,36 +0,0 @@
1
- unless IS_JRUBY
2
-
3
- # use rake-compiler for building the extension
4
- require 'rake/extensiontask'
5
-
6
- # build http11 C extension
7
- Rake::ExtensionTask.new('puma_http11', HOE.spec) do |ext|
8
- # define target for extension (supporting fat binaries)
9
- if RUBY_PLATFORM =~ /mingw|mswin/ then
10
- RUBY_VERSION =~ /(\d+\.\d+)/
11
- ext.lib_dir = "lib/#{$1}"
12
- elsif ENV['CROSS']
13
- # define cross-compilation tasks when not on Windows.
14
- ext.cross_compile = true
15
- ext.cross_platform = ['i386-mswin32', 'i386-mingw32']
16
-
17
- ext.cross_compiling do |gs|
18
- gs.dependencies.delete gs.dependencies.find { |d| d.name == 'daemons' }
19
- end
20
- end
21
-
22
- # cleanup versioned library directory
23
- CLEAN.include 'lib/{1.8,1.9}'
24
- end
25
- end
26
-
27
- task :ext_clean do
28
- sh "rm -rf lib/puma_http11.bundle"
29
- sh "rm -rf lib/puma_http11.jar"
30
- sh "rm -rf lib/puma_http11.so"
31
- end
32
-
33
- # ensure things are built prior testing
34
- task :test => [:compile]
35
-
36
- task :clean => :ext_clean
@@ -1,24 +0,0 @@
1
-
2
- # the following tasks ease the build of C file from Ragel one
3
-
4
- file 'ext/puma_http11/http11_parser.c' => ['ext/puma_http11/http11_parser.rl'] do |t|
5
- begin
6
- sh "ragel #{t.prerequisites.last} -C -G2 -o #{t.name}"
7
- rescue
8
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
9
- end
10
- end
11
-
12
- file 'ext/puma_http11/org/jruby/puma/Http11Parser.java' => ['ext/puma_http11/http11_parser.java.rl'] do |t|
13
- begin
14
- sh "ragel #{t.prerequisites.last} -J -G2 -o #{t.name}"
15
- rescue
16
- fail "Could not build wrapper using Ragel (it failed or not installed?)"
17
- end
18
- end
19
-
20
- if IS_JRUBY
21
- task :ragel => 'ext/puma_http11/org/jruby/puma/Http11Parser.java'
22
- else
23
- task :ragel => 'ext/puma_http11/http11_parser.c'
24
- end