cable_ready 4.5.0 → 5.0.0.pre0

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.
data/Gemfile.lock CHANGED
@@ -1,67 +1,67 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cable_ready (4.5.0)
4
+ cable_ready (5.0.0.pre0)
5
5
  rails (>= 5.2)
6
6
  thread-local (>= 1.1.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actioncable (6.1.1)
12
- actionpack (= 6.1.1)
13
- activesupport (= 6.1.1)
11
+ actioncable (6.1.3.2)
12
+ actionpack (= 6.1.3.2)
13
+ activesupport (= 6.1.3.2)
14
14
  nio4r (~> 2.0)
15
15
  websocket-driver (>= 0.6.1)
16
- actionmailbox (6.1.1)
17
- actionpack (= 6.1.1)
18
- activejob (= 6.1.1)
19
- activerecord (= 6.1.1)
20
- activestorage (= 6.1.1)
21
- activesupport (= 6.1.1)
16
+ actionmailbox (6.1.3.2)
17
+ actionpack (= 6.1.3.2)
18
+ activejob (= 6.1.3.2)
19
+ activerecord (= 6.1.3.2)
20
+ activestorage (= 6.1.3.2)
21
+ activesupport (= 6.1.3.2)
22
22
  mail (>= 2.7.1)
23
- actionmailer (6.1.1)
24
- actionpack (= 6.1.1)
25
- actionview (= 6.1.1)
26
- activejob (= 6.1.1)
27
- activesupport (= 6.1.1)
23
+ actionmailer (6.1.3.2)
24
+ actionpack (= 6.1.3.2)
25
+ actionview (= 6.1.3.2)
26
+ activejob (= 6.1.3.2)
27
+ activesupport (= 6.1.3.2)
28
28
  mail (~> 2.5, >= 2.5.4)
29
29
  rails-dom-testing (~> 2.0)
30
- actionpack (6.1.1)
31
- actionview (= 6.1.1)
32
- activesupport (= 6.1.1)
30
+ actionpack (6.1.3.2)
31
+ actionview (= 6.1.3.2)
32
+ activesupport (= 6.1.3.2)
33
33
  rack (~> 2.0, >= 2.0.9)
34
34
  rack-test (>= 0.6.3)
35
35
  rails-dom-testing (~> 2.0)
36
36
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
37
- actiontext (6.1.1)
38
- actionpack (= 6.1.1)
39
- activerecord (= 6.1.1)
40
- activestorage (= 6.1.1)
41
- activesupport (= 6.1.1)
37
+ actiontext (6.1.3.2)
38
+ actionpack (= 6.1.3.2)
39
+ activerecord (= 6.1.3.2)
40
+ activestorage (= 6.1.3.2)
41
+ activesupport (= 6.1.3.2)
42
42
  nokogiri (>= 1.8.5)
43
- actionview (6.1.1)
44
- activesupport (= 6.1.1)
43
+ actionview (6.1.3.2)
44
+ activesupport (= 6.1.3.2)
45
45
  builder (~> 3.1)
46
46
  erubi (~> 1.4)
47
47
  rails-dom-testing (~> 2.0)
48
48
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
49
- activejob (6.1.1)
50
- activesupport (= 6.1.1)
49
+ activejob (6.1.3.2)
50
+ activesupport (= 6.1.3.2)
51
51
  globalid (>= 0.3.6)
52
- activemodel (6.1.1)
53
- activesupport (= 6.1.1)
54
- activerecord (6.1.1)
55
- activemodel (= 6.1.1)
56
- activesupport (= 6.1.1)
57
- activestorage (6.1.1)
58
- actionpack (= 6.1.1)
59
- activejob (= 6.1.1)
60
- activerecord (= 6.1.1)
61
- activesupport (= 6.1.1)
62
- marcel (~> 0.3.1)
63
- mimemagic (~> 0.3.2)
64
- activesupport (6.1.1)
52
+ activemodel (6.1.3.2)
53
+ activesupport (= 6.1.3.2)
54
+ activerecord (6.1.3.2)
55
+ activemodel (= 6.1.3.2)
56
+ activesupport (= 6.1.3.2)
57
+ activestorage (6.1.3.2)
58
+ actionpack (= 6.1.3.2)
59
+ activejob (= 6.1.3.2)
60
+ activerecord (= 6.1.3.2)
61
+ activesupport (= 6.1.3.2)
62
+ marcel (~> 1.0.0)
63
+ mini_mime (~> 1.0.2)
64
+ activesupport (6.1.3.2)
65
65
  concurrent-ruby (~> 1.0, >= 1.0.2)
66
66
  i18n (>= 1.6, < 2)
67
67
  minitest (>= 5.1)
@@ -70,20 +70,47 @@ GEM
70
70
  addressable (2.7.0)
71
71
  public_suffix (>= 2.0.2, < 5.0)
72
72
  ast (2.4.2)
73
+ async (1.29.0)
74
+ console (~> 1.10)
75
+ nio4r (~> 2.3)
76
+ timers (~> 4.1)
77
+ async-http (0.56.2)
78
+ async (~> 1.25)
79
+ async-io (~> 1.28)
80
+ async-pool (~> 0.2)
81
+ protocol-http (~> 0.22.0)
82
+ protocol-http1 (~> 0.14.0)
83
+ protocol-http2 (~> 0.14.0)
84
+ async-http-faraday (0.9.0)
85
+ async-http (~> 0.42)
86
+ faraday
87
+ async-io (1.31.0)
88
+ async (~> 1.14)
89
+ async-pool (0.3.6)
90
+ async (~> 1.25)
73
91
  builder (3.2.4)
74
92
  coderay (1.1.3)
75
93
  concurrent-ruby (1.1.8)
94
+ console (1.12.0)
95
+ fiber-local
76
96
  crass (1.0.6)
77
97
  erubi (1.10.0)
78
- faraday (1.3.0)
98
+ faraday (1.4.1)
99
+ faraday-excon (~> 1.1)
79
100
  faraday-net_http (~> 1.0)
101
+ faraday-net_http_persistent (~> 1.1)
80
102
  multipart-post (>= 1.2, < 3)
81
- ruby2_keywords
103
+ ruby2_keywords (>= 0.0.4)
104
+ faraday-excon (1.1.0)
82
105
  faraday-http-cache (2.2.0)
83
106
  faraday (>= 0.8)
84
107
  faraday-net_http (1.0.1)
85
- github_changelog_generator (1.15.2)
108
+ faraday-net_http_persistent (1.1.0)
109
+ fiber-local (1.0.0)
110
+ github_changelog_generator (1.16.3)
86
111
  activesupport
112
+ async (>= 1.25.0)
113
+ async-http-faraday
87
114
  faraday-http-cache
88
115
  multi_json
89
116
  octokit (~> 4.6)
@@ -92,31 +119,39 @@ GEM
92
119
  retriable (~> 3.0)
93
120
  globalid (0.4.2)
94
121
  activesupport (>= 4.2.0)
95
- i18n (1.8.7)
122
+ i18n (1.8.10)
96
123
  concurrent-ruby (~> 1.0)
97
- loofah (2.9.0)
124
+ loofah (2.9.1)
98
125
  crass (~> 1.0.2)
99
126
  nokogiri (>= 1.5.9)
100
127
  magic_frozen_string_literal (1.2.0)
101
128
  mail (2.7.1)
102
129
  mini_mime (>= 0.1.1)
103
- marcel (0.3.3)
104
- mimemagic (~> 0.3.2)
130
+ marcel (1.0.1)
105
131
  method_source (0.9.2)
106
- mimemagic (0.3.5)
107
- mini_mime (1.0.2)
108
- minitest (5.14.3)
132
+ mini_mime (1.0.3)
133
+ mini_portile2 (2.5.1)
134
+ minitest (5.14.4)
135
+ mocha (1.12.0)
109
136
  multi_json (1.15.0)
110
137
  multipart-post (2.1.1)
111
- nio4r (2.5.4)
112
- nokogiri (1.11.1-x86_64-darwin)
138
+ nio4r (2.5.7)
139
+ nokogiri (1.11.5)
140
+ mini_portile2 (~> 2.5.0)
113
141
  racc (~> 1.4)
114
- octokit (4.20.0)
142
+ octokit (4.21.0)
115
143
  faraday (>= 0.9)
116
144
  sawyer (~> 0.8.0, >= 0.5.3)
117
145
  parallel (1.20.1)
118
- parser (3.0.0.0)
146
+ parser (3.0.1.1)
119
147
  ast (~> 2.4.1)
148
+ protocol-hpack (1.4.2)
149
+ protocol-http (0.22.0)
150
+ protocol-http1 (0.14.1)
151
+ protocol-http (~> 0.22)
152
+ protocol-http2 (0.14.2)
153
+ protocol-hpack (~> 1.4)
154
+ protocol-http (~> 0.18)
120
155
  pry (0.12.2)
121
156
  coderay (~> 1.1.0)
122
157
  method_source (~> 0.9.0)
@@ -127,50 +162,50 @@ GEM
127
162
  rack (2.2.3)
128
163
  rack-test (1.1.0)
129
164
  rack (>= 1.0, < 3)
130
- rails (6.1.1)
131
- actioncable (= 6.1.1)
132
- actionmailbox (= 6.1.1)
133
- actionmailer (= 6.1.1)
134
- actionpack (= 6.1.1)
135
- actiontext (= 6.1.1)
136
- actionview (= 6.1.1)
137
- activejob (= 6.1.1)
138
- activemodel (= 6.1.1)
139
- activerecord (= 6.1.1)
140
- activestorage (= 6.1.1)
141
- activesupport (= 6.1.1)
165
+ rails (6.1.3.2)
166
+ actioncable (= 6.1.3.2)
167
+ actionmailbox (= 6.1.3.2)
168
+ actionmailer (= 6.1.3.2)
169
+ actionpack (= 6.1.3.2)
170
+ actiontext (= 6.1.3.2)
171
+ actionview (= 6.1.3.2)
172
+ activejob (= 6.1.3.2)
173
+ activemodel (= 6.1.3.2)
174
+ activerecord (= 6.1.3.2)
175
+ activestorage (= 6.1.3.2)
176
+ activesupport (= 6.1.3.2)
142
177
  bundler (>= 1.15.0)
143
- railties (= 6.1.1)
178
+ railties (= 6.1.3.2)
144
179
  sprockets-rails (>= 2.0.0)
145
180
  rails-dom-testing (2.0.3)
146
181
  activesupport (>= 4.2.0)
147
182
  nokogiri (>= 1.6)
148
183
  rails-html-sanitizer (1.3.0)
149
184
  loofah (~> 2.3)
150
- railties (6.1.1)
151
- actionpack (= 6.1.1)
152
- activesupport (= 6.1.1)
185
+ railties (6.1.3.2)
186
+ actionpack (= 6.1.3.2)
187
+ activesupport (= 6.1.3.2)
153
188
  method_source
154
189
  rake (>= 0.8.7)
155
190
  thor (~> 1.0)
156
191
  rainbow (3.0.0)
157
192
  rake (13.0.3)
158
- regexp_parser (2.0.3)
193
+ regexp_parser (2.1.1)
159
194
  retriable (3.1.2)
160
- rexml (3.2.4)
161
- rubocop (1.7.0)
195
+ rexml (3.2.5)
196
+ rubocop (1.14.0)
162
197
  parallel (~> 1.10)
163
- parser (>= 2.7.1.5)
198
+ parser (>= 3.0.0.0)
164
199
  rainbow (>= 2.2.2, < 4.0)
165
200
  regexp_parser (>= 1.8, < 3.0)
166
201
  rexml
167
- rubocop-ast (>= 1.2.0, < 2.0)
202
+ rubocop-ast (>= 1.5.0, < 2.0)
168
203
  ruby-progressbar (~> 1.7)
169
- unicode-display_width (>= 1.4.0, < 2.0)
170
- rubocop-ast (1.4.1)
171
- parser (>= 2.7.1.5)
172
- rubocop-performance (1.9.2)
173
- rubocop (>= 0.90.0, < 2.0)
204
+ unicode-display_width (>= 1.4.0, < 3.0)
205
+ rubocop-ast (1.5.0)
206
+ parser (>= 3.0.1.1)
207
+ rubocop-performance (1.11.2)
208
+ rubocop (>= 1.7.0, < 2.0)
174
209
  rubocop-ast (>= 0.4.0)
175
210
  ruby-progressbar (1.11.0)
176
211
  ruby2_keywords (0.0.4)
@@ -184,16 +219,17 @@ GEM
184
219
  actionpack (>= 4.0)
185
220
  activesupport (>= 4.0)
186
221
  sprockets (>= 3.0.0)
187
- standard (0.11.0)
188
- rubocop (= 1.7.0)
189
- rubocop-performance (= 1.9.2)
222
+ standard (1.1.1)
223
+ rubocop (= 1.14.0)
224
+ rubocop-performance (= 1.11.2)
190
225
  standardrb (1.0.0)
191
226
  standard
192
227
  thor (1.1.0)
193
228
  thread-local (1.1.0)
229
+ timers (4.3.3)
194
230
  tzinfo (2.0.4)
195
231
  concurrent-ruby (~> 1.0)
196
- unicode-display_width (1.7.0)
232
+ unicode-display_width (2.0.0)
197
233
  websocket-driver (0.7.3)
198
234
  websocket-extensions (>= 0.1.0)
199
235
  websocket-extensions (0.1.5)
@@ -206,10 +242,11 @@ DEPENDENCIES
206
242
  cable_ready!
207
243
  github_changelog_generator
208
244
  magic_frozen_string_literal
245
+ mocha
209
246
  pry
210
247
  pry-nav
211
248
  rake
212
249
  standardrb
213
250
 
214
251
  BUNDLED WITH
215
- 2.1.4
252
+ 2.2.3
data/LATEST ADDED
@@ -0,0 +1 @@
1
+ 4.5.0
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <img src="https://gitcdn.link/repo/hopsoft/cable_ready/master/assets/cable-ready-logo-with-copy.svg" width="360" />
2
+ <img src="https://gitcdn.link/repo/stimulusreflex/cable_ready/master/assets/cable-ready-logo-with-copy.svg" width="360" />
3
3
  <h1 align="center">Welcome to CableReady 👋</h1>
4
4
  <p align="center">
5
5
  <img src="https://img.shields.io/gem/v/cable_ready.svg?color=red" />
@@ -7,11 +7,11 @@
7
7
  <a href="https://www.npmjs.com/package/cable_ready">
8
8
  <img alt="downloads" src="https://img.shields.io/npm/dm/cable_ready.svg?color=blue" target="_blank" />
9
9
  </a>
10
- <a href="https://github.com/hopsoft/cable_ready/blob/master/LICENSE">
10
+ <a href="https://github.com/stimulusreflex/cable_ready/blob/master/LICENSE">
11
11
  <img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-brightgreen.svg" target="_blank" />
12
12
  </a>
13
13
  <a href="http://blog.codinghorror.com/the-best-code-is-no-code-at-all/" target="_blank">
14
- <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-663-brightgreen.svg?style=flat" />
14
+ <img alt="Lines of Code" src="https://img.shields.io/badge/lines_of_code-1203-brightgreen.svg?style=flat" />
15
15
  </a>
16
16
  <a href="https://cableready.stimulusreflex.com" target="_blank">
17
17
  <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
@@ -30,11 +30,11 @@
30
30
  <a href="https://www.codacy.com/manual/hopsoft/cable_ready/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=hopsoft/cable_ready&amp;utm_campaign=Badge_Grade" target="_blank">
31
31
  <img alt="Code Quality" src="https://app.codacy.com/project/badge/Grade/8e6971e3410347eaaa16be2555160b9c"/>
32
32
  </a>
33
- <a target="_blank" rel="noopener noreferrer" href="https://github.com/hopsoft/cable_ready/workflows/Prettier-Standard/badge.svg">
34
- <img src="https://github.com/hopsoft/cable_ready/workflows/Prettier-Standard/badge.svg" alt="Prettier-Standard" style="max-width:100%;">
33
+ <a target="_blank" rel="noopener noreferrer" href="https://github.com/stimulusreflex/cable_ready/workflows/Prettier-Standard/badge.svg">
34
+ <img src="https://github.com/stimulusreflex/cable_ready/workflows/Prettier-Standard/badge.svg" alt="Prettier-Standard" style="max-width:100%;">
35
35
  </a>
36
- <a target="_blank" rel="noopener noreferrer" href="https://github.com/hopsoft/cable_ready/workflows/StandardRB/badge.svg">
37
- <img src="https://github.com/hopsoft/cable_ready/workflows/StandardRB/badge.svg" alt="StandardRB" style="max-width:100%;">
36
+ <a target="_blank" rel="noopener noreferrer" href="https://github.com/stimulusreflex/cable_ready/workflows/StandardRB/badge.svg">
37
+ <img src="https://github.com/stimulusreflex/cable_ready/workflows/StandardRB/badge.svg" alt="StandardRB" style="max-width:100%;">
38
38
  </a>
39
39
  </p>
40
40
  </p>
@@ -48,11 +48,11 @@ to learn more about ActionCable before proceeding.
48
48
  ## 📚 Docs
49
49
 
50
50
  - [Official Documentation](https://cableready.stimulusreflex.com)
51
- - [Documentation Source Code](https://github.com/hopsoft/cable_ready/tree/master/docs)
51
+ - [Documentation Source Code](https://github.com/stimulusreflex/cable_ready/tree/master/docs)
52
52
 
53
53
  ## 💙 Community
54
54
 
55
- - [Discord](https://discord.gg/XveN625) - chat root
55
+ - [Discord](https://discord.gg/stimulus-reflex) - primary support channel
56
56
 
57
57
  ## 🚀 Install
58
58
 
data/Rakefile CHANGED
@@ -2,11 +2,17 @@
2
2
 
3
3
  require "bundler/gem_tasks"
4
4
  require "github_changelog_generator/task"
5
+ require "rake/testtask"
6
+ require "pry"
5
7
 
6
8
  task default: [:test]
7
9
 
8
- task :test do
9
- puts "Please write some tests..."
10
+ Rake::TestTask.new(:test) do |t|
11
+ t.libs << "lib"
12
+ t.libs << "test"
13
+ t.pattern = "test/**/*_test.rb"
14
+ t.verbose = true
15
+ t.warning = false
10
16
  end
11
17
 
12
18
  GitHubChangelogGenerator::RakeTask.new :changelog do |config|
data/bin/standardize CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  bundle exec magic_frozen_string_literal
4
4
  bundle exec standardrb --fix
5
- yarn run prettier-standard ./javascript/*.js
5
+ yarn format
data/cable_ready.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |gem|
8
8
  gem.version = CableReady::VERSION
9
9
  gem.authors = ["Nathan Hopkins"]
10
10
  gem.email = ["natehop@gmail.com"]
11
- gem.homepage = "https://github.com/hopsoft/cable_ready"
11
+ gem.homepage = "https://github.com/stimulusreflex/cable_ready"
12
12
  gem.summary = "Out-of-Band Server Triggered DOM Operations"
13
13
 
14
14
  gem.files = Dir["lib/**/*.rb", "app/assets/javascripts/cable_ready.js", "bin/*", "[A-Z]*"]
@@ -23,4 +23,5 @@ Gem::Specification.new do |gem|
23
23
  gem.add_development_dependency "pry-nav"
24
24
  gem.add_development_dependency "rake"
25
25
  gem.add_development_dependency "standardrb"
26
+ gem.add_development_dependency "mocha"
26
27
  end
data/lib/cable_ready.rb CHANGED
@@ -1,20 +1,52 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rails/engine"
4
+ require "open-uri"
5
+ require "active_record"
6
+ require "action_view"
4
7
  require "active_support/all"
8
+ require "thread/local"
9
+ require "monitor"
10
+ require "observer"
11
+ require "singleton"
5
12
  require "cable_ready/version"
13
+ require "cable_ready/identifiable"
14
+ require "cable_ready/operation_builder"
6
15
  require "cable_ready/config"
7
16
  require "cable_ready/broadcaster"
17
+ require "cable_ready/sanity_checker"
18
+ require "cable_ready/compoundable"
19
+ require "cable_ready/channel"
20
+ require "cable_ready/channels"
21
+ require "cable_ready/cable_car"
22
+ require "cable_ready/stream_identifier"
8
23
 
9
24
  module CableReady
10
25
  class Engine < Rails::Engine
11
- end
26
+ initializer "cable_ready.sanity_check" do
27
+ SanityChecker.check! unless Rails.env.production?
28
+ end
12
29
 
13
- def self.config
14
- CableReady::Config.instance
30
+ initializer "renderer" do
31
+ ActiveSupport.on_load(:action_controller) do
32
+ ActionController::Renderers.add :operations do |operations, options|
33
+ render json: operations.dispatch
34
+ end
35
+ end
36
+ end
15
37
  end
16
38
 
17
- def self.configure
18
- yield config
39
+ class << self
40
+ def config
41
+ CableReady::Config.instance
42
+ end
43
+
44
+ def configure
45
+ yield config
46
+ end
47
+
48
+ def signed_stream_verifier
49
+ @signed_stream_verifier ||= ActiveSupport::MessageVerifier.new(config.verifier_key, digest: "SHA256", serializer: JSON)
50
+ end
19
51
  end
20
52
  end