Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows you to use jruby-rack in embedded environments #53

Closed
wants to merge 13 commits into from

Conversation

nicobrevin
Copy link
Contributor

I'm sure you know all about this one! Anyway, I think it is ready now.

…ironment to make jruby-rack more amenable to running in embedded servlet situations
 - Create an abstract rack filter which is responsible for calling the dispatcher and converting the req & resp into a rack env.
 - Implementations of rack filter for embedded and servlet environments
 - Include a getServerInfo method on the rack context for CGI's SERVER_INFORMATION.
 - Remove unnecessary jetty example (in a different gem - WIP)
… sure we don't refer to the default servlet rack context everywhere (use the interface)
…us make sure it sets the servlet_rack_context
…comment to describe why it is there in the first place
@nicksieger
Copy link
Member

Nico, this looks great. Can you go ahead and merge this yourself? I added you as a committer.

Also, beware that @baq has a pull request pending (#32) as well that might conflict with yours. Last write loses! :)

@nicobrevin
Copy link
Contributor Author

Cool, I'll have a go on the weekend, girlfriend permitting.

On Wed, Sep 7, 2011 at 10:30 PM, Nick Sieger
reply@reply.github.com
wrote:

Nico, this looks great. Can you go ahead and merge this yourself? I added you as a committer.

Also, beware that @baq has a pull request pending (#32) as well that might conflict with yours. Last write loses! :)

Reply to this email directly or view it on GitHub:
#53 (comment)

@calavera
Copy link
Contributor

calavera commented Sep 9, 2011

@nicobrevin can you explain further about this patch? is it just a massive refactor? which problem are you fixing with it?

@nicobrevin
Copy link
Contributor Author

Yeah, sure.

It's not a huge refactor, just pulling out the servlet env dependency
from some base classes, and making sub-classes that then pick up this
dependency and provide the more web-container like functionality.

jruby-rack is geared towards apps that are deployed within a servlet
container, but my use case is to embed the web server and not have to
worry about war files, or even a rackup script. I found this was
possible with 0.9.7, but when trying to update to the latest
jruby-rack a few months ago, I found new features had made it
increasingly difficult to make it work like this.

The set of classes i've added allow you to use jruby-rack as more of a
simple adapter between the rack interface and the servlet interface.
There are lots of projects that do this on a per-container basis, but
there was a lot of duplication of effort across these projects, plus
jruby-rack seems to have by far the most active community. So, I
wanted a way of being able to reuse jruby-rack's adapter classes
without having to deploy my app as a war/rackapp.

I created a basic example,
https://github.com/nicobrevin/jruby-rack-jetty, that shows how you can
use jruby-rack to create a jetty rack adapter for your particular
server.

Essay over! Does that make sense?

On Fri, Sep 9, 2011 at 8:16 AM, David Calavera
reply@reply.github.com
wrote:

@nicobrevin can you explain further about this patch? is it just a massive refactor? which problem are you fixing with it?

Reply to this email directly or view it on GitHub:
#53 (comment)

@calavera
Copy link
Contributor

calavera commented Sep 9, 2011

Yes, that makes more sense.

Thank you!

@calavera
Copy link
Contributor

@nicobrevin could you add a Servlet to the embed package as you did with the filter. I think it would be more coherent if we had both.

@calavera
Copy link
Contributor

Merged it!! I've also added a servlet under the embed packaged.

Thank you!!

@nicobrevin
Copy link
Contributor Author

Oh ok, thanks!
On 14 Sep 2011 09:51, "David Calavera" <
reply@reply.github.com>
wrote:

Merged it!! I've also added a servlet under the embed packaged.

Thank you!!

Reply to this email directly or view it on GitHub:
#53 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants