Sha256: a61787da6036858fff64434e1a4878ca71a5a5ed8fb89aa0af12f79018c68151

Contents?: true

Size: 564 Bytes

Versions: 165

Compression:

Stored size: 564 Bytes

Contents

# this example does *not* work properly with WEBrick
#
# run *one* of these:
#
#   rackup -s mongrel stream.ru   # gem install mongrel
#   thin -R stream.ru start       # gem install thin
#   unicorn stream.ru             # gem install unicorn
#   puma stream.ru                # gem install puma

require 'sinatra/base'

class Stream < Sinatra::Base
  get '/' do
    content_type :txt

    stream do |out|
      out << "It's gonna be legen -\n"
      sleep 0.5
      out << " (wait for it) \n"
      sleep 1
      out << "- dary!\n"
    end
  end
end

run Stream

Version data entries

165 entries across 159 versions & 26 rubygems

Version Path
sinatra-1.4.1 examples/stream.ru
sinatra-1.4.0 examples/stream.ru
sinatra-1.3.6 examples/stream.ru
sinatra-1.4.0.d examples/stream.ru
torquebox-console-0.2.4 vendor/bundle/ruby/1.8/gems/sinatra-1.3.5/examples/stream.ru
torquebox-console-0.2.4 vendor/bundle/jruby/1.9/gems/sinatra-1.3.5/examples/stream.ru
torquebox-console-0.2.3 vendor/bundle/jruby/1.9/gems/sinatra-1.3.5/examples/stream.ru
sinatra-1.4.0.c examples/stream.ru
sinatra-1.4.0.b examples/stream.ru
sinatra-1.4.0.a examples/stream.ru
sinatra-1.3.5 examples/stream.ru
sinatra-1.3.4 examples/stream.ru
devcenter-0.0.3 vendor/sinatra/examples/stream.ru
devcenter-0.0.2 vendor/sinatra/examples/stream.ru
devcenter-0.0.1 vendor/sinatra/examples/stream.ru
classiccms-0.6.9 vendor/bundle/gems/sinatra-1.3.2/examples/stream.ru
classiccms-0.6.8 vendor/bundle/gems/sinatra-1.3.2/examples/stream.ru
classiccms-0.6.7 vendor/bundle/gems/sinatra-1.3.2/examples/stream.ru
classiccms-0.6.6 vendor/bundle/gems/sinatra-1.3.2/examples/stream.ru
classiccms-0.6.5 vendor/bundle/gems/sinatra-1.3.2/examples/stream.ru