litecable 0.4.2 → 0.7.2
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 +5 -5
- data/CHANGELOG.md +38 -1
- data/LICENSE.txt +1 -1
- data/README.md +27 -28
- data/lib/lite_cable.rb +23 -2
- data/lib/lite_cable/anycable.rb +22 -13
- data/lib/lite_cable/broadcast_adapters.rb +35 -0
- data/lib/lite_cable/broadcast_adapters/any_cable.rb +11 -0
- data/lib/lite_cable/broadcast_adapters/base.rb +17 -0
- data/lib/lite_cable/broadcast_adapters/memory.rb +11 -0
- data/lib/lite_cable/channel.rb +1 -0
- data/lib/lite_cable/channel/base.rb +4 -2
- data/lib/lite_cable/channel/registry.rb +5 -0
- data/lib/lite_cable/channel/streams.rb +1 -2
- data/lib/lite_cable/coders.rb +1 -0
- data/lib/lite_cable/coders/json.rb +1 -0
- data/lib/lite_cable/coders/raw.rb +2 -1
- data/lib/lite_cable/config.rb +8 -6
- data/lib/lite_cable/connection.rb +1 -0
- data/lib/lite_cable/connection/authorization.rb +1 -0
- data/lib/lite_cable/connection/base.rb +2 -2
- data/lib/lite_cable/connection/identification.rb +3 -0
- data/lib/lite_cable/connection/streams.rb +1 -0
- data/lib/lite_cable/connection/subscriptions.rb +10 -5
- data/lib/lite_cable/internal.rb +1 -0
- data/lib/lite_cable/logging.rb +4 -2
- data/lib/lite_cable/server.rb +1 -6
- data/lib/lite_cable/server/client_socket.rb +1 -0
- data/lib/lite_cable/server/client_socket/base.rb +17 -21
- data/lib/lite_cable/server/client_socket/subscriptions.rb +3 -2
- data/lib/lite_cable/server/heart_beat.rb +4 -1
- data/lib/lite_cable/server/middleware.rb +7 -6
- data/lib/lite_cable/server/subscribers_map.rb +3 -0
- data/lib/lite_cable/version.rb +2 -1
- data/lib/litecable.rb +1 -0
- metadata +28 -75
- data/.gem_release.yml +0 -3
- data/.gitignore +0 -40
- data/.rubocop.yml +0 -63
- data/.travis.yml +0 -7
- data/Gemfile +0 -4
- data/Rakefile +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/circle.yml +0 -8
- data/examples/sinatra/Gemfile +0 -16
- data/examples/sinatra/Procfile +0 -3
- data/examples/sinatra/README.md +0 -33
- data/examples/sinatra/anycable +0 -18
- data/examples/sinatra/app.rb +0 -52
- data/examples/sinatra/assets/app.css +0 -169
- data/examples/sinatra/assets/cable.js +0 -584
- data/examples/sinatra/assets/reset.css +0 -223
- data/examples/sinatra/bin/anycable-go +0 -0
- data/examples/sinatra/chat.rb +0 -39
- data/examples/sinatra/config.ru +0 -28
- data/examples/sinatra/views/index.slim +0 -8
- data/examples/sinatra/views/layout.slim +0 -15
- data/examples/sinatra/views/login.slim +0 -8
- data/examples/sinatra/views/resetcss.slim +0 -224
- data/examples/sinatra/views/room.slim +0 -68
- data/litecable.gemspec +0 -33
data/lib/litecable.rb
CHANGED
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: litecable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anyway_config
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -72,40 +72,40 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: '1.1'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: '1.1'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: puma
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '3.6'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.6'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '1.13'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '1.13'
|
111
111
|
- !ruby/object:Gem::Dependency
|
@@ -124,46 +124,18 @@ dependencies:
|
|
124
124
|
version: '10.0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rspec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '3.0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '3.0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: simplecov
|
141
127
|
requirement: !ruby/object:Gem::Requirement
|
142
128
|
requirements:
|
143
129
|
- - ">="
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 0.3.8
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: pry-byebug
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - ">="
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0'
|
131
|
+
version: '3.0'
|
160
132
|
type: :development
|
161
133
|
prerelease: false
|
162
134
|
version_requirements: !ruby/object:Gem::Requirement
|
163
135
|
requirements:
|
164
136
|
- - ">="
|
165
137
|
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
138
|
+
version: '3.0'
|
167
139
|
description: Fat-free ActionCable implementation for using with AnyCable (and without
|
168
140
|
Rails)
|
169
141
|
email:
|
@@ -172,37 +144,15 @@ executables: []
|
|
172
144
|
extensions: []
|
173
145
|
extra_rdoc_files: []
|
174
146
|
files:
|
175
|
-
- ".gem_release.yml"
|
176
|
-
- ".gitignore"
|
177
|
-
- ".rspec"
|
178
|
-
- ".rubocop.yml"
|
179
|
-
- ".travis.yml"
|
180
147
|
- CHANGELOG.md
|
181
|
-
- Gemfile
|
182
148
|
- LICENSE.txt
|
183
149
|
- README.md
|
184
|
-
- Rakefile
|
185
|
-
- bin/console
|
186
|
-
- bin/setup
|
187
|
-
- circle.yml
|
188
|
-
- examples/sinatra/Gemfile
|
189
|
-
- examples/sinatra/Procfile
|
190
|
-
- examples/sinatra/README.md
|
191
|
-
- examples/sinatra/anycable
|
192
|
-
- examples/sinatra/app.rb
|
193
|
-
- examples/sinatra/assets/app.css
|
194
|
-
- examples/sinatra/assets/cable.js
|
195
|
-
- examples/sinatra/assets/reset.css
|
196
|
-
- examples/sinatra/bin/anycable-go
|
197
|
-
- examples/sinatra/chat.rb
|
198
|
-
- examples/sinatra/config.ru
|
199
|
-
- examples/sinatra/views/index.slim
|
200
|
-
- examples/sinatra/views/layout.slim
|
201
|
-
- examples/sinatra/views/login.slim
|
202
|
-
- examples/sinatra/views/resetcss.slim
|
203
|
-
- examples/sinatra/views/room.slim
|
204
150
|
- lib/lite_cable.rb
|
205
151
|
- lib/lite_cable/anycable.rb
|
152
|
+
- lib/lite_cable/broadcast_adapters.rb
|
153
|
+
- lib/lite_cable/broadcast_adapters/any_cable.rb
|
154
|
+
- lib/lite_cable/broadcast_adapters/base.rb
|
155
|
+
- lib/lite_cable/broadcast_adapters/memory.rb
|
206
156
|
- lib/lite_cable/channel.rb
|
207
157
|
- lib/lite_cable/channel/base.rb
|
208
158
|
- lib/lite_cable/channel/registry.rb
|
@@ -228,12 +178,16 @@ files:
|
|
228
178
|
- lib/lite_cable/server/subscribers_map.rb
|
229
179
|
- lib/lite_cable/version.rb
|
230
180
|
- lib/litecable.rb
|
231
|
-
|
232
|
-
homepage: https://github.com/anycable/litecable
|
181
|
+
homepage: https://github.com/palkan/litecable
|
233
182
|
licenses:
|
234
183
|
- MIT
|
235
|
-
metadata:
|
236
|
-
|
184
|
+
metadata:
|
185
|
+
bug_tracker_uri: http://github.com/palkan/litecable/issues
|
186
|
+
changelog_uri: https://github.com/palkan/litecable/blob/master/CHANGELOG.md
|
187
|
+
documentation_uri: http://github.com/palkan/litecable
|
188
|
+
homepage_uri: http://github.com/palkan/litecable
|
189
|
+
source_code_uri: http://github.com/palkan/litecable
|
190
|
+
post_install_message:
|
237
191
|
rdoc_options: []
|
238
192
|
require_paths:
|
239
193
|
- lib
|
@@ -241,16 +195,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
241
195
|
requirements:
|
242
196
|
- - ">="
|
243
197
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
198
|
+
version: 2.5.0
|
245
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
246
200
|
requirements:
|
247
201
|
- - ">="
|
248
202
|
- !ruby/object:Gem::Version
|
249
203
|
version: '0'
|
250
204
|
requirements: []
|
251
|
-
|
252
|
-
|
253
|
-
signing_key:
|
205
|
+
rubygems_version: 3.2.15
|
206
|
+
signing_key:
|
254
207
|
specification_version: 4
|
255
208
|
summary: Fat-free ActionCable implementation
|
256
209
|
test_files: []
|
data/.gem_release.yml
DELETED
data/.gitignore
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# Numerous always-ignore extensions
|
2
|
-
*.diff
|
3
|
-
*.err
|
4
|
-
*.orig
|
5
|
-
*.log
|
6
|
-
*.rej
|
7
|
-
*.swo
|
8
|
-
*.swp
|
9
|
-
*.vi
|
10
|
-
*~
|
11
|
-
*.sass-cache
|
12
|
-
*.iml
|
13
|
-
.idea/
|
14
|
-
|
15
|
-
# Sublime
|
16
|
-
*.sublime-project
|
17
|
-
*.sublime-workspace
|
18
|
-
|
19
|
-
# OS or Editor folders
|
20
|
-
.DS_Store
|
21
|
-
.cache
|
22
|
-
.project
|
23
|
-
.settings
|
24
|
-
.tmproj
|
25
|
-
Thumbs.db
|
26
|
-
|
27
|
-
.bundle/
|
28
|
-
log/*.log
|
29
|
-
*.gz
|
30
|
-
pkg/
|
31
|
-
spec/dummy/db/*.sqlite3
|
32
|
-
spec/dummy/db/*.sqlite3-journal
|
33
|
-
spec/dummy/tmp/
|
34
|
-
|
35
|
-
Gemfile.lock
|
36
|
-
Gemfile.local
|
37
|
-
.rspec
|
38
|
-
*.gem
|
39
|
-
tmp/
|
40
|
-
coverage/
|
data/.rubocop.yml
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
# Include gemspec and Rakefile
|
3
|
-
Include:
|
4
|
-
- 'lib/**/*.rb'
|
5
|
-
- 'lib/**/*.rake'
|
6
|
-
- 'spec/**/*.rb'
|
7
|
-
Exclude:
|
8
|
-
- 'bin/**/*'
|
9
|
-
- 'spec/dummy/**/*'
|
10
|
-
- 'tmp/**/*'
|
11
|
-
- 'bench/**/*'
|
12
|
-
- 'lib/anycable/rpc/**/*'
|
13
|
-
DisplayCopNames: true
|
14
|
-
StyleGuideCopsOnly: false
|
15
|
-
TargetRubyVersion: 2.3
|
16
|
-
|
17
|
-
Style/AccessorMethodName:
|
18
|
-
Enabled: false
|
19
|
-
|
20
|
-
Style/TrivialAccessors:
|
21
|
-
Enabled: false
|
22
|
-
|
23
|
-
Style/Documentation:
|
24
|
-
Exclude:
|
25
|
-
- 'spec/**/*.rb'
|
26
|
-
|
27
|
-
Style/ParallelAssignment:
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
Style/StringLiterals:
|
31
|
-
Enabled: false
|
32
|
-
|
33
|
-
Style/SpaceInsideStringInterpolation:
|
34
|
-
EnforcedStyle: no_space
|
35
|
-
|
36
|
-
Style/BlockDelimiters:
|
37
|
-
Exclude:
|
38
|
-
- 'spec/**/*.rb'
|
39
|
-
|
40
|
-
Lint/AmbiguousRegexpLiteral:
|
41
|
-
Enabled: false
|
42
|
-
|
43
|
-
Lint/AssignmentInCondition:
|
44
|
-
Enabled: false
|
45
|
-
|
46
|
-
Metrics/MethodLength:
|
47
|
-
Exclude:
|
48
|
-
- 'spec/**/*.rb'
|
49
|
-
|
50
|
-
Metrics/LineLength:
|
51
|
-
Max: 100
|
52
|
-
Exclude:
|
53
|
-
- 'spec/**/*.rb'
|
54
|
-
|
55
|
-
Metrics/BlockLength:
|
56
|
-
Exclude:
|
57
|
-
- 'spec/**/*.rb'
|
58
|
-
|
59
|
-
Rails/Date:
|
60
|
-
Enabled: false
|
61
|
-
|
62
|
-
Rails/TimeZone:
|
63
|
-
Enabled: false
|
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "litecable"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|
data/bin/setup
DELETED
data/circle.yml
DELETED
data/examples/sinatra/Gemfile
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
source 'https://rubygems.org'
|
2
|
-
|
3
|
-
gem 'sinatra'
|
4
|
-
gem 'sinatra-contrib'
|
5
|
-
gem 'slim'
|
6
|
-
|
7
|
-
gem 'puma'
|
8
|
-
|
9
|
-
gem 'pry-byebug'
|
10
|
-
|
11
|
-
# litecable deps
|
12
|
-
gem "anyway_config", "~> 0.5.0"
|
13
|
-
gem "websocket", "~> 1.2.4"
|
14
|
-
|
15
|
-
# anycable
|
16
|
-
gem "anycable", "~> 0.4.2"
|
data/examples/sinatra/Procfile
DELETED
data/examples/sinatra/README.md
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# Lite Cable Sinatra Demo
|
2
|
-
|
3
|
-
Sample chat application built with [Sinatra](http://www.sinatrarb.com) and Lite Cable.
|
4
|
-
|
5
|
-
## Usage
|
6
|
-
|
7
|
-
Install dependencies:
|
8
|
-
|
9
|
-
```sh
|
10
|
-
bundle install
|
11
|
-
```
|
12
|
-
|
13
|
-
Run server:
|
14
|
-
|
15
|
-
```sh
|
16
|
-
bundle exec puma
|
17
|
-
```
|
18
|
-
|
19
|
-
Open your browser at [localhost:9292](http://localhost:9292), enter your name and a chat room ID (anything you want).
|
20
|
-
|
21
|
-
Then open another session (another browser, incognito window) and repeat all steps using the same room ID.
|
22
|
-
|
23
|
-
Now you can chat with yourself!
|
24
|
-
|
25
|
-
## AnyCable usage
|
26
|
-
|
27
|
-
This example also can be used with [AnyCable](http://anycable.io).
|
28
|
-
|
29
|
-
Just run `Procfile` with your favourite tool ([hivemind](https://github.com/DarthSim/hivemind) or [Foreman](http://ddollar.github.io/foreman/)):
|
30
|
-
|
31
|
-
```sh
|
32
|
-
hivemind
|
33
|
-
```
|
data/examples/sinatra/anycable
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
lib = File.expand_path("../../../lib", __FILE__)
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
require "./chat"
|
7
|
-
require "rack"
|
8
|
-
require "anycable"
|
9
|
-
|
10
|
-
# Turn AnyCable compatibility mode
|
11
|
-
LiteCable.anycable!
|
12
|
-
|
13
|
-
Anycable.configure do |config|
|
14
|
-
config.connection_factory = Chat::Connection
|
15
|
-
config.debug = true
|
16
|
-
end
|
17
|
-
|
18
|
-
Anycable::Server.start
|