sinatra/sinatra-contrib — Issue #30: Separate Sinatra::Streaming (or lazy depend on eventmachine)
Author: luislavena
Created: 2012-01-07 19:26:01+00:00
State: open

Hello,

This request might sound weird, but sinatra-contrib gem dependency on eventmachine causes issues with Ruby 1.9.x (1.9.2 and 1.9.3) under Windows.

Users trying to use `Sinatra::Reloader` during development add `sinatra-contrib` gem, which depends on `eventmachine >= 0`

This results in attempt to install latest stable gem (0.12.10) which has known issues under Windows (ala: does not compile).

After lurking on the internet for answers, end installing `eventmachine 1.0.0.beta.4.1` (using `--pre` during gem install) but for some, under some weird circumstances with Bundler, dependencies are not met and it attempts to install eventmachine 0.12.10, again resulting in failure.

I believe is caused by installation on different `GEM_PATH` than `GEM_HOME`, but need more investigation.

May I suggest change `sinatra/streaming.rb` requires and remove runtime dependency on eventmachine?

```ruby
require 'sinatra/base'
begin
require 'eventmachine'
rescue LoadError
abort 'EventMachine is required to use Sinatra::Streaming. Please `gem install eventmachine` first.'
end
require 'backports'
```

Thank you