pusher-fake 3.0.1 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pusher-fake/channel/presence.rb +1 -1
- data/lib/pusher-fake/server.rb +0 -9
- data/lib/pusher-fake.rb +1 -1
- data/spec/features/api/channels_spec.rb +3 -3
- data/spec/lib/pusher_fake_spec.rb +2 -2
- data/spec/spec_helper.rb +13 -0
- data/spec/support/application/public/javascripts/vendor/{pusher-7.0.0.js → pusher-7.0.6.js} +7 -5
- data/spec/support/application/views/index.erb +1 -1
- data/spec/support/capybara.rb +3 -0
- metadata +26 -27
- data/spec/support/coveralls.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d87ee628168fd524b482569791802df7bb50695dc7cfc4f74164587b3a195df
|
4
|
+
data.tar.gz: dec3b6f7071488cf6add4418fe6e9a8a18c0b778edcc2298b22e529e9f3ad3eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2ca4fc45b9710725d542a7c73324b7a995b36d896c72fb7561f5cd3544b548a26f07438896530ce60e4a1689be4bbe99cc77361747f4779b3f77b38900f9ad3
|
7
|
+
data.tar.gz: fc90fef11fb8d9d0838f3597521610a77822f3ebd84ed82554ac8dbe3098f91b6c94afdb699c8c41e47d758ecac1ea38abdb1a1a89a26e56a8753a1758bb7aff
|
@@ -36,7 +36,7 @@ module PusherFake
|
|
36
36
|
#
|
37
37
|
# @return [Hash] Hash containing presence information.
|
38
38
|
def subscription_data
|
39
|
-
hash = members.
|
39
|
+
hash = members.to_h { |_, member| [member[:user_id], member[:user_info]] }
|
40
40
|
|
41
41
|
{ presence: { hash: hash, count: members.size } }
|
42
42
|
end
|
data/lib/pusher-fake/server.rb
CHANGED
@@ -54,15 +54,6 @@ module PusherFake
|
|
54
54
|
def configuration
|
55
55
|
PusherFake.configuration
|
56
56
|
end
|
57
|
-
|
58
|
-
# Return a hash of options for the socket server based on
|
59
|
-
# the configuration.
|
60
|
-
#
|
61
|
-
# @return [Hash] The socket server configuration options.
|
62
|
-
def socket_server_options
|
63
|
-
{ host: configuration.socket_host,
|
64
|
-
port: configuration.socket_port }
|
65
|
-
end
|
66
57
|
end
|
67
58
|
end
|
68
59
|
end
|
data/lib/pusher-fake.rb
CHANGED
@@ -48,13 +48,13 @@ feature "Requesting channel API endpoint" do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
scenario "channel, with no occupants" do
|
51
|
-
expect(channel[:occupied]).to
|
51
|
+
expect(channel[:occupied]).to be(false)
|
52
52
|
end
|
53
53
|
|
54
54
|
scenario "channel, with an occupant" do
|
55
55
|
subscribe_to(channel_name)
|
56
56
|
|
57
|
-
expect(channel[:occupied]).to
|
57
|
+
expect(channel[:occupied]).to be(true)
|
58
58
|
end
|
59
59
|
|
60
60
|
scenario "channel, with info attributes" do
|
@@ -62,7 +62,7 @@ feature "Requesting channel API endpoint" do
|
|
62
62
|
|
63
63
|
result = Pusher.get("/channels/#{presence_name}", info: "user_count")
|
64
64
|
|
65
|
-
expect(result[:occupied]).to
|
65
|
+
expect(result[:occupied]).to be(true)
|
66
66
|
expect(result[:user_count]).to eq(1)
|
67
67
|
end
|
68
68
|
|
@@ -18,13 +18,13 @@ describe PusherFake, ".configuration" do
|
|
18
18
|
let(:configuration) { double }
|
19
19
|
|
20
20
|
before do
|
21
|
-
described_class.instance_variable_set(
|
21
|
+
described_class.instance_variable_set(:@configuration, nil)
|
22
22
|
|
23
23
|
allow(PusherFake::Configuration).to receive(:new).and_return(configuration)
|
24
24
|
end
|
25
25
|
|
26
26
|
after do
|
27
|
-
described_class.instance_variable_set(
|
27
|
+
described_class.instance_variable_set(:@configuration, nil)
|
28
28
|
end
|
29
29
|
|
30
30
|
it "initializes a configuration object" do
|
data/spec/spec_helper.rb
CHANGED
@@ -4,6 +4,19 @@ require "bundler/setup"
|
|
4
4
|
|
5
5
|
Bundler.require(:default, :development)
|
6
6
|
|
7
|
+
if ENV["CI"] || ENV["COVERAGE"]
|
8
|
+
require "simplecov"
|
9
|
+
require "simplecov-console"
|
10
|
+
|
11
|
+
SimpleCov.formatter = SimpleCov::Formatter::Console
|
12
|
+
SimpleCov.start do
|
13
|
+
add_filter("lib/pusher-fake/support")
|
14
|
+
add_filter("spec/support")
|
15
|
+
enable_coverage :branch
|
16
|
+
minimum_coverage line: 100, branch: 100
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
7
20
|
Dir[File.expand_path("support/**/*.rb", __dir__)].sort.each do |file|
|
8
21
|
require file
|
9
22
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Pusher JavaScript Library v7.0.
|
2
|
+
* Pusher JavaScript Library v7.0.6
|
3
3
|
* https://pusher.com/
|
4
4
|
*
|
5
5
|
* Copyright 2020, Pusher
|
@@ -388,7 +388,7 @@ exports.maxDecodedLength = function (length) {
|
|
388
388
|
exports.decodedLength = function (s) {
|
389
389
|
return stdCoder.decodedLength(s);
|
390
390
|
};
|
391
|
-
|
391
|
+
|
392
392
|
|
393
393
|
/***/ }),
|
394
394
|
/* 1 */
|
@@ -543,7 +543,7 @@ function decode(arr) {
|
|
543
543
|
return chars.join("");
|
544
544
|
}
|
545
545
|
exports.decode = decode;
|
546
|
-
|
546
|
+
|
547
547
|
|
548
548
|
/***/ }),
|
549
549
|
/* 2 */
|
@@ -558,6 +558,7 @@ module.exports = __webpack_require__(3).default;
|
|
558
558
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
559
559
|
|
560
560
|
"use strict";
|
561
|
+
// ESM COMPAT FLAG
|
561
562
|
__webpack_require__.r(__webpack_exports__);
|
562
563
|
|
563
564
|
// CONCATENATED MODULE: ./src/runtimes/web/dom/script_receiver_factory.ts
|
@@ -592,7 +593,7 @@ var ScriptReceivers = new ScriptReceiverFactory('_pusher_script_', 'Pusher.Scrip
|
|
592
593
|
|
593
594
|
// CONCATENATED MODULE: ./src/core/defaults.ts
|
594
595
|
var Defaults = {
|
595
|
-
VERSION: "7.0.
|
596
|
+
VERSION: "7.0.6",
|
596
597
|
PROTOCOL: 7,
|
597
598
|
wsPort: 80,
|
598
599
|
wssPort: 443,
|
@@ -2332,6 +2333,7 @@ var channel_Channel = (function (_super) {
|
|
2332
2333
|
this.subscriptionCancelled = false;
|
2333
2334
|
this.authorize(this.pusher.connection.socket_id, function (error, data) {
|
2334
2335
|
if (error) {
|
2336
|
+
_this.subscriptionPending = false;
|
2335
2337
|
logger.error(error.toString());
|
2336
2338
|
_this.emit('pusher:subscription_error', Object.assign({}, {
|
2337
2339
|
type: 'AuthError',
|
@@ -4531,7 +4533,7 @@ var pusher_Pusher = (function () {
|
|
4531
4533
|
}
|
4532
4534
|
else {
|
4533
4535
|
channel = this.channels.remove(channel_name);
|
4534
|
-
if (channel &&
|
4536
|
+
if (channel && channel.subscribed) {
|
4535
4537
|
channel.unsubscribe();
|
4536
4538
|
}
|
4537
4539
|
}
|
@@ -14,7 +14,7 @@
|
|
14
14
|
</section>
|
15
15
|
|
16
16
|
<script src="/javascripts/vendor/polyfill.min.js"></script>
|
17
|
-
<script src="/javascripts/vendor/pusher-7.0.
|
17
|
+
<script src="/javascripts/vendor/pusher-7.0.6.js"></script>
|
18
18
|
<script>
|
19
19
|
Pusher.instance = <%= PusherFake.javascript %>;
|
20
20
|
Pusher.instance.connection.bind("state_change", function(states) {
|
data/spec/support/capybara.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pusher-fake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Dunn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-http-request
|
@@ -72,28 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: 3.36.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: 3.36.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: puma
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 5.4
|
89
|
+
version: 5.6.4
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 5.4
|
96
|
+
version: 5.6.4
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pusher
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,42 +128,42 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - '='
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 3.
|
131
|
+
version: 3.11.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - '='
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 3.
|
138
|
+
version: 3.11.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rubocop
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - '='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.26.1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.26.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: rubocop-performance
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - '='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.13.3
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - '='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.13.3
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rubocop-rake
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,56 +184,56 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - '='
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version: 2.
|
187
|
+
version: 2.9.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - '='
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version: 2.
|
194
|
+
version: 2.9.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: selenium-webdriver
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
198
198
|
requirements:
|
199
199
|
- - '='
|
200
200
|
- !ruby/object:Gem::Version
|
201
|
-
version:
|
201
|
+
version: 4.1.0
|
202
202
|
type: :development
|
203
203
|
prerelease: false
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
206
|
- - '='
|
207
207
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
208
|
+
version: 4.1.0
|
209
209
|
- !ruby/object:Gem::Dependency
|
210
210
|
name: sinatra
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
212
212
|
requirements:
|
213
213
|
- - '='
|
214
214
|
- !ruby/object:Gem::Version
|
215
|
-
version: 2.
|
215
|
+
version: 2.2.0
|
216
216
|
type: :development
|
217
217
|
prerelease: false
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
219
219
|
requirements:
|
220
220
|
- - '='
|
221
221
|
- !ruby/object:Gem::Version
|
222
|
-
version: 2.
|
222
|
+
version: 2.2.0
|
223
223
|
- !ruby/object:Gem::Dependency
|
224
224
|
name: yard
|
225
225
|
requirement: !ruby/object:Gem::Requirement
|
226
226
|
requirements:
|
227
227
|
- - '='
|
228
228
|
- !ruby/object:Gem::Version
|
229
|
-
version: 0.9.
|
229
|
+
version: 0.9.27
|
230
230
|
type: :development
|
231
231
|
prerelease: false
|
232
232
|
version_requirements: !ruby/object:Gem::Requirement
|
233
233
|
requirements:
|
234
234
|
- - '='
|
235
235
|
- !ruby/object:Gem::Version
|
236
|
-
version: 0.9.
|
236
|
+
version: 0.9.27
|
237
237
|
description: A fake Pusher server for development and testing.
|
238
238
|
email: hello@tristandunn.com
|
239
239
|
executables:
|
@@ -276,10 +276,9 @@ files:
|
|
276
276
|
- spec/spec_helper.rb
|
277
277
|
- spec/support/application.rb
|
278
278
|
- spec/support/application/public/javascripts/vendor/polyfill.min.js
|
279
|
-
- spec/support/application/public/javascripts/vendor/pusher-7.0.
|
279
|
+
- spec/support/application/public/javascripts/vendor/pusher-7.0.6.js
|
280
280
|
- spec/support/application/views/index.erb
|
281
281
|
- spec/support/capybara.rb
|
282
|
-
- spec/support/coveralls.rb
|
283
282
|
- spec/support/helpers/connect.rb
|
284
283
|
- spec/support/helpers/event.rb
|
285
284
|
- spec/support/helpers/subscription.rb
|
@@ -290,7 +289,8 @@ files:
|
|
290
289
|
homepage: https://github.com/tristandunn/pusher-fake
|
291
290
|
licenses:
|
292
291
|
- MIT
|
293
|
-
metadata:
|
292
|
+
metadata:
|
293
|
+
rubygems_mfa_required: 'true'
|
294
294
|
post_install_message:
|
295
295
|
rdoc_options: []
|
296
296
|
require_paths:
|
@@ -299,14 +299,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
299
299
|
requirements:
|
300
300
|
- - ">="
|
301
301
|
- !ruby/object:Gem::Version
|
302
|
-
version: '2.
|
302
|
+
version: '2.7'
|
303
303
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
304
304
|
requirements:
|
305
305
|
- - ">="
|
306
306
|
- !ruby/object:Gem::Version
|
307
307
|
version: '0'
|
308
308
|
requirements: []
|
309
|
-
rubygems_version: 3.
|
309
|
+
rubygems_version: 3.3.7
|
310
310
|
signing_key:
|
311
311
|
specification_version: 4
|
312
312
|
summary: A fake Pusher server for development and testing.
|
@@ -331,11 +331,10 @@ test_files:
|
|
331
331
|
- spec/lib/pusher_fake_spec.rb
|
332
332
|
- spec/spec_helper.rb
|
333
333
|
- spec/support/application/public/javascripts/vendor/polyfill.min.js
|
334
|
-
- spec/support/application/public/javascripts/vendor/pusher-7.0.
|
334
|
+
- spec/support/application/public/javascripts/vendor/pusher-7.0.6.js
|
335
335
|
- spec/support/application/views/index.erb
|
336
336
|
- spec/support/application.rb
|
337
337
|
- spec/support/capybara.rb
|
338
|
-
- spec/support/coveralls.rb
|
339
338
|
- spec/support/helpers/connect.rb
|
340
339
|
- spec/support/helpers/event.rb
|
341
340
|
- spec/support/helpers/subscription.rb
|