unicorn 4.6.0 → 4.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -22,3 +22,4 @@ pkg/
22
22
  /man
23
23
  /tmp
24
24
  /LATEST
25
+ /lib/unicorn/version.rb
data/GIT-VERSION-GEN CHANGED
@@ -1,40 +1,39 @@
1
- #!/bin/sh
2
-
3
- GVF=GIT-VERSION-FILE
4
- DEF_VER=v4.6.0
5
-
6
- LF='
7
- '
1
+ #!/usr/bin/env ruby
2
+ DEF_VER = "v4.6.1"
3
+ CONSTANT = "Unicorn::Const::UNICORN_VERSION"
4
+ RVF = "lib/unicorn/version.rb"
5
+ GVF = "GIT-VERSION-FILE"
6
+ vn = DEF_VER
8
7
 
9
8
  # First see if there is a version file (included in release tarballs),
10
9
  # then try git-describe, then default.
11
- if test -f version
12
- then
13
- VN=$(cat version) || VN="$DEF_VER"
14
- elif test -d .git -o -f .git &&
15
- VN=$(git describe --abbrev=4 HEAD 2>/dev/null) &&
16
- case "$VN" in
17
- *$LF*) (exit 1) ;;
18
- v[0-9]*)
19
- git update-index -q --refresh
20
- test -z "$(git diff-index --name-only HEAD --)" ||
21
- VN="$VN-dirty" ;;
22
- esac
23
- then
24
- VN=$(echo "$VN" | sed -e 's/-/./g');
25
- else
26
- VN="$DEF_VER"
27
- fi
10
+ if File.exist?(".git")
11
+ describe = `git describe --abbrev=4 HEAD 2>/dev/null`.strip
12
+ case describe
13
+ when /\Av[0-9]*/
14
+ vn = describe
15
+ system(*%w(git update-index -q --refresh))
16
+ unless `git diff-index --name-only HEAD --`.chomp.empty?
17
+ vn << "-dirty"
18
+ end
19
+ vn.tr!('-', '.')
20
+ end
21
+ end
22
+
23
+ vn = vn.sub!(/\Av/, "")
24
+
25
+ # generate the Ruby constant
26
+ new_ruby_version = "#{CONSTANT} = '#{vn}'\n"
27
+ cur_ruby_version = File.read(RVF) rescue nil
28
+ if new_ruby_version != cur_ruby_version
29
+ File.open(RVF, "w") { |fp| fp.write(new_ruby_version) }
30
+ end
28
31
 
29
- VN=$(expr "$VN" : v*'\(.*\)')
32
+ # generate the makefile snippet
33
+ new_make_version = "GIT_VERSION = #{vn}\n"
34
+ cur_make_version = File.read(GVF) rescue nil
35
+ if new_make_version != cur_make_version
36
+ File.open(GVF, "w") { |fp| fp.write(new_make_version) }
37
+ end
30
38
 
31
- if test -r $GVF
32
- then
33
- VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
34
- else
35
- VC=unset
36
- fi
37
- test "$VN" = "$VC" || {
38
- echo >&2 "GIT_VERSION = $VN"
39
- echo "GIT_VERSION = $VN" >$GVF
40
- }
39
+ puts vn if $0 == __FILE__
data/GNUmakefile CHANGED
@@ -155,7 +155,7 @@ clean:
155
155
  man html:
156
156
  $(MAKE) -C Documentation install-$@
157
157
 
158
- pkg_extra := GIT-VERSION-FILE ChangeLog LATEST NEWS \
158
+ pkg_extra := GIT-VERSION-FILE lib/unicorn/version.rb ChangeLog LATEST NEWS \
159
159
  $(ext)/unicorn_http.c $(man1_paths)
160
160
 
161
161
  ChangeLog: GIT-VERSION-FILE .wrongdoc.yml
data/lib/unicorn/const.rb CHANGED
@@ -7,9 +7,6 @@
7
7
  # improvement over using the strings directly. Symbols did not really
8
8
  # improve things much compared to constants.
9
9
  module Unicorn::Const
10
-
11
- UNICORN_VERSION = "4.5.0"
12
-
13
10
  # default TCP listen host address (0.0.0.0, all interfaces)
14
11
  DEFAULT_HOST = "0.0.0.0"
15
12
 
@@ -44,3 +41,4 @@ module Unicorn::Const
44
41
 
45
42
  # :startdoc:
46
43
  end
44
+ require 'unicorn/version'
@@ -98,9 +98,6 @@ class Unicorn::HttpParser
98
98
  # Rack 1.5.0 (protocol version 1.2) adds hijack request support
99
99
  if ((Rack::VERSION[0] << 8) | Rack::VERSION[1]) >= 0x0102
100
100
  DEFAULTS["rack.hijack?"] = true
101
-
102
- # FIXME: asking for clarification about this in
103
- # http://mid.gmane.org/20130122100802.GA28585@dcvr.yhbt.net
104
101
  DEFAULTS["rack.version"] = [1, 2]
105
102
 
106
103
  RACK_HIJACK = "rack.hijack".freeze
@@ -111,7 +108,7 @@ class Unicorn::HttpParser
111
108
  end
112
109
 
113
110
  def hijack_setup(e, socket)
114
- e[RACK_HIJACK] = proc { e[RACK_HIJACK_IO] ||= socket }
111
+ e[RACK_HIJACK] = proc { e[RACK_HIJACK_IO] = socket }
115
112
  end
116
113
  else
117
114
  # old Rack, do nothing.
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: !binary |-
3
3
  dW5pY29ybg==
4
4
  version: !ruby/object:Gem::Version
5
- version: 4.6.0
5
+ version: 4.6.1
6
6
  prerelease:
7
7
  platform: ruby
8
8
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-02-06 00:00:00.000000000 Z
13
+ date: 2013-02-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: !binary |-
@@ -238,6 +238,7 @@ files:
238
238
  - lib/unicorn/tee_input.rb
239
239
  - lib/unicorn/tmpio.rb
240
240
  - lib/unicorn/util.rb
241
+ - lib/unicorn/version.rb
241
242
  - lib/unicorn/worker.rb
242
243
  - local.mk.sample
243
244
  - man/man1/unicorn.1