litecable 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +32 -54
- data/.travis.yml +11 -2
- data/CHANGELOG.md +8 -0
- data/README.md +4 -5
- data/Rakefile +2 -0
- data/examples/sinatra/Gemfile +10 -7
- data/examples/sinatra/Procfile +2 -2
- data/examples/sinatra/app.rb +15 -15
- data/examples/sinatra/config.ru +6 -14
- data/examples/sinatra/config/environment.rb +18 -0
- data/lib/lite_cable/anycable.rb +2 -1
- data/lib/lite_cable/channel/base.rb +1 -0
- data/lib/lite_cable/channel/registry.rb +2 -0
- data/lib/lite_cable/config.rb +2 -2
- data/lib/lite_cable/connection/base.rb +1 -0
- data/lib/lite_cable/connection/identification.rb +2 -0
- data/lib/lite_cable/connection/subscriptions.rb +1 -0
- data/lib/lite_cable/logging.rb +2 -1
- data/lib/lite_cable/server/client_socket/base.rb +3 -7
- data/lib/lite_cable/server/client_socket/subscriptions.rb +2 -2
- data/lib/lite_cable/server/heart_beat.rb +1 -1
- data/lib/lite_cable/server/middleware.rb +6 -6
- data/lib/lite_cable/server/subscribers_map.rb +2 -0
- data/lib/lite_cable/version.rb +1 -1
- data/litecable.gemspec +14 -8
- metadata +42 -16
- data/circle.yml +0 -8
- data/examples/sinatra/anycable +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: edbe33668bf263f5af67a29240b2d2fc105c2ccf9e98735f4327ae14d965d2d9
|
4
|
+
data.tar.gz: b6f84ccc2bdbee995028ad821176a41925c2fedaf83142ccf6dd41dafaf21b65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31be4a35bd51711f7cf3677c0a96b749d60133fe7a91cd54aff2ca82f59ee095bd8362a65483d5b2902160fbad1975b060948aae74b292ce10c314e81976c168
|
7
|
+
data.tar.gz: 9cf99b623c1df22104374dbc947e08d694d279e7aae612a3274886433306868f5a75f8fdd096c5cd398319d85d9966b7cf682a424178e0168988a1c81fea014d
|
data/.rubocop.yml
CHANGED
@@ -1,75 +1,53 @@
|
|
1
|
+
require:
|
2
|
+
- standard/cop/semantic_blocks
|
3
|
+
- rubocop-md
|
4
|
+
|
5
|
+
inherit_gem:
|
6
|
+
standard: config/base.yml
|
7
|
+
|
1
8
|
AllCops:
|
2
|
-
# Include gemspec and Rakefile
|
3
|
-
Include:
|
4
|
-
- 'lib/**/*.rb'
|
5
|
-
- 'lib/**/*.rake'
|
6
|
-
- 'spec/**/*.rb'
|
7
9
|
Exclude:
|
8
|
-
- 'bin
|
9
|
-
- 'spec/dummy/**/*'
|
10
|
+
- 'bin/*'
|
10
11
|
- 'tmp/**/*'
|
11
|
-
- '
|
12
|
-
- 'lib/anycable/rpc/**/*'
|
12
|
+
- 'Gemfile'
|
13
13
|
- 'vendor/**/*'
|
14
14
|
- 'gemfiles/**/*'
|
15
|
-
- 'Gemfile'
|
16
|
-
- 'Rakefile'
|
17
|
-
- 'examples/**/*'
|
18
|
-
- '*.gemspec'
|
19
15
|
DisplayCopNames: true
|
20
|
-
|
21
|
-
TargetRubyVersion: 2.3
|
22
|
-
|
23
|
-
Naming/AccessorMethodName:
|
24
|
-
Enabled: false
|
16
|
+
TargetRubyVersion: 2.4
|
25
17
|
|
26
|
-
|
18
|
+
Standard/SemanticBlocks:
|
27
19
|
Enabled: false
|
28
20
|
|
29
|
-
Style/
|
30
|
-
|
31
|
-
- 'spec/**/*.rb'
|
21
|
+
Style/FrozenStringLiteralComment:
|
22
|
+
Enabled: true
|
32
23
|
|
33
|
-
Style/
|
34
|
-
|
24
|
+
Style/TrailingCommaInArrayLiteral:
|
25
|
+
EnforcedStyleForMultiline: no_comma
|
35
26
|
|
36
|
-
Style/
|
37
|
-
|
27
|
+
Style/TrailingCommaInHashLiteral:
|
28
|
+
EnforcedStyleForMultiline: no_comma
|
38
29
|
|
39
|
-
Layout/
|
40
|
-
EnforcedStyle:
|
30
|
+
Layout/AlignParameters:
|
31
|
+
EnforcedStyle: with_first_parameter
|
41
32
|
|
42
|
-
|
33
|
+
Lint/Void:
|
43
34
|
Exclude:
|
44
|
-
- '
|
35
|
+
- '**/*.md'
|
45
36
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
Lint/AmbiguousRegexpLiteral:
|
50
|
-
Enabled: false
|
51
|
-
|
52
|
-
Lint/AssignmentInCondition:
|
53
|
-
Enabled: false
|
54
|
-
|
55
|
-
Metrics/MethodLength:
|
37
|
+
# See https://github.com/rubocop-hq/rubocop/issues/4222
|
38
|
+
Lint/AmbiguousBlockAssociation:
|
56
39
|
Exclude:
|
57
|
-
- 'spec
|
40
|
+
- 'spec/**/*'
|
41
|
+
- '**/*.md'
|
58
42
|
|
59
|
-
|
60
|
-
Max: 20
|
61
|
-
|
62
|
-
Metrics/LineLength:
|
63
|
-
Max: 100
|
43
|
+
Lint/DuplicateMethods:
|
64
44
|
Exclude:
|
65
|
-
- '
|
45
|
+
- '**/*.md'
|
66
46
|
|
67
|
-
|
47
|
+
Naming/FileName:
|
68
48
|
Exclude:
|
69
|
-
|
70
|
-
|
71
|
-
Rails/Date:
|
72
|
-
Enabled: false
|
49
|
+
- '**/*.md'
|
73
50
|
|
74
|
-
|
75
|
-
|
51
|
+
Layout/InitialIndentation:
|
52
|
+
Exclude:
|
53
|
+
- 'CHANGELOG.md'
|
data/.travis.yml
CHANGED
@@ -1,7 +1,16 @@
|
|
1
|
+
sudo: false
|
1
2
|
language: ruby
|
2
3
|
cache: bundler
|
3
4
|
|
5
|
+
before_install:
|
6
|
+
- gem update --system
|
7
|
+
- gem install bundler -v '< 2'
|
8
|
+
|
4
9
|
matrix:
|
5
10
|
include:
|
6
|
-
- rvm: 2.
|
7
|
-
- rvm: 2.
|
11
|
+
- rvm: 2.4
|
12
|
+
- rvm: 2.5
|
13
|
+
- rvm: 2.6
|
14
|
+
- rvm: ruby-head
|
15
|
+
allow_failures:
|
16
|
+
- rvm: ruby-head
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/litecable.svg)](https://rubygems.org/gems/litecable) [![Build Status](https://travis-ci.org/palkan/litecable.svg?branch=master)](https://travis-ci.org/palkan/litecable)
|
2
|
-
[![Dependency Status](https://dependencyci.com/github/palkan/litecable/badge)](https://dependencyci.com/github/palkan/litecable)
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/litecable.svg)](https://rubygems.org/gems/litecable) [![Build Status](https://travis-ci.org/palkan/litecable.svg?branch=master)](https://travis-ci.org/palkan/litecable)
|
3
2
|
|
4
3
|
# Lite Cable
|
5
4
|
|
@@ -23,7 +22,7 @@ Compatible with [AnyCable](http://anycable.io) (for production usage).
|
|
23
22
|
Add this line to your application's Gemfile:
|
24
23
|
|
25
24
|
```ruby
|
26
|
-
gem
|
25
|
+
gem "litecable"
|
27
26
|
```
|
28
27
|
|
29
28
|
And then execute:
|
@@ -74,10 +73,10 @@ To use Lite Cable server:
|
|
74
73
|
|
75
74
|
```ruby
|
76
75
|
Rack::Builder.new do
|
77
|
-
map
|
76
|
+
map "/cable" do
|
78
77
|
# You have to specify your app's connection class
|
79
78
|
use LiteCable::Server::Middleware, connection_class: App::Connection
|
80
|
-
run proc { |_| [200, {
|
79
|
+
run proc { |_| [200, {"Content-Type" => "text/plain"}, ["OK"]] }
|
81
80
|
end
|
82
81
|
end
|
83
82
|
```
|
data/Rakefile
CHANGED
data/examples/sinatra/Gemfile
CHANGED
@@ -1,16 +1,19 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
gem 'sinatra-contrib'
|
5
|
-
gem 'slim'
|
3
|
+
source "https://rubygems.org"
|
6
4
|
|
7
|
-
gem
|
5
|
+
gem "sinatra"
|
6
|
+
gem "sinatra-contrib"
|
7
|
+
gem "slim"
|
8
8
|
|
9
|
-
gem
|
9
|
+
gem "puma"
|
10
|
+
|
11
|
+
gem "pry-byebug"
|
10
12
|
|
11
13
|
# litecable deps
|
12
14
|
gem "anyway_config", "~> 1.0"
|
13
15
|
gem "websocket", "~> 1.2.4"
|
14
16
|
|
15
17
|
# anycable
|
16
|
-
gem "anycable", "~> 0.
|
18
|
+
gem "anycable", "~> 0.6.0"
|
19
|
+
gem "redis"
|
data/examples/sinatra/Procfile
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
web: ANYCABLE=1 bundle exec puma
|
2
|
-
rpc: bundle exec
|
3
|
-
ws:
|
2
|
+
rpc: ANYCABLE=1 bundle exec anycable
|
3
|
+
ws: anycable-go --debug --host localhost --port 9293
|
data/examples/sinatra/app.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
require "sinatra"
|
4
4
|
require "sinatra/cookies"
|
5
5
|
|
6
|
-
CABLE_URL = ENV[
|
6
|
+
CABLE_URL = ENV["ANYCABLE"] ? "ws://localhost:9293/cable" : "/cable"
|
7
7
|
|
8
8
|
class App < Sinatra::Application # :nodoc:
|
9
|
-
set :public_folder,
|
9
|
+
set :public_folder, "assets"
|
10
10
|
|
11
11
|
enable :sessions
|
12
|
-
set :session_secret,
|
12
|
+
set :session_secret, "my_secrets"
|
13
13
|
|
14
|
-
get
|
14
|
+
get "/" do
|
15
15
|
if session[:user]
|
16
16
|
slim :index
|
17
17
|
else
|
@@ -19,31 +19,31 @@ class App < Sinatra::Application # :nodoc:
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
get
|
22
|
+
get "/sign_in" do
|
23
23
|
slim :login
|
24
24
|
end
|
25
25
|
|
26
|
-
post
|
27
|
-
if params[
|
28
|
-
session[:user] = params[
|
29
|
-
cookies["user"] = params[
|
30
|
-
redirect
|
26
|
+
post "/sign_in" do
|
27
|
+
if params["user"]
|
28
|
+
session[:user] = params["user"]
|
29
|
+
cookies["user"] = params["user"]
|
30
|
+
redirect "/"
|
31
31
|
else
|
32
32
|
slim :login
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
-
post
|
37
|
-
if params[
|
38
|
-
redirect "/rooms/#{params[
|
36
|
+
post "/rooms" do
|
37
|
+
if params["id"]
|
38
|
+
redirect "/rooms/#{params["id"]}"
|
39
39
|
else
|
40
40
|
slim :index
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
-
get
|
44
|
+
get "/rooms/:id" do
|
45
45
|
if session[:user]
|
46
|
-
@room_id = params[
|
46
|
+
@room_id = params["id"]
|
47
47
|
@user = session[:user]
|
48
48
|
slim :room
|
49
49
|
else
|
data/examples/sinatra/config.ru
CHANGED
@@ -1,28 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
require './app'
|
7
|
-
require './chat'
|
8
|
-
|
9
|
-
LiteCable.config.log_level = Logger::DEBUG
|
3
|
+
require_relative "config/environment.rb"
|
10
4
|
|
11
5
|
app = Rack::Builder.new do
|
12
|
-
map
|
6
|
+
map "/" do
|
13
7
|
run App
|
14
8
|
end
|
15
9
|
end
|
16
10
|
|
17
|
-
|
18
|
-
#
|
19
|
-
LiteCable.anycable!
|
20
|
-
else
|
11
|
+
unless ENV["ANYCABLE"]
|
12
|
+
# Start built-in rack hijack middleware to serve websockets
|
21
13
|
require "lite_cable/server"
|
22
14
|
|
23
|
-
app.map
|
15
|
+
app.map "/cable" do
|
24
16
|
use LiteCable::Server::Middleware, connection_class: Chat::Connection
|
25
|
-
run
|
17
|
+
run(proc { |_| [200, {"Content-Type" => "text/plain"}, ["OK"]] })
|
26
18
|
end
|
27
19
|
end
|
28
20
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("../../../lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
|
6
|
+
require_relative "../app"
|
7
|
+
require_relative "../chat"
|
8
|
+
|
9
|
+
LiteCable.config.log_level = Logger::DEBUG
|
10
|
+
|
11
|
+
if ENV["ANYCABLE"]
|
12
|
+
require "anycable"
|
13
|
+
|
14
|
+
# Turn AnyCable compatibility mode
|
15
|
+
LiteCable.anycable!
|
16
|
+
|
17
|
+
AnyCable.connection_factory = Chat::Connection
|
18
|
+
end
|
data/lib/lite_cable/anycable.rb
CHANGED
@@ -6,6 +6,7 @@ module LiteCable # :nodoc:
|
|
6
6
|
module Broadcasting # :nodoc:
|
7
7
|
def broadcast(stream, message, coder: nil)
|
8
8
|
coder ||= LiteCable.config.coder
|
9
|
+
# FIXME: after anycable 0.6.0 release
|
9
10
|
Anycable.broadcast stream, coder.encode(message)
|
10
11
|
end
|
11
12
|
end
|
@@ -16,7 +17,7 @@ module LiteCable # :nodoc:
|
|
16
17
|
end
|
17
18
|
|
18
19
|
def call(socket, **options)
|
19
|
-
new(socket,
|
20
|
+
new(socket, options)
|
20
21
|
end
|
21
22
|
|
22
23
|
# Backward compatibility with AnyCable <= 0.4
|
@@ -11,6 +11,7 @@ module LiteCable
|
|
11
11
|
class << self
|
12
12
|
def add(id, channel_class)
|
13
13
|
raise AlreadyRegisteredError if find(id)
|
14
|
+
|
14
15
|
channels[id] = channel_class
|
15
16
|
end
|
16
17
|
|
@@ -21,6 +22,7 @@ module LiteCable
|
|
21
22
|
def find!(id)
|
22
23
|
channel_class = find(id)
|
23
24
|
raise UnknownChannelError unless channel_class
|
25
|
+
|
24
26
|
channel_class
|
25
27
|
end
|
26
28
|
|
data/lib/lite_cable/config.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "anyway"
|
4
|
-
require
|
4
|
+
require "logger"
|
5
5
|
|
6
6
|
module LiteCable
|
7
|
-
#
|
7
|
+
# AnyCable configuration
|
8
8
|
class Config < Anyway::Config
|
9
9
|
require "lite_cable/coders/json"
|
10
10
|
require "lite_cable/coders/raw"
|
@@ -14,6 +14,7 @@ module LiteCable
|
|
14
14
|
define_method(identifier) do
|
15
15
|
return instance_variable_get(:"@#{identifier}") if
|
16
16
|
instance_variable_defined?(:"@#{identifier}")
|
17
|
+
|
17
18
|
fetch_identifier(identifier.to_s)
|
18
19
|
end
|
19
20
|
end
|
@@ -67,6 +68,7 @@ module LiteCable
|
|
67
68
|
identifiers.each_with_object({}) do |id, acc|
|
68
69
|
obj = instance_variable_get("@#{id}")
|
69
70
|
next unless obj
|
71
|
+
|
70
72
|
acc[id.to_s] = LiteCable.config.identifier_coder.encode(obj)
|
71
73
|
end
|
72
74
|
end
|
data/lib/lite_cable/logging.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "logger"
|
4
4
|
|
5
5
|
module LiteCable
|
6
6
|
module Logging # :nodoc:
|
@@ -23,6 +23,7 @@ module LiteCable
|
|
23
23
|
|
24
24
|
def log(level, message = nil)
|
25
25
|
return unless LiteCable::Logging.logger
|
26
|
+
|
26
27
|
LiteCable::Logging.logger.send(level, PREFIX) { message || yield }
|
27
28
|
end
|
28
29
|
end
|
@@ -4,7 +4,6 @@ module LiteCable
|
|
4
4
|
module Server
|
5
5
|
module ClientSocket
|
6
6
|
# Wrapper over web socket
|
7
|
-
# rubocop:disable Metrics/ClassLength
|
8
7
|
class Base
|
9
8
|
include Logging
|
10
9
|
include Subscriptions
|
@@ -73,7 +72,7 @@ module LiteCable
|
|
73
72
|
@message_handlers.each do |h|
|
74
73
|
begin
|
75
74
|
h.call(data)
|
76
|
-
rescue => e # rubocop: disable
|
75
|
+
rescue => e # rubocop: disable Style/RescueStandardError
|
77
76
|
log(:error, "Socket receive failed: #{e}")
|
78
77
|
@error_handlers.each { |eh| eh.call(e, data) }
|
79
78
|
close if close_on_error
|
@@ -134,10 +133,6 @@ module LiteCable
|
|
134
133
|
end
|
135
134
|
end
|
136
135
|
|
137
|
-
# rubocop:disable Metrics/AbcSize
|
138
|
-
# rubocop:disable Metrics/CyclomaticComplexity
|
139
|
-
# rubocop:disable Metrics/PerceivedComplexity
|
140
|
-
# rubocop:disable Metrics/MethodLength
|
141
136
|
def each_frame
|
142
137
|
framebuffer = WebSocket::Frame::Incoming::Server.new(version: version)
|
143
138
|
|
@@ -148,8 +143,9 @@ module LiteCable
|
|
148
143
|
data, _addrinfo = socket.readpartial(2000), socket.peeraddr
|
149
144
|
end
|
150
145
|
break if data.empty?
|
146
|
+
|
151
147
|
framebuffer << data
|
152
|
-
while frame = framebuffer.next
|
148
|
+
while frame = framebuffer.next # rubocop:disable Lint/AssignmentInCondition
|
153
149
|
case frame.type
|
154
150
|
when :close
|
155
151
|
return
|
@@ -7,12 +7,12 @@ module LiteCable
|
|
7
7
|
module Subscriptions
|
8
8
|
def subscribe(channel, broadcasting)
|
9
9
|
LiteCable::Server.subscribers_map
|
10
|
-
|
10
|
+
.add_subscriber(broadcasting, self, channel)
|
11
11
|
end
|
12
12
|
|
13
13
|
def unsubscribe(channel, broadcasting)
|
14
14
|
LiteCable::Server.subscribers_map
|
15
|
-
|
15
|
+
.remove_subscriber(broadcasting, self, channel)
|
16
16
|
end
|
17
17
|
|
18
18
|
def unsubscribe_from_all(channel)
|
@@ -12,15 +12,15 @@ module LiteCable
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call(env)
|
15
|
-
return [404, {
|
16
|
-
env["HTTP_UPGRADE"] ==
|
15
|
+
return [404, {"Content-Type" => "text/plain"}, ["Not Found"]] unless
|
16
|
+
env["HTTP_UPGRADE"] == "websocket"
|
17
17
|
|
18
|
-
raise HijackNotAvailable unless env[
|
18
|
+
raise HijackNotAvailable unless env["rack.hijack"]
|
19
19
|
|
20
|
-
env[
|
20
|
+
env["rack.hijack"].call
|
21
21
|
handshake = send_handshake(env)
|
22
22
|
|
23
|
-
socket = ClientSocket::Base.new env, env[
|
23
|
+
socket = ClientSocket::Base.new env, env["rack.hijack_io"], handshake.version
|
24
24
|
init_connection socket
|
25
25
|
init_heartbeat socket
|
26
26
|
socket.listen
|
@@ -35,7 +35,7 @@ module LiteCable
|
|
35
35
|
)
|
36
36
|
|
37
37
|
handshake.from_rack env
|
38
|
-
env[
|
38
|
+
env["rack.hijack_io"].write handshake.to_s
|
39
39
|
handshake
|
40
40
|
end
|
41
41
|
|
@@ -32,6 +32,7 @@ module LiteCable
|
|
32
32
|
def remove_socket(socket, channel)
|
33
33
|
list = @sync.synchronize do
|
34
34
|
return unless @sockets.key?(socket)
|
35
|
+
|
35
36
|
@sockets[socket].dup
|
36
37
|
end
|
37
38
|
|
@@ -43,6 +44,7 @@ module LiteCable
|
|
43
44
|
def broadcast(stream, message, coder)
|
44
45
|
list = @sync.synchronize do
|
45
46
|
return unless @streams.key?(stream)
|
47
|
+
|
46
48
|
@streams[stream].to_a
|
47
49
|
end
|
48
50
|
|
data/lib/lite_cable/version.rb
CHANGED
data/litecable.gemspec
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require
|
5
|
+
require "lite_cable/version"
|
4
6
|
|
5
7
|
Gem::Specification.new do |spec|
|
6
8
|
spec.name = "litecable"
|
@@ -8,15 +10,17 @@ Gem::Specification.new do |spec|
|
|
8
10
|
spec.authors = ["palkan"]
|
9
11
|
spec.email = ["dementiev.vm@gmail.com"]
|
10
12
|
|
11
|
-
spec.summary =
|
12
|
-
spec.description =
|
13
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.summary = "Fat-free ActionCable implementation"
|
14
|
+
spec.description = "Fat-free ActionCable implementation for using with AnyCable (and without Rails)"
|
15
|
+
spec.homepage = "https://github.com/palkan/litecable"
|
14
16
|
spec.license = "MIT"
|
15
17
|
|
16
18
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
19
|
spec.require_paths = ["lib"]
|
18
20
|
|
19
|
-
spec.
|
21
|
+
spec.required_ruby_version = ">= 2.4.0"
|
22
|
+
|
23
|
+
spec.add_dependency "anyway_config", ">= 1.0"
|
20
24
|
|
21
25
|
spec.add_development_dependency "rack", "~> 2.0"
|
22
26
|
spec.add_development_dependency "websocket", "~> 1.2.4"
|
@@ -24,10 +28,12 @@ Gem::Specification.new do |spec|
|
|
24
28
|
spec.add_development_dependency "concurrent-ruby", "~> 1.0.0"
|
25
29
|
spec.add_development_dependency "puma", "~> 3.6"
|
26
30
|
|
27
|
-
spec.add_development_dependency "bundler", "
|
31
|
+
spec.add_development_dependency "bundler", ">= 1.13"
|
28
32
|
spec.add_development_dependency "rake", ">= 10.0"
|
29
33
|
spec.add_development_dependency "rspec", "~> 3.0"
|
30
34
|
spec.add_development_dependency "simplecov", ">= 0.3.8"
|
31
|
-
spec.add_development_dependency "rubocop", "
|
35
|
+
spec.add_development_dependency "rubocop", "~> 0.65.0"
|
36
|
+
spec.add_development_dependency "rubocop-md", "~> 0.2"
|
37
|
+
spec.add_development_dependency "standard", "~> 0.0.36"
|
32
38
|
spec.add_development_dependency "pry-byebug"
|
33
39
|
end
|
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.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-12 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
|
@@ -98,14 +98,14 @@ dependencies:
|
|
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
|
@@ -154,16 +154,44 @@ dependencies:
|
|
154
154
|
name: rubocop
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: 0.65.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: 0.65.0
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rubocop-md
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.2'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.2'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: standard
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 0.0.36
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 0.0.36
|
167
195
|
- !ruby/object:Gem::Dependency
|
168
196
|
name: pry-byebug
|
169
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,17 +226,16 @@ files:
|
|
198
226
|
- Rakefile
|
199
227
|
- bin/console
|
200
228
|
- bin/setup
|
201
|
-
- circle.yml
|
202
229
|
- examples/sinatra/Gemfile
|
203
230
|
- examples/sinatra/Procfile
|
204
231
|
- examples/sinatra/README.md
|
205
|
-
- examples/sinatra/anycable
|
206
232
|
- examples/sinatra/app.rb
|
207
233
|
- examples/sinatra/assets/app.css
|
208
234
|
- examples/sinatra/assets/cable.js
|
209
235
|
- examples/sinatra/assets/reset.css
|
210
236
|
- examples/sinatra/chat.rb
|
211
237
|
- examples/sinatra/config.ru
|
238
|
+
- examples/sinatra/config/environment.rb
|
212
239
|
- examples/sinatra/views/index.slim
|
213
240
|
- examples/sinatra/views/layout.slim
|
214
241
|
- examples/sinatra/views/login.slim
|
@@ -242,7 +269,7 @@ files:
|
|
242
269
|
- lib/lite_cable/version.rb
|
243
270
|
- lib/litecable.rb
|
244
271
|
- litecable.gemspec
|
245
|
-
homepage: https://github.com/
|
272
|
+
homepage: https://github.com/palkan/litecable
|
246
273
|
licenses:
|
247
274
|
- MIT
|
248
275
|
metadata: {}
|
@@ -254,15 +281,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
254
281
|
requirements:
|
255
282
|
- - ">="
|
256
283
|
- !ruby/object:Gem::Version
|
257
|
-
version:
|
284
|
+
version: 2.4.0
|
258
285
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
259
286
|
requirements:
|
260
287
|
- - ">="
|
261
288
|
- !ruby/object:Gem::Version
|
262
289
|
version: '0'
|
263
290
|
requirements: []
|
264
|
-
|
265
|
-
rubygems_version: 2.6.13
|
291
|
+
rubygems_version: 3.0.2
|
266
292
|
signing_key:
|
267
293
|
specification_version: 4
|
268
294
|
summary: Fat-free ActionCable implementation
|
data/circle.yml
DELETED
data/examples/sinatra/anycable
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# frozen_string_literal: true
|
3
|
-
|
4
|
-
lib = File.expand_path("../../../lib", __FILE__)
|
5
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
-
|
7
|
-
require "./chat"
|
8
|
-
require "rack"
|
9
|
-
require "anycable"
|
10
|
-
|
11
|
-
# Turn AnyCable compatibility mode
|
12
|
-
LiteCable.anycable!
|
13
|
-
|
14
|
-
Anycable.connection_factory = Chat::Connection
|
15
|
-
|
16
|
-
Anycable::Server.start
|