anycable-rails-core 1.5.4 → 1.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/anycable/rails/compatibility/rubocop.rb +2 -25
- data/lib/anycable/rails/{compatibility/rubocop → rubocop}/cops/anycable/instance_vars.rb +1 -1
- data/lib/anycable/rails/{compatibility/rubocop → rubocop}/cops/anycable/periodical_timers.rb +1 -1
- data/lib/anycable/rails/{compatibility/rubocop → rubocop}/cops/anycable/stream_from.rb +3 -5
- data/lib/anycable/rails/rubocop.rb +27 -0
- data/lib/anycable/rails/version.rb +1 -1
- data/lib/anycable/rails.rb +1 -1
- data/lib/generators/anycable/setup/templates/config/anycable.yml.tt +1 -1
- metadata +7 -6
- /data/lib/anycable/rails/{compatibility/rubocop → rubocop}/config/default.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d1806c2fa82dabe3ba59ed53b814f9b1380e42f8f6341af82c4c27bf192c283
|
4
|
+
data.tar.gz: f2bf0761e8d2edf39f9a17869f89e0e2ad0bb80d49c74de451f53b00a0406144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4ece01b56c5118971493acf71a9f99651961d872dc51a6f58808ce4daf84e3e9c9514f4d79b214cf4621b39131d2cbf0cac04a085cef0e0394bb72a7a11b4b8
|
7
|
+
data.tar.gz: '0441569abd1b2c94969fc30d2f4b2a33657a663f3e3b6a2e68c7970da1a2008f72d7fd4afe2de49d86b1d85963237f2630e459e2708cf19d8e9f3f105bf59f8a'
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.5.5 (2024-12-12)
|
6
|
+
|
7
|
+
- Publish RuboCop cops as a separate gem (`rubocop-anycable-rails`). ([@palkan][])
|
8
|
+
|
9
|
+
- Upgrade RuboCop cops. ([@palkan][])
|
10
|
+
|
5
11
|
## 1.5.4 (2024-10-08)
|
6
12
|
|
7
13
|
- Add [actioncable-next](https://github.com/anycable/actioncable-next) support. ([@palkan][])
|
@@ -1,27 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require_relative "rubocop/cops/anycable/stream_from"
|
7
|
-
require_relative "rubocop/cops/anycable/periodical_timers"
|
8
|
-
require_relative "rubocop/cops/anycable/instance_vars"
|
9
|
-
|
10
|
-
module RuboCop
|
11
|
-
module AnyCable # :nodoc:
|
12
|
-
CONFIG_DEFAULT = Pathname.new(__dir__).join("rubocop", "config", "default.yml").freeze
|
13
|
-
|
14
|
-
# Merge anycable config into default configuration
|
15
|
-
# See https://github.com/backus/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
|
16
|
-
def self.inject!
|
17
|
-
path = CONFIG_DEFAULT.to_s
|
18
|
-
puts "configuration from #{path}" if ConfigLoader.debug?
|
19
|
-
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
20
|
-
config = Config.new(hash, path)
|
21
|
-
config = ConfigLoader.merge_with_default(config, path)
|
22
|
-
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
RuboCop::AnyCable.inject!
|
3
|
+
# For backwards compatibility
|
4
|
+
require_relative "../rubocop"
|
data/lib/anycable/rails/{compatibility/rubocop → rubocop}/cops/anycable/periodical_timers.rb
RENAMED
@@ -13,7 +13,7 @@ module RuboCop
|
|
13
13
|
# periodically(:do_something, every: 2.seconds)
|
14
14
|
# end
|
15
15
|
#
|
16
|
-
class PeriodicalTimers < RuboCop::Cop::
|
16
|
+
class PeriodicalTimers < RuboCop::Cop::Base
|
17
17
|
MSG = "Periodical Timers are not supported in AnyCable"
|
18
18
|
|
19
19
|
def_node_matcher :calls_periodically?, <<-PATTERN
|
@@ -34,7 +34,7 @@ module RuboCop
|
|
34
34
|
# end
|
35
35
|
# end
|
36
36
|
#
|
37
|
-
class StreamFrom < RuboCop::Cop::
|
37
|
+
class StreamFrom < RuboCop::Cop::Base
|
38
38
|
def_node_matcher :stream_from_with_block?, <<-PATTERN
|
39
39
|
(block {(send _ :stream_from ...) (send _ :stream_for ...)} ...)
|
40
40
|
PATTERN
|
@@ -81,16 +81,14 @@ module RuboCop
|
|
81
81
|
|
82
82
|
def add_callback_offense(node)
|
83
83
|
add_offense(
|
84
|
-
node,
|
85
|
-
location: :expression,
|
84
|
+
node.loc.expression,
|
86
85
|
message: "Custom stream callbacks are not supported in AnyCable"
|
87
86
|
)
|
88
87
|
end
|
89
88
|
|
90
89
|
def add_custom_coder_offense(node)
|
91
90
|
add_offense(
|
92
|
-
node,
|
93
|
-
location: :expression,
|
91
|
+
node.loc.expression,
|
94
92
|
message: "Custom coders are not supported in AnyCable"
|
95
93
|
)
|
96
94
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rubocop"
|
4
|
+
require "pathname"
|
5
|
+
|
6
|
+
require_relative "rubocop/cops/anycable/stream_from"
|
7
|
+
require_relative "rubocop/cops/anycable/periodical_timers"
|
8
|
+
require_relative "rubocop/cops/anycable/instance_vars"
|
9
|
+
|
10
|
+
module RuboCop
|
11
|
+
module AnyCable # :nodoc:
|
12
|
+
CONFIG_DEFAULT = Pathname.new(__dir__).join("rubocop", "config", "default.yml").freeze
|
13
|
+
|
14
|
+
# Merge anycable config into default configuration
|
15
|
+
# See https://github.com/backus/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
|
16
|
+
def self.inject!
|
17
|
+
path = CONFIG_DEFAULT.to_s
|
18
|
+
puts "configuration from #{path}" if ConfigLoader.debug?
|
19
|
+
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
20
|
+
config = Config.new(hash, path)
|
21
|
+
config = ConfigLoader.merge_with_default(config, path)
|
22
|
+
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
RuboCop::AnyCable.inject!
|
data/lib/anycable/rails.rb
CHANGED
@@ -84,7 +84,7 @@ end
|
|
84
84
|
|
85
85
|
# Warn if application has been already initialized.
|
86
86
|
# AnyCable should be loaded before initialization in order to work correctly.
|
87
|
-
if defined?(::Rails) && ::Rails.application
|
87
|
+
if defined?(::Rails) && ::Rails.application&.initialized?
|
88
88
|
puts("\n**************************************************")
|
89
89
|
puts(
|
90
90
|
"⛔️ WARNING: AnyCable loaded after application initialization. Might not work correctly.\n" \
|
@@ -23,7 +23,7 @@ default: &default
|
|
23
23
|
<%- else -%>
|
24
24
|
# Use HTTP broadcaster
|
25
25
|
broadcast_adapter: http
|
26
|
-
http_broadcast_url: "http://localhost:8090/
|
26
|
+
http_broadcast_url: "http://localhost:8090/_broadcast"
|
27
27
|
<%- end -%>
|
28
28
|
<%- if redis? -%>
|
29
29
|
# You can use REDIS_URL env var to configure Redis URL.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anycable-rails-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anycable-core
|
@@ -80,10 +80,6 @@ files:
|
|
80
80
|
- lib/anycable/rails/channel_state.rb
|
81
81
|
- lib/anycable/rails/compatibility.rb
|
82
82
|
- lib/anycable/rails/compatibility/rubocop.rb
|
83
|
-
- lib/anycable/rails/compatibility/rubocop/config/default.yml
|
84
|
-
- lib/anycable/rails/compatibility/rubocop/cops/anycable/instance_vars.rb
|
85
|
-
- lib/anycable/rails/compatibility/rubocop/cops/anycable/periodical_timers.rb
|
86
|
-
- lib/anycable/rails/compatibility/rubocop/cops/anycable/stream_from.rb
|
87
83
|
- lib/anycable/rails/config.rb
|
88
84
|
- lib/anycable/rails/connection.rb
|
89
85
|
- lib/anycable/rails/connection_factory.rb
|
@@ -105,6 +101,11 @@ files:
|
|
105
101
|
- lib/anycable/rails/pubsub_channel.rb
|
106
102
|
- lib/anycable/rails/rack.rb
|
107
103
|
- lib/anycable/rails/railtie.rb
|
104
|
+
- lib/anycable/rails/rubocop.rb
|
105
|
+
- lib/anycable/rails/rubocop/config/default.yml
|
106
|
+
- lib/anycable/rails/rubocop/cops/anycable/instance_vars.rb
|
107
|
+
- lib/anycable/rails/rubocop/cops/anycable/periodical_timers.rb
|
108
|
+
- lib/anycable/rails/rubocop/cops/anycable/stream_from.rb
|
108
109
|
- lib/anycable/rails/socket_id_tracking.rb
|
109
110
|
- lib/anycable/rails/version.rb
|
110
111
|
- lib/generators/anycable/bin/USAGE
|
File without changes
|