On Fri, Nov 1, 2013 at 12:50 PM, Eric Wong <[email protected]> wrote:
> "Ernest W. Durbin III" <[email protected]> wrote:
>> This renables the ability for Ruby 1.8 environments to perform reexecs
>
> Is this for Ruby 1.8.6?  I've only tested on 1.8.7,
> I haven't had a 1.8.6 installation in a while.
>

I'll admit that the reason I need it is for a Ruby 1.8.6 environment...

However, Ruby 1.8.7 does not have support for that Hash constructor
either it simply fails silently and in a bug prone manner.

```
[ernestd@ewd3do ~]$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [i386-linux]
[ernestd@ewd3do ~]$ irb
irb(main):001:0> thing = Hash[ [ 'foo', 'bar' ], ['fizz', 'buzz'] ]
=> {["foo", "bar"]=>["fizz", "buzz"]}
irb(main):002:0> thing = Hash[ [ 'foo', 'bar' ] ]
=> {}
```

```
-bash-4.1$ ruby --version
ruby 1.8.6 (2010-09-02 patchlevel 420) [x86_64-linux]
-bash-4.1$ irb
irb(main):001:0> thing = Hash[ [ 'foo', 'bar' ], ['fizz', 'buzz'] ]
=> {["foo", "bar"]=>["fizz", "buzz"]}
irb(main):002:0> thing = Hash[ [ 'foo', 'bar' ] ]
ArgumentError: odd number of arguments for Hash
from (irb):2:in `[]'
from (irb):2
from :0
```


>> --- a/lib/unicorn/http_server.rb
>> +++ b/lib/unicorn/http_server.rb
>> @@ -449,13 +449,14 @@ class Unicorn::HttpServer
>>      end
>>
>>      self.reexec_pid = fork do
>> -      listener_fds = Hash[LISTENERS.map do |sock|
>> +      listener_fds = Hash.new
>
>          listener_fds = {}
>
> is generally preferred unless there's a default value.
>
> I'll apply the edited change if that's alright with you (and update
> the commit message for 1.8.6 support).

It's up to you how to get this merged :) Whatever is easiest.

>
> Thanks!
> _______________________________________________
> Unicorn mailing list - [email protected]
> http://rubyforge.org/mailman/listinfo/mongrel-unicorn
> Do not quote signatures (like this one) or top post when replying
_______________________________________________
Unicorn mailing list - [email protected]
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying

Reply via email to