Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Separate Sinatra::Streaming (or lazy depend on eventmachine) #30

Closed
luislavena opened this Issue · 11 comments

4 participants

@luislavena

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?

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

@rkh
Owner
rkh commented

I will remove the eventmachine dependency from sinatra/streaming as soon as I find time.

@luislavena

@rkh wow that was fast!, thank you! ::love::

@luislavena luislavena referenced this issue from a commit in oneclick/rubyinstaller-org
@luislavena luislavena Workaround some GEM_HOME/GEM_PATH limitations e41bb6f
@rkh rkh was assigned
@yb66

@rtyler is there a reason you can't make that change a pull request? At least then it could be discussed further (in the context of this repo)

@rkh
Owner
rkh commented

EventMachine is only used to turn it into a Deferrable, IIRC, so implementing Deferrable-like behaviour should maket then EM dependency completely obsolete.

@yb66

@rkh I wouldn't know where to start with that… :) but @rtyler's quick and dirty solution is good in the short term, IMO. There's plenty of libraries that don't mark their dependencies properly and require a separate install, I don't think it would be wrong to do this intentionally as long as there's a note in the docs and changes.

@zzak
Owner

@luislavena Is windows still having a hard time with event machine?

@zzak
Owner

Should we close this or continue to investigate removing event machine as a dependency?

@yb66

I have a few questions: is streaming that common a need that it should be in the contrib gem? If it's there to cut down on admin it's obviously failing right now in that regard, and it's not listed in the README so I'm not sure anyone would miss it if it was cut. More people might find it if it was in its own gem.

@zzak
Owner

@yb66 there is also #60

@yb66

@zzak thanks.

@zzak zzak closed this in a25d1a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.