pubnub 3.7.0 → 3.7.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of pubnub might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.txt +3 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +7 -3
- data/README.md +3 -3
- data/lib/pubnub.rb +2 -0
- data/lib/pubnub/client.rb +32 -32
- data/lib/pubnub/crypto.rb +5 -5
- data/lib/pubnub/event.rb +70 -60
- data/lib/pubnub/events/here_now.rb +1 -1
- data/lib/pubnub/events/leave.rb +4 -4
- data/lib/pubnub/events/publish.rb +2 -2
- data/lib/pubnub/exceptions.rb +2 -2
- data/lib/pubnub/version.rb +1 -1
- data/spec/lib/channel_presence_concat_pam_spec.rb +2 -2
- data/spec/lib/eof_error_spec.rb +2 -2
- data/spec/lib/integration/audit_dpc_spec.rb +2 -2
- data/spec/lib/integration/audit_spec.rb +2 -2
- data/spec/lib/integration/global_here_now_dpc_spec.rb +2 -2
- data/spec/lib/integration/global_here_now_spec.rb +2 -2
- data/spec/lib/integration/grant_dpc_spec.rb +2 -2
- data/spec/lib/integration/grant_spec.rb +2 -2
- data/spec/lib/integration/here_now_dpc_spec.rb +2 -2
- data/spec/lib/integration/here_now_spec.rb +2 -2
- data/spec/lib/integration/history_dpc_spec.rb +2 -2
- data/spec/lib/integration/history_spec.rb +2 -2
- data/spec/lib/integration/leave_dpc_spec.rb +2 -2
- data/spec/lib/integration/leave_spec.rb +2 -2
- data/spec/lib/integration/presence_dpc_spec.rb +2 -2
- data/spec/lib/integration/presence_spec.rb +2 -2
- data/spec/lib/integration/publish_spec_old.rb +2 -2
- data/spec/lib/integration/revoke_dpc_spec.rb +2 -2
- data/spec/lib/integration/revoke_spec.rb +2 -2
- data/spec/lib/integration/state_spec.rb +2 -2
- data/spec/lib/integration/subscribe_dpc_spec.rb +2 -2
- data/spec/lib/integration/subscribe_spec.rb +2 -2
- data/spec/lib/integration/time_dpc_spec.rb +2 -2
- data/spec/lib/integration/time_spec.rb +2 -2
- data/spec/lib/integration/v3_presence_dpc_spec.rb +2 -2
- data/spec/lib/integration/v3_presence_spec.rb +2 -2
- data/spec/lib/integration/where_now_spec.rb +2 -2
- metadata +2 -2
data/lib/pubnub/events/leave.rb
CHANGED
@@ -24,20 +24,20 @@ module Pubnub
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def fire(app)
|
27
|
-
|
27
|
+
Pubnub.logger.debug(:pubnub){"Pubnub::Leave#fire"}
|
28
28
|
unless @left
|
29
29
|
app.update_timetoken(0)
|
30
30
|
if app.env[:subscriptions][@origin].nil?
|
31
|
-
|
31
|
+
Pubnub.logger.error(:pubnub){'There\'s no subscription for that origin'}
|
32
32
|
raise ArgumentError.new(:object => self, :message => 'You cannot leave channel that is not subscribed')
|
33
33
|
else
|
34
34
|
@channel.each do |channel|
|
35
|
-
|
35
|
+
Pubnub.logger.debug(:pubnub){"#{app.env[:subscriptions][@origin].get_channels.to_s}.include? #{channel}"}
|
36
36
|
raise ArgumentError.new(:object => self, :message => 'You cannot leave channel that is not subscribed') unless app.env[:subscriptions][@origin].get_channels.include?(channel)
|
37
37
|
end
|
38
38
|
|
39
39
|
@channel_group.each do |channel_group|
|
40
|
-
|
40
|
+
Pubnub.logger.debug(:pubnub){"#{app.env[:subscriptions][@origin].get_channel_groups.to_s}.include? #{channel_group}"}
|
41
41
|
raise ArgumentError.new(:object => self, :message => 'You cannot leave channel group that is not subscribed') unless app.env[:subscriptions][@origin].get_channel_groups.include?(channel_group)
|
42
42
|
end
|
43
43
|
end unless @force
|
@@ -12,8 +12,8 @@ module Pubnub
|
|
12
12
|
@event = 'publish'
|
13
13
|
@allow_multiple_channels = false
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
Pubnub.logger.info(:pubnub){ "Bytesize: #{uri(app).to_s.bytesize}" }
|
16
|
+
Pubnub.logger.info(:pubnub){ "Length: #{uri(app).to_s.length}" }
|
17
17
|
|
18
18
|
# raise ArgumentError.new(:object => self, :message => ':message argument is too big, encoded uri would excess 32k size limit') if uri(app).to_s.bytesize > 32000
|
19
19
|
end
|
data/lib/pubnub/exceptions.rb
CHANGED
@@ -32,10 +32,10 @@ module Pubnub
|
|
32
32
|
error_message << "ERROR MESSAGE: #{@message}\n"
|
33
33
|
error_message << "ERROR BACKTRACE: #{self.backtrace}"
|
34
34
|
|
35
|
-
if
|
35
|
+
if Pubnub.logger.blank?
|
36
36
|
puts error_message
|
37
37
|
else
|
38
|
-
|
38
|
+
Pubnub.logger.error(:pubnub){error_message}
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
data/lib/pubnub/version.rb
CHANGED
@@ -11,14 +11,14 @@ describe "#grant" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
data/spec/lib/eof_error_spec.rb
CHANGED
@@ -11,14 +11,14 @@ describe 'quick eof error test' do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#audit" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#audit" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#here_now" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#here_now" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#grant" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#grant" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#here_now" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#here_now" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#history" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#history" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#leave" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#leave" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#presence" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#presence" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#publish" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#revoke" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#revoke" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -6,14 +6,14 @@ describe 'state metadata in subscribe requests' do
|
|
6
6
|
@message_output = StringIO.new
|
7
7
|
|
8
8
|
@callback = lambda { |envelope|
|
9
|
-
|
9
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
10
10
|
@response_output.write envelope.response
|
11
11
|
@message_output.write envelope.msg
|
12
12
|
@after_callback = true
|
13
13
|
}
|
14
14
|
|
15
15
|
@error_callback = lambda { |envelope|
|
16
|
-
|
16
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
17
17
|
@response_output.write envelope.response
|
18
18
|
@message_output.write envelope.msg
|
19
19
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#subscribe" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|
@@ -11,14 +11,14 @@ describe "#subscribe" do
|
|
11
11
|
@message_output = StringIO.new
|
12
12
|
|
13
13
|
@callback = lambda { |envelope|
|
14
|
-
|
14
|
+
Pubnub.logger.debug 'FIRING CALLBACK FROM TEST'
|
15
15
|
@response_output.write envelope.response
|
16
16
|
@message_output.write envelope.msg
|
17
17
|
@after_callback = true
|
18
18
|
}
|
19
19
|
|
20
20
|
@error_callback = lambda { |envelope|
|
21
|
-
|
21
|
+
Pubnub.logger.debug 'FIRING ERROR CALLBACK FROM TEST'
|
22
22
|
@response_output.write envelope.response
|
23
23
|
@message_output.write envelope.msg
|
24
24
|
@after_error_callback = true
|