#75 ✓resolved
Dan Kubb (dkubb)

Mixing --require, --backend and --servers causes NameError

Reported by Dan Kubb (dkubb) | July 18th, 2008 @ 11:19 PM | in 1.0

I noticed a bug when using the thin command with the thin-turbo backend with the --server argument.

It seems that when you run a single process, there are no problems. Passing in --require thin-turbo and --backend Thin::Backends::Turbo works fine.

However, when you add a --server command, the --require option is not passed in the shell command, so the subprocess returns a NameError exception because it didn't require thin-turbo, and doesn't know anything about the Thin::Backends::Turbo class.

It appears as if when the --require option is parsed, the system will automatically require the file, but does not store the value in the @options ivar along with all the other passed in values. A quick hack by adding @options[:require] = file after the file was required solved the issue, however this isn't a complete solution. For example, what if multiple :require options were passed in? Say you make the value and Array so it can store one or more :require options, when the shell command is created it doesn't know how to serialize it.

The solution is pretty simple, but being that I'm not too familiar with this project history, I'd like to get some feedback from the core devs before submitting a patch to handle multi-valued options.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Tags

Pages