ration 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16eee91f9339a1e635c1913995515056c4e154bc1b8e5a657917591e0aaf033d
4
- data.tar.gz: 4f059b3b5a90c4c8dcd72075ba231488248c391aebb528a916eef511e33ce20b
3
+ metadata.gz: 02c32262f7ebb5d662b14e33644d5f70c906d85fab486372a22f22a206a3f324
4
+ data.tar.gz: 6c3d4a78a6c3586ba5cd691207d4f090eb7fddc15177c3c43cf496a5bf2b7059
5
5
  SHA512:
6
- metadata.gz: 3be362124e709b25d33df4a9f7997aac2c592c689c6c98d7e27fb825da626af4749dccaf3c3f15244ff50d9e6a1aa5cc181c6553d74f5f333aacf88f8396d42a
7
- data.tar.gz: f467fa48b7727e23a3b9f799ac218aea86589da4270a8f60e2cb0506c0b739f88718fa9f7671699aeac455d4ac0c0de43376e67373e3c27b3eab756f47bfacdb
6
+ metadata.gz: 26d8db4af267c0d3aba606260d875df7ed16ff56eab283c767521fc8cae8f1044fa051fcb531a7dbb8b51e2071574204769a88bcc51e17e8de5898d907df7d7f
7
+ data.tar.gz: b6cdc8c153237a6e13161e004be80af5f88784ba52f7f55b864c5b97e0051e7f70399844bc553d3a8fe1db9e40d2052f425df4e830437e4fa2b9ce77a287aecc
@@ -0,0 +1,16 @@
1
+ require 'ration'
2
+ require 'ration/sse'
3
+
4
+ module Ration
5
+ module Rails
6
+ module SSE
7
+ def sse_stream(&block)
8
+ response.headers['Content-Type'] = 'text/event-stream'
9
+ response.headers['Cache-Control'] = 'no-cache'
10
+ request.env['puma.mark_as_io_bound']&.call
11
+
12
+ self.response_body = Enumerator.new(&block)
13
+ end
14
+ end
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Ration
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keita Urashima
@@ -54,6 +54,7 @@ files:
54
54
  - lib/ration/configuration.rb
55
55
  - lib/ration/errors.rb
56
56
  - lib/ration/hub.rb
57
+ - lib/ration/rails.rb
57
58
  - lib/ration/sse.rb
58
59
  - lib/ration/subscription.rb
59
60
  - lib/ration/version.rb