rack-emstream 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/config.ru +28 -0
- data/lib/rack-emstream.rb +2 -0
- data/lib/rack-emstream/version.rb +2 -2
- metadata +3 -3
data/config.ru
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
$: << File.expand_path('../lib', __FILE__)
|
2
|
+
require 'rack-emstream'
|
3
|
+
|
4
|
+
class Sender
|
5
|
+
def initialize
|
6
|
+
@times = 100
|
7
|
+
@data = "data"
|
8
|
+
end
|
9
|
+
|
10
|
+
def each
|
11
|
+
@times.times { |i|
|
12
|
+
yield @data
|
13
|
+
}
|
14
|
+
end
|
15
|
+
|
16
|
+
def length
|
17
|
+
@times * @data.length
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
require 'logger'
|
22
|
+
|
23
|
+
use Rack::EMStream
|
24
|
+
run lambda { |env|
|
25
|
+
sender = Sender.new
|
26
|
+
|
27
|
+
[ 200, { 'Content-Length' => sender.length.to_s }, sender ]
|
28
|
+
}
|
data/lib/rack-emstream.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-emstream
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- LICENSE
|
40
40
|
- README.md
|
41
41
|
- Rakefile
|
42
|
+
- config.ru
|
42
43
|
- lib/rack-emstream.rb
|
43
44
|
- lib/rack-emstream/version.rb
|
44
45
|
- lib/rack/emstream.rb
|
@@ -68,4 +69,3 @@ signing_key:
|
|
68
69
|
specification_version: 3
|
69
70
|
summary: Super-simple Rack streaming with Thin
|
70
71
|
test_files: []
|
71
|
-
has_rdoc:
|