Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
DEF_VER = "v6.1.0"
DEF_VER = "v6.2.0"
CONSTANT = "Unicorn::Const::UNICORN_VERSION"
RVF = "lib/unicorn/version.rb"
GVF = "GIT-VERSION-FILE"
Expand Down
8 changes: 7 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,13 @@ You may browse the code from the web:
* https://repo.or.cz/w/unicorn.git (gitweb)

See the HACKING guide on how to contribute and build prerelease gems
from git.
from git. When installing directly from git you must have
{Ragel}[https://www.colm.net/open-source/ragel/] available (or run
`gmake ragel` beforehand) so the HTTP parser extension can be
generated. You can confirm your environment is ready by running
`ruby ext/unicorn_http/extconf.rb`, which will regenerate
`ext/unicorn_http/unicorn_http.c` and report an error if Ragel is
missing.

== Usage

Expand Down
29 changes: 29 additions & 0 deletions ext/unicorn_http/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,35 @@
# frozen_string_literal: false
require 'mkmf'

def generate_ragel_source
src = File.expand_path('unicorn_http.c', __dir__)
return if File.exist?(src)

ragel_cfg = with_config('ragel') { find_executable('ragel') }
ragel = if ragel_cfg.respond_to?(:strip)
ragel_cfg = ragel_cfg.strip
ragel_cfg unless ragel_cfg.empty? ||
(ragel_cfg.is_a?(String) && ragel_cfg !~ %r{\A/})
end
ragel ||= find_executable('ragel')
unless ragel
abort <<~MSG
ragel(1) is required to generate ext/unicorn_http/unicorn_http.c.

Install ragel (e.g. via your package manager) or run `gmake ragel`
from the repository root before installing unicorn from git.
MSG
end

Dir.chdir(__dir__) do
cmd = [ragel, 'unicorn_http.rl', '-C', '-G2', '-o', 'unicorn_http.c']
message("running #{cmd.join(' ')}\n")
system(*cmd) || abort("ragel failed to generate unicorn_http.c")
end
end

generate_ragel_source

have_func("rb_hash_clear", "ruby.h") or abort 'Ruby 2.0+ required'

message('checking if String#-@ (str_uminus) dedupes... ')
Expand Down
6 changes: 6 additions & 0 deletions lib/unicorn/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Unicorn
module Const
UNICORN_VERSION = "6.2.0"
end
VERSION = Const::UNICORN_VERSION
end
2 changes: 1 addition & 1 deletion unicorn.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end.compact

Gem::Specification.new do |s|
s.name = %q{unicorn}
s.version = (ENV['VERSION'] || '6.1.0').dup
s.version = (ENV['VERSION'] || '6.2.0').dup
s.authors = ['unicorn hackers']
s.summary = 'Rack HTTP server for fast clients and Unix'
s.description = File.read('README').split("\n\n")[1]
Expand Down