anycable-rails 1.3.7 → 1.4.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 +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/anycable/rails/compatibility.rb +1 -0
- data/lib/anycable/rails/config.rb +3 -1
- data/lib/anycable/rails/middlewares/executor.rb +12 -2
- data/lib/anycable/rails/railtie.rb +14 -1
- data/lib/anycable/rails/version.rb +1 -1
- data/lib/generators/anycable/download/download_generator.rb +2 -0
- data/lib/generators/anycable/with_os_helpers.rb +1 -1
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da6dd37a3736867b489ceabcc4ed290550fe5736cbf10ad19d6b2e2b0721297d
|
4
|
+
data.tar.gz: d6b8401fc9938ba87d9e19e878dc58a618271f5bffd99da83398b3a5b1403e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67891351a6bb37e4c69e4d81ca51a3cbafeb07ced7d7607c08691ddd33c4dbe4b2bf18231826db85632937313a2d76a35945c59cb2a94f68ad37ac88735dce78
|
7
|
+
data.tar.gz: ca63fd1ec1c346777882434870dc01e9ef35f9fe82ae428c23d4ad481b201eb4f0f726c1e5a50045ffbaf84b7fd94b1adbdcf4640f5e70b3d3b4d2ec8c1ed935
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 1.4.0 (2023-07-07)
|
6
|
+
|
7
|
+
- Add HTTP RPC integration. ([@palkan][])
|
8
|
+
|
9
|
+
Specify `http_rpc_mounth_path` in your `anycable.yml` to enable HTTP RPC.
|
10
|
+
|
11
|
+
- Fix `anycable:download` command. ([@palkan][])
|
12
|
+
|
13
|
+
Detect MacOS arm64, create target bin path if it doesn't exist.
|
14
|
+
|
5
15
|
## 1.3.7 (2023-02-28)
|
6
16
|
|
7
17
|
- Fix `anycable` gem dependency constraints.
|
@@ -9,9 +9,11 @@ require "anyway/rails"
|
|
9
9
|
# - `access_logs_disabled` (defaults to true) — whether to print Started/Finished logs
|
10
10
|
# - `persistent_session_enabled` (defaults to false) — whether to store session changes in the connection state
|
11
11
|
# - `embedded` (defaults to false) — whether to run RPC server inside a Rails server process
|
12
|
+
# - `http_rpc_mount_path` (default to nil) — path to mount HTTP RPC server
|
12
13
|
AnyCable::Config.attr_config(
|
13
14
|
access_logs_disabled: true,
|
14
15
|
persistent_session_enabled: false,
|
15
|
-
embedded: false
|
16
|
+
embedded: false,
|
17
|
+
http_rpc_mount_path: nil
|
16
18
|
)
|
17
19
|
AnyCable::Config.ignore_options :access_logs_disabled, :persistent_session_enabled
|
@@ -12,8 +12,18 @@ module AnyCable
|
|
12
12
|
@executor = executor
|
13
13
|
end
|
14
14
|
|
15
|
-
def call(
|
16
|
-
|
15
|
+
def call(method, message, metadata)
|
16
|
+
if ::Rails.respond_to?(:error)
|
17
|
+
executor.wrap do
|
18
|
+
sid = metadata["sid"]
|
19
|
+
|
20
|
+
::Rails.error.record(context: {method: method, payload: message.to_h, sid: sid}) do
|
21
|
+
yield
|
22
|
+
end
|
23
|
+
end
|
24
|
+
else
|
25
|
+
executor.wrap { yield }
|
26
|
+
end
|
17
27
|
end
|
18
28
|
end
|
19
29
|
end
|
@@ -48,7 +48,7 @@ module AnyCable
|
|
48
48
|
|
49
49
|
if app.executor.respond_to?(:error_reporter)
|
50
50
|
AnyCable.capture_exception do |ex, method, message|
|
51
|
-
::Rails.error.report(ex, handled: false, context: {method: method, payload: message})
|
51
|
+
::Rails.error.report(ex, handled: false, context: {method: method.to_sym, payload: message})
|
52
52
|
end
|
53
53
|
end
|
54
54
|
end
|
@@ -65,6 +65,19 @@ module AnyCable
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
initializer "anycable.routes" do
|
69
|
+
next unless AnyCable::Rails.enabled?
|
70
|
+
|
71
|
+
config.after_initialize do |app|
|
72
|
+
config = AnyCable.config
|
73
|
+
unless config.http_rpc_mount_path.nil?
|
74
|
+
app.routes.prepend do
|
75
|
+
mount AnyCable::HTTRPC::Server.new => config.http_rpc_mount_path, :internal => true
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
68
81
|
# Since Rails 6.1
|
69
82
|
if respond_to?(:server)
|
70
83
|
server do
|
@@ -61,6 +61,8 @@ module AnyCableRailsGenerators
|
|
61
61
|
def download_exe(url, to:, file_name:)
|
62
62
|
file_path = File.join(to, file_name)
|
63
63
|
|
64
|
+
FileUtils.mkdir_p(to) unless File.directory?(to)
|
65
|
+
|
64
66
|
run "#{sudo(to)}curl -L #{url} -o #{file_path}", abort_on_failure: true
|
65
67
|
run "#{sudo(to)}chmod +x #{file_path}", abort_on_failure: true
|
66
68
|
run "#{file_path} -v", abort_on_failure: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anycable-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: anycable
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.4'
|
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
|
-
version: 1.
|
26
|
+
version: '1.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actioncable
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,34 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: simplecov-lcov
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
139
167
|
description: Rails adapter for AnyCable
|
140
168
|
email:
|
141
169
|
- dementiev.vm@gmail.com
|
@@ -205,7 +233,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
233
|
- !ruby/object:Gem::Version
|
206
234
|
version: '0'
|
207
235
|
requirements: []
|
208
|
-
rubygems_version: 3.4.
|
236
|
+
rubygems_version: 3.4.8
|
209
237
|
signing_key:
|
210
238
|
specification_version: 4
|
211
239
|
summary: Rails adapter for AnyCable
|