Skip to content
Browse files

remove eventmachine dependency fixes #30 #43

  • Loading branch information...
1 parent 33c19ce commit a25d1a813bb31169f682bf54064ccd274b9805db @zzak zzak committed Aug 16, 2013
Showing with 1 addition and 49 deletions.
  1. +1 −2 Gemfile.lock
  2. +0 −24 lib/sinatra/streaming.rb
  3. +0 −2 sinatra-contrib.gemspec
  4. +0 −21 spec/streaming_spec.rb
View
3 Gemfile.lock
@@ -12,6 +12,7 @@ PATH
specs:
sinatra-contrib (1.4.0)
backports (>= 2.0)
+ multi_json
rack-protection
rack-test
sinatra (~> 1.4.0)
@@ -23,7 +24,6 @@ GEM
backports (3.3.3)
diff-lcs (1.2.2)
erubis (2.7.0)
- eventmachine (1.0.3)
haml (4.0.1)
tilt
json (1.7.7)
@@ -54,7 +54,6 @@ PLATFORMS
DEPENDENCIES
erubis
- eventmachine
haml
json
multi_json
View
24 lib/sinatra/streaming.rb
@@ -1,5 +1,4 @@
require 'sinatra/base'
-require 'eventmachine'
require 'backports'
module Sinatra
@@ -25,23 +24,6 @@ module Sinatra
# end
# end
#
- # == Proper Deferrable
- #
- # Handy when using EventMachine.
- #
- # list = []
- #
- # get '/' do
- # stream(:keep_open) do |out|
- # list << out
- # out.callback { list.delete out }
- # out.errback do
- # logger.warn "lost connection"
- # list.delete out
- # end
- # end
- # end
- #
# == Better Middleware Handling
#
# Blocks passed to #map! or #map will actually be applied when streaming
@@ -103,7 +85,6 @@ def stream(*)
end
module Stream
- include EventMachine::Deferrable
attr_accessor :app, :lineno, :pos, :transformer, :closed
alias tell pos
@@ -169,11 +150,6 @@ def puts(*args)
nil
end
- def close
- @scheduler.schedule { succeed }
- nil
- end
-
def close_read
raise IOError, "closing non-duplex IO for reading"
end
View
2 sinatra-contrib.gemspec
@@ -121,10 +121,8 @@ Gem::Specification.new do |s|
s.add_dependency "tilt", "~> 1.3"
s.add_dependency "rack-test"
s.add_dependency "rack-protection"
- s.add_dependency "eventmachine"
s.add_dependency "multi_json"
- s.add_development_dependency "eventmachine"
s.add_development_dependency "rspec", "~> 2.3"
s.add_development_dependency "haml"
s.add_development_dependency "erubis"
View
21 spec/streaming_spec.rb
@@ -62,27 +62,6 @@ def use(*args)
end
end
- context EventMachine::Deferrable do
- it 'allows attaching more than one callback' do
- a = b = false
- stream do |out|
- out.callback { a = true }
- out.callback { b = true }
- end
- a.should be_true
- b.should be_true
- end
-
- it 'triggers callbacks after streaming' do
- triggered = false
- stream do |out|
- out.callback { triggered = true }
- triggered.should be_false
- end
- triggered.should be_true
- end
- end
-
context 'app' do
it 'is the app instance the stream was created from' do
out = stream { }

0 comments on commit a25d1a8

Please sign in to comment.
Something went wrong with that request. Please try again.