anycable-rails 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e22c0242186344df43946087c788317e068f63f5405692ca1c1ea20c5446d505
4
- data.tar.gz: 56eecb2616a52072c5184183e69f36c5e4a9342b7ab91fee660c9b58a8aa949d
3
+ metadata.gz: 12096ddf13bcb4893853e537017bc5478c8c65c7f8aea4a21af221d5e4cf1ce3
4
+ data.tar.gz: 252d1fc76c09a902229b192afd61c020503a78bf773d53a8dc2e409e1a984310
5
5
  SHA512:
6
- metadata.gz: 68139e784f62c206badffb130eff677d7267dd11066c054e2faccc73b3bdb69dda3490800e04d355c4038fdb803c47d220972a35fcf6bd8130753f658546b578
7
- data.tar.gz: f22a7128655c6ef8f73fd98baa5de443b224138d5737a77bc68aa6e82e9bd606d28eb19d73c3b9f3fbeb704b60eae6d5c8382a573a2e75b83927e047899b7a47
6
+ metadata.gz: 951b2d8c75b50dd632c7e7e49b36bf8c233d5c9d7335e0213aa5c291d4cf17bb7c9999f9bdf54bcdd2a29753d471b5b6ed3397e3403b07f7e7dba7f2d3e32a37
7
+ data.tar.gz: e1df94db573c5557784937b2a44152e2e1cb59f0fd00d8532bd539e5fe8cf80a1abbf2dd605cb3025e622fddd23f59bdeb652256859d6f41b7b4462967e190c7
@@ -2,6 +2,20 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.6.3 (2019-03-26)
6
+
7
+ - Fix connection factory reloading for development sake. ([@sponomarev][])
8
+
9
+ - Add `:anycable` subscription adapter alias. ([@sponomarev][])
10
+
11
+ - Don't set AnyCable connection factory for incompatible adapter ([@sponomarev][])
12
+
13
+ `anycable` server won't start with unpatched vanilla `ApplicationCable::Connection`.
14
+
15
+ Motivation in [#74](https://github.com/anycable/anycable-rails/issues/74).
16
+
17
+ - Fix instance detection inside complex cases in compatibility cops ([@sponomarev][])
18
+
5
19
  ## 0.6.2 (2019-01-10)
6
20
 
7
21
  - Fixed `anycable` 0.6.1 compatibility. ([@palkan][])
@@ -107,3 +121,4 @@ Ignore tagged logger features ('cause we do not have _persistent_ logger).
107
121
  [@palkan]: https://github.com/palkan
108
122
  [@alekseyl]: https://github.com/alekseyl
109
123
  [@DmitryTsepelev]: https://github.com/DmitryTsepelev
124
+ [@sponomarev]: https://github.com/sponomarev
data/README.md CHANGED
@@ -20,7 +20,7 @@ You can even use Action Cable in development and not be afraid of [compatibility
20
20
 
21
21
  ## Requirements
22
22
 
23
- - Ruby ~> 2.4;
23
+ - Ruby ~> 2.4; **NOTE:** for Ruby 2.6 use RC version of `google-protobuf` gem. In your Gemfile: `gem "google-protobuf", '>=3.7.0.rc.2'`
24
24
  - Rails ~> 5.0;
25
25
  - Redis (see [other options]() for broadcasting)
26
26
 
@@ -47,7 +47,7 @@ Next, specify AnyCable subscription adapter for Action Cable:
47
47
  ```yml
48
48
  # config/cable.yml
49
49
  production:
50
- adapter: any_cable
50
+ adapter: any_cable # or anycable
51
51
  ```
52
52
 
53
53
  and specify AnyCable WebSocket server URL:
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "any_cable"
4
+
5
+ module ActionCable
6
+ module SubscriptionAdapter
7
+ # Aliasing adapter
8
+ Anycable = AnyCable
9
+ end
10
+ end
@@ -8,6 +8,12 @@ module AnyCable
8
8
  # Rails handler for AnyCable
9
9
  module Rails
10
10
  require "anycable/rails/railtie"
11
+
12
+ ADAPTER_ALIASES = %w[any_cable anycable].freeze
13
+
14
+ def self.compatible_adapter?(adapter)
15
+ ADAPTER_ALIASES.include?(adapter)
16
+ end
11
17
  end
12
18
  end
13
19
 
@@ -37,10 +37,10 @@ module RuboCop
37
37
 
38
38
  def find_nested_ivars(node, &block)
39
39
  node.each_child_node do |child|
40
- if child.begin_type? || child.block_type? || child.def_type?
41
- find_nested_ivars(child, &block)
42
- elsif child.ivasgn_type? || child.ivar_type?
40
+ if child.ivasgn_type? || child.ivar_type?
43
41
  yield(child)
42
+ elsif child.children.any?
43
+ find_nested_ivars(child, &block)
44
44
  end
45
45
  end
46
46
  end
@@ -4,8 +4,9 @@ module AnyCable
4
4
  module Rails
5
5
  class Railtie < ::Rails::Railtie # :nodoc:
6
6
  initializer "anycable.disable_action_cable_mount", after: "action_cable.set_configs" do |app|
7
- # Disable Action Cable when AnyCable adapter is used
8
- next unless ::ActionCable.server.config.cable&.fetch("adapter", nil) == "any_cable"
7
+ # Disable Action Cable default route when AnyCable adapter is used
8
+ adapter = ::ActionCable.server.config.cable&.fetch("adapter", nil)
9
+ next unless AnyCable::Rails.compatible_adapter?(adapter)
9
10
 
10
11
  app.config.action_cable.mount_path = nil
11
12
  end
@@ -39,13 +40,16 @@ module AnyCable
39
40
  AnyCable.middleware.use(AnyCable::Rails::Middlewares::Executor.new(executor))
40
41
  end
41
42
 
42
- initializer "anycable.connection_factory", after: "action_cable.set_configs" do |_app|
43
+ initializer "anycable.connection_factory", after: "action_cable.set_configs" do |app|
43
44
  ActiveSupport.on_load(:action_cable) do
44
- if ::ActionCable.server.config.cable&.fetch("adapter", nil) == "any_cable"
45
+ adapter = ::ActionCable.server.config.cable&.fetch("adapter", nil)
46
+ if AnyCable::Rails.compatible_adapter?(adapter)
45
47
  require "anycable/rails/actioncable/connection"
46
- end
47
48
 
48
- AnyCable.connection_factory = connection_class.call
49
+ app.config.to_prepare do
50
+ AnyCable.connection_factory = ActionCable.server.config.connection_class.call
51
+ end
52
+ end
49
53
  end
50
54
  end
51
55
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module AnyCable
4
4
  module Rails
5
- VERSION = "0.6.2"
5
+ VERSION = "0.6.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anycable-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-10 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: anycable
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.6.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.6.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rails
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -25,33 +39,33 @@ dependencies:
25
39
  - !ruby/object:Gem::Version
26
40
  version: '5'
27
41
  - !ruby/object:Gem::Dependency
28
- name: anycable
42
+ name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "~>"
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: 0.6.0
34
- type: :runtime
47
+ version: '1.10'
48
+ type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "~>"
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: 0.6.0
54
+ version: '1.10'
41
55
  - !ruby/object:Gem::Dependency
42
- name: bundler
56
+ name: pry-byebug
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '1'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '1'
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: rake
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -81,19 +95,19 @@ dependencies:
81
95
  - !ruby/object:Gem::Version
82
96
  version: '3.4'
83
97
  - !ruby/object:Gem::Dependency
84
- name: sqlite3
98
+ name: rubocop
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - ">="
101
+ - - "~>"
88
102
  - !ruby/object:Gem::Version
89
- version: '0'
103
+ version: 0.60.0
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - ">="
108
+ - - "~>"
95
109
  - !ruby/object:Gem::Version
96
- version: '0'
110
+ version: 0.60.0
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: simplecov
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -109,33 +123,19 @@ dependencies:
109
123
  - !ruby/object:Gem::Version
110
124
  version: 0.3.8
111
125
  - !ruby/object:Gem::Dependency
112
- name: rubocop
126
+ name: sqlite3
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
129
  - - "~>"
116
130
  - !ruby/object:Gem::Version
117
- version: 0.60.0
131
+ version: 1.3.6
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
136
  - - "~>"
123
137
  - !ruby/object:Gem::Version
124
- version: 0.60.0
125
- - !ruby/object:Gem::Dependency
126
- name: pry-byebug
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: 1.3.6
139
139
  description: Rails adapter for AnyCable
140
140
  email:
141
141
  - dementiev.vm@gmail.com
@@ -143,24 +143,11 @@ executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".github/ISSUE_TEMPLATE.md"
147
- - ".github/PULL_REQUEST_TEMPLATE.md"
148
- - ".gitignore"
149
- - ".hound.yml"
150
- - ".rubocop.yml"
151
- - ".travis.yml"
152
146
  - CHANGELOG.md
153
- - Gemfile
154
147
  - MIT-LICENSE
155
148
  - README.md
156
- - Rakefile
157
- - anycable-rails.gemspec
158
- - bin/console
159
- - bin/setup
160
- - circle.yml
161
- - gemfiles/rails5.gemfile
162
- - gemfiles/railsmaster.gemfile
163
149
  - lib/action_cable/subscription_adapter/any_cable.rb
150
+ - lib/action_cable/subscription_adapter/anycable.rb
164
151
  - lib/anycable-rails.rb
165
152
  - lib/anycable/rails.rb
166
153
  - lib/anycable/rails/actioncable/channel.rb
@@ -197,8 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
184
  - !ruby/object:Gem::Version
198
185
  version: '0'
199
186
  requirements: []
200
- rubyforge_project:
201
- rubygems_version: 2.7.6
187
+ rubygems_version: 3.0.2
202
188
  signing_key:
203
189
  specification_version: 4
204
190
  summary: Rails adapter for AnyCable
@@ -1,29 +0,0 @@
1
- <!--
2
- First of all, thanks for your report/suggestion/whatever!
3
-
4
- This template is for bug reports. If you are reporting a bug, please continue on. If you are here for another reason,
5
- feel free to skip the rest of this template.
6
- -->
7
-
8
- ### Tell us about your environment
9
-
10
- **Ruby version:**
11
-
12
- **Rails version:**
13
-
14
- **`anycable` gem version:**
15
-
16
- **`anycable-rails` gem version:**
17
-
18
- **`grpc` gem version:**
19
-
20
- ### What did you do?
21
-
22
- ### What did you expect to happen?
23
-
24
- ### What actually happened?
25
-
26
- <!--
27
- Please, provide reproduction script (using this template (https://github.com/anycable/anycable/blob/master/etc/bug_report_template.rb)
28
- when submitting bugs if possible.
29
- -->
@@ -1,31 +0,0 @@
1
- <!--
2
- First of all, thanks for contributing!
3
-
4
- If it's a typo fix or minor documentation update feel free to skip the rest of this template!
5
- -->
6
-
7
- <!--
8
- If it's a bug fix, then link it to the issue, for example:
9
-
10
- Fixes #xxx
11
- -->
12
-
13
-
14
- <!--
15
- Otherwise, describe the changes:
16
-
17
- ### What is the purpose of this pull request?
18
-
19
- ### What changes did you make? (overview)
20
-
21
- ### Is there anything you'd like reviewers to focus on?
22
-
23
- -->
24
-
25
- <!--
26
- Please ensure your PR is ready:
27
-
28
- - Include tests for this change
29
- - Add Changelog entry
30
- - Update documentation for this change (if appropriate)
31
- -->
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/.hound.yml DELETED
@@ -1,3 +0,0 @@
1
- ruby:
2
- enabled: true
3
- config_file: .rubocop.yml
@@ -1,73 +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
- - 'tmp/**/*'
10
- - 'lib/anycable/rpc/**/*'
11
- - 'vendor/**/*'
12
- - 'gemfiles/**/*'
13
- - 'Gemfile'
14
- - 'Rakefile'
15
- - '*.gemspec'
16
- DisplayCopNames: true
17
- StyleGuideCopsOnly: false
18
- TargetRubyVersion: 2.4
19
-
20
- Rails:
21
- Enabled: false
22
-
23
- Style/Documentation:
24
- Exclude:
25
- - 'spec/**/*.rb'
26
-
27
- Naming/FileName:
28
- Exclude:
29
- - 'lib/anycable-rails.rb'
30
-
31
- Style/StringLiterals:
32
- EnforcedStyle: double_quotes
33
-
34
- Style/RegexpLiteral:
35
- Enabled: false
36
-
37
- Style/FormatStringToken:
38
- Enabled: false
39
-
40
- Layout/SpaceInsideStringInterpolation:
41
- EnforcedStyle: no_space
42
-
43
- Style/BlockDelimiters:
44
- Exclude:
45
- - 'spec/**/*.rb'
46
-
47
- Metrics/MethodLength:
48
- Exclude:
49
- - 'spec/**/*.rb'
50
-
51
- Metrics/LineLength:
52
- Max: 100
53
- Exclude:
54
- - 'spec/**/*.rb'
55
-
56
- Metrics/AbcSize:
57
- Exclude:
58
- - 'spec/**/*.rb'
59
-
60
- Metrics/BlockLength:
61
- Exclude:
62
- - 'spec/**/*.rb'
63
-
64
- Metrics/CyclomaticComplexity:
65
- Exclude:
66
- - 'spec/**/*.rb'
67
-
68
- Metrics/PerceivedComplexity:
69
- Exclude:
70
- - 'spec/**/*.rb'
71
-
72
- Lint/HandleExceptions:
73
- Enabled: false
@@ -1,21 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- notifications:
5
- email: false
6
-
7
- before_install: gem install bundler -v '~> 1'
8
-
9
- matrix:
10
- include:
11
- - rvm: 2.4.5
12
- gemfile: Gemfile
13
- - rvm: 2.5.3
14
- gemfile: Gemfile
15
- - rvm: 2.5.3
16
- gemfile: gemfiles/rails5.gemfile
17
- - rvm: 2.5.3
18
- gemfile: gemfiles/railsmaster.gemfile
19
- allow_failures:
20
- - rvm: 2.5.3
21
- gemfile: gemfiles/railsmaster.gemfile
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- local_gemfile = "#{File.dirname(__FILE__)}/Gemfile.local"
6
-
7
- if File.exist?(local_gemfile)
8
- eval(File.read(local_gemfile)) # rubocop:disable Lint/Eval
9
- end
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
- require "rubocop/rake_task"
4
-
5
- RuboCop::RakeTask.new
6
-
7
- desc "Run compatibility specs"
8
- RSpec::Core::RakeTask.new("spec:compatibility") do |task|
9
- task.pattern = "spec/**/*_compatibility.rb"
10
- task.verbose = false
11
- end
12
-
13
- task default: %w[rubocop spec:compatibility spec]
@@ -1,31 +0,0 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path('../lib', __FILE__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'anycable/rails/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = "anycable-rails"
9
- spec.version = AnyCable::Rails::VERSION
10
- spec.authors = ["palkan"]
11
- spec.email = ["dementiev.vm@gmail.com"]
12
-
13
- spec.summary = "Rails adapter for AnyCable"
14
- spec.description = "Rails adapter for AnyCable"
15
- spec.homepage = "http://github.com/anycable/anycable-rails"
16
- spec.license = "MIT"
17
-
18
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_dependency "rails", ">= 5"
22
- spec.add_dependency "anycable", "~> 0.6.0"
23
-
24
- spec.add_development_dependency "bundler", "~> 1"
25
- spec.add_development_dependency "rake", "~> 10.0"
26
- spec.add_development_dependency "rspec", ">= 3.4"
27
- spec.add_development_dependency "sqlite3"
28
- spec.add_development_dependency "simplecov", ">= 0.3.8"
29
- spec.add_development_dependency "rubocop", "~> 0.60.0"
30
- spec.add_development_dependency "pry-byebug"
31
- end
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "rails"
5
- require "anycable/rails"
6
-
7
- require "pry"
8
- Pry.start
data/bin/setup DELETED
@@ -1,6 +0,0 @@
1
- #!/bin/sh
2
-
3
- set -e
4
-
5
- gem install bundler --conservative
6
- bundle check || bundle install
data/circle.yml DELETED
@@ -1,8 +0,0 @@
1
- machine:
2
- ruby:
3
- version: 2.3.0
4
-
5
- dependencies:
6
- pre:
7
- - gem install bundler -v 1.11.2
8
-
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', '~> 5.0'
4
- gem 'rspec-rails', '~> 3.5'
5
-
6
- gemspec path: '..'
@@ -1,6 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gem 'rails', github: 'rails/rails'
4
- gem 'rspec-rails', '~> 3.5.0'
5
-
6
- gemspec path: '..'