Skip to content

Commit ff16528

Browse files
committed
Prefer for next release.
1 parent 745093d commit ff16528

File tree

5 files changed

+16
-53
lines changed

5 files changed

+16
-53
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
== 2.0.0
2+
* Partial Rack 3 support. Full bi-directional streaming is not supported due to limitations in the implementation.
3+
14
== 1.8.2 Ruby Razor
25
* Ruby 3.2 support.
36

lib/rack/adapter/rails.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,7 @@ def header(options = 'text/html')
126126

127127
@output_cookies.each { |c| cookies << c.to_s } if @output_cookies
128128

129-
@response['Set-Cookie'] = [@response['Set-Cookie'], cookies].compact
130-
# See http://groups.google.com/group/rack-devel/browse_thread/thread/e8759b91a82c5a10/a8dbd4574fe97d69?#a8dbd4574fe97d69
131-
if Thin.ruby_18?
132-
@response['Set-Cookie'].flatten!
133-
else
134-
@response['Set-Cookie'] = @response['Set-Cookie'].join("\n")
135-
end
129+
@response['Set-Cookie'] = [@response['Set-Cookie'], cookies].compact.join("\n")
136130
end
137131

138132
options.each { |k, v| @response[k] = v }

lib/thin/response.rb

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,36 +92,15 @@ def head
9292
"HTTP/1.1 #{@status} #{HTTP_STATUS_CODES[@status.to_i]}\r\n#{headers_output}\r\n"
9393
end
9494

95-
if Thin.ruby_18?
96-
97-
# Ruby 1.8 implementation.
98-
# Respects Rack specs.
99-
#
100-
# See http://rack.rubyforge.org/doc/files/SPEC.html
101-
def headers=(key_value_pairs)
102-
key_value_pairs.each do |k, vs|
103-
vs.each { |v| @headers[k] = v.chomp } if vs
104-
end if key_value_pairs
105-
end
106-
107-
else
108-
109-
# Ruby 1.9 doesn't have a String#each anymore.
110-
# Rack spec doesn't take care of that yet, for now we just use
111-
# +each+ but fallback to +each_line+ on strings.
112-
# I wish we could remove that condition.
113-
# To be reviewed when a new Rack spec comes out.
114-
def headers=(key_value_pairs)
115-
key_value_pairs.each do |k, vs|
116-
next unless vs
117-
if vs.is_a?(String)
118-
vs.each_line { |v| @headers[k] = v.chomp }
119-
else
120-
vs.each { |v| @headers[k] = v.chomp }
121-
end
122-
end if key_value_pairs
123-
end
124-
95+
def headers=(key_value_pairs)
96+
key_value_pairs.each do |k, vs|
97+
next unless vs
98+
if vs.is_a?(String)
99+
vs.each_line { |v| @headers[k] = v.chomp }
100+
else
101+
vs.each { |v| @headers[k] = v.chomp }
102+
end
103+
end if key_value_pairs
125104
end
126105

127106
# Close any resource used by the response

lib/thin/version.rb

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,8 @@ module Thin
33
# current platform.
44
class PlatformNotSupported < RuntimeError; end
55

6-
module VERSION #:nodoc:
7-
MAJOR = 1
8-
MINOR = 8
9-
TINY = 2
10-
11-
STRING = [MAJOR, MINOR, TINY].join('.')
12-
13-
CODENAME = "Ruby Razor".freeze
14-
15-
RACK = [1, 0].freeze # Rack protocol version
16-
end
6+
VERSION = "2.0.0"
7+
CODENAME = "Thinception".freeze
178

189
NAME = 'thin'.freeze
1910
SERVER = "#{NAME} #{VERSION::STRING} codename #{VERSION::CODENAME}".freeze
@@ -25,8 +16,4 @@ def self.win?
2516
def self.linux?
2617
RUBY_PLATFORM =~ /linux/
2718
end
28-
29-
def self.ruby_18?
30-
RUBY_VERSION =~ /^1\.8/
31-
end
3219
end

thin.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require "thin/version"
66
# Describe your gem and declare its dependencies:
77
Thin::GemSpec ||= Gem::Specification.new do |s|
88
s.name = Thin::NAME
9-
s.version = Thin::VERSION::STRING
9+
s.version = Thin::VERSION
1010
s.platform = Thin.win? ? Gem::Platform::CURRENT : Gem::Platform::RUBY
1111
s.summary = "A thin and fast web server"
1212
s.author = "Marc-Andre Cournoyer"

0 commit comments

Comments
 (0)