fr_cable 0.1.0 → 0.1.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +37 -14
- data/lib/fr_cable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00f4c7dba9ba7b2641c44d5c05a6b379382d080d768e1e593f4f81402c4493a8
|
4
|
+
data.tar.gz: 68821217f40a3e5dc45b4d0b22acbd3aa65d5fc36672b8bd32e534eb8bcdff27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 586333aba3a48c4cadd729f51e250c329cf4901c03557372d4d37f85997815bb5fc18c81a04d8aaf6388e5818627c32e6908b1231f1512f849821970c14547b5
|
7
|
+
data.tar.gz: 7e8d2a470b0b1b35b3df7447d830676f954a4c8885b3ff82be23f69fa3ca007229cfcde2cbc02685fa8275bb2243717a3acda79bd0960e9fa555f5004a1dec26
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# FrCable
|
1
|
+
# FrCable ruby
|
2
2
|
|
3
|
-
|
3
|
+
It's http rake based middleware server impementation for fr-cable-server.
|
4
4
|
|
5
|
-
|
5
|
+
`!!!WARNING!!!` The project is at a very early stage of development, it can be used, but there is no guarantee that it works as you expect and that I will not abandon it tomorrow
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -20,25 +20,48 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
$ gem install fr_cable
|
22
22
|
|
23
|
-
|
23
|
+
Add this line into you `config/application.rb`
|
24
24
|
|
25
|
-
|
25
|
+
```
|
26
|
+
config.middleware.use FrCable::Rack
|
27
|
+
```
|
26
28
|
|
27
|
-
|
29
|
+
Then touch `app/channels/application_cable/channel.rb, that contain`
|
30
|
+
```
|
31
|
+
class ApplicationCable::Channel < FrCable::Channel::Base
|
28
32
|
|
29
|
-
|
33
|
+
end
|
34
|
+
```
|
30
35
|
|
31
|
-
|
36
|
+
and `app/channels/application_cable/connection.rb`
|
32
37
|
|
33
|
-
|
38
|
+
```
|
39
|
+
class ApplicationCable::Connection < FrCable::Connection::Base
|
34
40
|
|
35
|
-
|
41
|
+
end
|
42
|
+
```
|
36
43
|
|
37
44
|
|
38
|
-
##
|
45
|
+
## Usage
|
39
46
|
|
40
|
-
|
47
|
+
You can define channels like in action_cable gem.
|
41
48
|
|
42
|
-
|
49
|
+
`app/channels/comment_channel.rb`
|
50
|
+
|
51
|
+
```
|
52
|
+
class OrderChannel < ApplicationCable::Channel
|
53
|
+
def receive message
|
54
|
+
broadcast(params[:room], message)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
```
|
58
|
+
|
59
|
+
Run fr-cable-server dockerfile near of you app and you already can messaging through fr-cable-js-client npm package.
|
60
|
+
|
61
|
+
## Contributing
|
62
|
+
|
63
|
+
No needed to contribute now
|
64
|
+
|
65
|
+
## License
|
43
66
|
|
44
|
-
|
67
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/lib/fr_cable/version.rb
CHANGED