anycable-rails 1.1.4 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 59a60ff31ba3907089d78beaedf01b69a66ff2e7da83175dcd8e19d78bd6e9aa
4
- data.tar.gz: 1b9a709873bf7409502c2e114b9b90ae32ce94a724d5a3091d22ea8a7c86cd76
3
+ metadata.gz: 6502d9587bfab38ed0e12416741885869551926e2d8fae5282cca66ca59e97cf
4
+ data.tar.gz: 7c16519ba1a470e68fbcf0d5baaa261df245d64618277f8b4b2992821d543d1c
5
5
  SHA512:
6
- metadata.gz: 80d3114d9eb008e7dce61d772a71608f87c0c24eb60dbed31f857abbdb7271d7a13a4a1103609910e6eef51d576a761e92f8a40cc134f3ab95b314f247e60551
7
- data.tar.gz: cbd7a8c52da4ddd60023f536d99be251dee6158c0639744c0235b9876d4efcba9ab983ad9f06a0605cd187afaa34f2b2c1975c7b949a188e26d44860553cd88e
6
+ metadata.gz: dbfe72bae1b477034e32f7bb85e3c936bef3caf03db7d54cfe126e2cccbd7cc24494ec8cd7718887f9a56a41d3dab10ec24cf30ca6c7de0bd162e1658aa143f9
7
+ data.tar.gz: ba01f329e4388d4257952592f214842214432e9c211261362bf530913ace6eb3b9bc74bf2bab3e8a9446b6d7e48b9dd54a82bc44f21276506b9c743403e0afae
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 1.2.0 (2021-12-21) 🎄
6
+
7
+ - Drop Rails 5 support.
8
+
9
+ - Drop Ruby 2.6 support.
10
+
5
11
  ## 1.1.4 (2021-11-11)
6
12
 
7
13
  - Added `Connection#state_attr_accessor`. ([@palkan][])
@@ -90,8 +90,19 @@ module AnyCable
90
90
  end
91
91
  end
92
92
 
93
- ActiveSupport.on_load(:action_cable) do
93
+ if ActiveSupport::VERSION::MAJOR < 6
94
94
  # `state_attr_accessor` must be available in Action Cable
95
- ::ActionCable::Connection::Base.include(AnyCable::Rails::ConnectionState)
96
- ::ActionCable::Channel::Base.include(AnyCable::Rails::ChannelState)
95
+ ActiveSupport.on_load(:action_cable) do
96
+ ::ActionCable::Connection::Base.include(AnyCable::Rails::ConnectionState)
97
+ ::ActionCable::Channel::Base.include(AnyCable::Rails::ChannelState)
98
+ end
99
+ else
100
+ # `state_attr_accessor` must be available in Action Cable
101
+ ActiveSupport.on_load(:action_cable_connection) do
102
+ ::ActionCable::Connection::Base.include(AnyCable::Rails::ConnectionState)
103
+ end
104
+
105
+ ActiveSupport.on_load(:action_cable_channel) do
106
+ ::ActionCable::Channel::Base.include(AnyCable::Rails::ChannelState)
107
+ end
97
108
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rails
5
- VERSION = "1.1.4"
5
+ VERSION = "1.2.0"
6
6
  end
7
7
  end
@@ -24,6 +24,12 @@ module AnyCableRailsGenerators
24
24
  class_option :skip_procfile_dev,
25
25
  type: :boolean,
26
26
  desc: "Do not create Procfile.dev"
27
+ class_option :skip_jwt,
28
+ type: :boolean,
29
+ desc: "Do not install anycable-rails-jwt"
30
+ class_option :skip_install,
31
+ type: :boolean,
32
+ desc: "Do not run bundle install when adding new gems"
27
33
 
28
34
  include WithOSHelpers
29
35
 
@@ -59,7 +65,7 @@ module AnyCableRailsGenerators
59
65
  <<~SNIPPET
60
66
  # Specify AnyCable WebSocket server URL to use by JS client
61
67
  config.after_initialize do
62
- config.action_cable.url = ActionCable.server.config.url = ENV.fetch("CABLE_URL") if AnyCable::Rails.enabled?
68
+ config.action_cable.url = ActionCable.server.config.url = ENV.fetch("CABLE_URL", "/cable") if AnyCable::Rails.enabled?
63
69
  end
64
70
  SNIPPET
65
71
  end
@@ -129,6 +135,16 @@ module AnyCableRailsGenerators
129
135
  say_status :help, "⚠️ Please, take a look at the icompatibilities above and fix them. See #{DOCS_ROOT}/rails/compatibility" unless res
130
136
  end
131
137
 
138
+ def jwt
139
+ return if options[:skip_jwt]
140
+
141
+ return unless options[:skip_jwt] == false || yes?("Do you want to use JWT for authentication? [Yn]")
142
+
143
+ opts = " --skip-install" if options[:skip_install]
144
+
145
+ run "bundle add anycable-rails-jwt#{opts}"
146
+ end
147
+
132
148
  def finish
133
149
  say_status :info, "✅ AnyCable has been configured successfully!"
134
150
  end
@@ -172,7 +188,7 @@ module AnyCableRailsGenerators
172
188
  say <<~YML
173
189
  ─────────────────────────────────────────
174
190
  ws:
175
- image: anycable/anycable-go:1.0
191
+ image: anycable/anycable-go:1.2
176
192
  ports:
177
193
  - '8080:8080'
178
194
  environment:
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.1.4
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-11 00:00:00.000000000 Z
11
+ date: 2021-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anycable
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.1'
19
+ version: 1.2.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
- version: '1.1'
26
+ version: 1.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actioncable
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '5.1'
33
+ version: '6.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '5.1'
40
+ version: '6.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: globalid
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -198,7 +198,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
198
198
  requirements:
199
199
  - - ">="
200
200
  - !ruby/object:Gem::Version
201
- version: '2.6'
201
+ version: '2.7'
202
202
  required_rubygems_version: !ruby/object:Gem::Requirement
203
203
  requirements:
204
204
  - - ">="