pubnub 3.4.1 → 3.5.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/.gitignore +1 -0
- data/CHANGELOG +5 -3
- data/README.md +267 -41
- data/VERSION +1 -1
- data/examples/demo_console.rb +191 -32
- data/examples/demo_console.rb~ +307 -0
- data/examples/pubnub_livestream/Gemfile +1 -1
- data/examples/pubnub_livestream/Gemfile.lock +43 -74
- data/examples/serial_publish.rb +2 -6
- data/fixtures/vcr_cassettes/audit-nonssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-block-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-nonssl-parameter-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-block-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/audit-ssl-parameter-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-many-channels-array.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-many-channels-hash.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-many-channels-integer.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-many-channels-mix.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-many-channels-multi-mix.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-many-channels-string.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-one-channel-array.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-one-channel-hash.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-one-channel-integer.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-one-channel-mix.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-cipherkey-one-channel-string.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-many-channels-array.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-many-channels-hash.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-many-channels-integer.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-many-channels-mix.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-many-channels-multi-mix.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-many-channels-string.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-one-channel-array.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-one-channel-hash.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-one-channel-integer.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-one-channel-mix.yml +89 -0
- data/fixtures/vcr_cassettes/formatting-envelope-subscribe-without-cipherkey-one-channel-string.yml +89 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-block-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-nonssl-parameter-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-block-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/grant-ssl-parameter-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-block-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-nonssl-parameter-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-block-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/here_now-ssl-parameter-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-block-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-nonssl-parameter-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-block-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/history-ssl-parameter-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-block-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-nonssl-parameter-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-block-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-invalid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-invalid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-invalid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-invalid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-non-200-async.yml +48 -0
- data/fixtures/vcr_cassettes/leave-ssl-parameter-valid-non-200-sync.yml +48 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-array-of-hashes.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-auth_key-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-auth_key-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-auth_key-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-auth_key-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-http-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-auth_key-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-auth_key-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-auth_key-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-auth_key-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-encrypted-https-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-auth_key-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-auth_key-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-auth_key-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-auth_key-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-http-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-auth_key-200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-auth_key-200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-auth_key-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-auth_key-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-non200-invalid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-https-non200-valid.yml +42 -0
- data/fixtures/vcr_cassettes/new_ones/publish/publish-plain-array-of-hashes.yml +42 -0
- data/fixtures/vcr_cassettes/pam1.yml +35 -0
- data/fixtures/vcr_cassettes/pam10.yml +35 -0
- data/fixtures/vcr_cassettes/pam11.yml +35 -0
- data/fixtures/vcr_cassettes/pam12.yml +35 -0
- data/fixtures/vcr_cassettes/pam13.yml +35 -0
- data/fixtures/vcr_cassettes/pam14.yml +35 -0
- data/fixtures/vcr_cassettes/pam15.yml +35 -0
- data/fixtures/vcr_cassettes/pam17.yml +35 -0
- data/fixtures/vcr_cassettes/pam2.yml +35 -0
- data/fixtures/vcr_cassettes/pam20.yml +35 -0
- data/fixtures/vcr_cassettes/pam21.yml +35 -0
- data/fixtures/vcr_cassettes/pam22.yml +97 -0
- data/fixtures/vcr_cassettes/pam4.yml +35 -0
- data/fixtures/vcr_cassettes/pam5.yml +66 -0
- data/fixtures/vcr_cassettes/pam6.yml +96 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-valid-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-valid-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-valid-non-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-block-valid-non-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-valid-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-valid-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-valid-non-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-nonssl-parameter-valid-non-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-valid-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-valid-200-sync-new.yml +81 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-valid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-valid-non-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-block-valid-non-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-valid-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-valid-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-valid-non-200-async.yml +87 -0
- data/fixtures/vcr_cassettes/presence-ssl-parameter-valid-non-200-sync.yml +87 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-block-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-nonssl-parameter-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-block-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/publish-ssl-parameter-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-block-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-nonssl-parameter-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-block-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-valid-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-valid-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-valid-non-200-async.yml +45 -0
- data/fixtures/vcr_cassettes/revoke-ssl-parameter-valid-non-200-sync.yml +45 -0
- data/fixtures/vcr_cassettes/single-event-invalid-json.yml +208 -0
- data/fixtures/vcr_cassettes/single-event-non200.yml +44 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-valid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-valid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-valid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-block-valid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-valid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-valid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-valid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-nonssl-parameter-valid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-valid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-valid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-valid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-block-valid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-invalid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-invalid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-invalid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-invalid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-valid-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-valid-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-valid-non-200-async.yml +85 -0
- data/fixtures/vcr_cassettes/subscribe-ssl-parameter-valid-non-200-sync.yml +85 -0
- data/fixtures/vcr_cassettes/subscription-event-invalid-json.yml +454 -0
- data/fixtures/vcr_cassettes/subscription-event-non200.yml +208 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-block-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-nonssl-parameter-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-block-valid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-invalid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-invalid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-invalid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-invalid-non-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-valid-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-valid-200-sync.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-valid-non-200-async.yml +44 -0
- data/fixtures/vcr_cassettes/time-ssl-parameter-valid-non-200-sync.yml +44 -0
- data/lib/pubnub.rb +7 -15
- data/lib/pubnub/client.rb +189 -468
- data/lib/pubnub/configuration.rb +27 -20
- data/lib/pubnub/crypto.rb +11 -4
- data/lib/pubnub/envelope.rb +45 -0
- data/lib/pubnub/event.rb +470 -0
- data/lib/pubnub/events/audit.rb +38 -0
- data/lib/pubnub/events/grant.rb +59 -0
- data/lib/pubnub/events/here_now.rb +55 -0
- data/lib/pubnub/events/history.rb +110 -0
- data/lib/pubnub/events/leave.rb +73 -0
- data/lib/pubnub/events/presence.rb +35 -0
- data/lib/pubnub/events/publish.rb +71 -0
- data/lib/pubnub/events/revoke.rb +56 -0
- data/lib/pubnub/events/subscribe.rb +34 -0
- data/lib/pubnub/events/time.rb +52 -0
- data/lib/pubnub/exceptions.rb +50 -0
- data/lib/pubnub/formatter.rb +45 -0
- data/lib/pubnub/pam.rb +59 -0
- data/lib/pubnub/parser.rb +21 -0
- data/lib/pubnub/validator.rb +29 -0
- data/lib/version.rb +3 -0
- data/pubnub.gemspec +3 -5
- data/spec/lib/client_spec.rb +27 -325
- data/spec/lib/encoder_spec.rb +51 -0
- data/spec/lib/formatting_envelope_spec.rb +304 -0
- data/spec/lib/integration/audit_spec.rb +544 -0
- data/spec/lib/integration/grant_spec.rb +544 -0
- data/spec/lib/integration/here_now_spec.rb +543 -0
- data/spec/lib/integration/history_spec.rb +541 -0
- data/spec/lib/integration/leave_spec.rb +540 -0
- data/spec/lib/integration/presence_spec.rb +557 -0
- data/spec/lib/integration/publish_spec.rb +541 -0
- data/spec/lib/integration/revoke_spec.rb +544 -0
- data/spec/lib/integration/subscribe_spec.rb +564 -0
- data/spec/lib/integration/time_spec.rb +541 -0
- data/spec/lib/new_integration/publish_spec.rb +1867 -0
- data/spec/lib/retry_logic_spec.rb +53 -0
- data/spec/spec_helper.rb +28 -2
- data/spec/tools/pam-test-generator.rb +367 -0
- data/spec/tools/test-generator.rb +310 -0
- metadata +434 -50
- data/.yardoc/checksums +0 -13
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/pubnub/error.rb +0 -23
- data/lib/pubnub/request.rb +0 -288
- data/lib/pubnub/response.rb +0 -126
- data/lib/pubnub/subscription.rb +0 -24
- data/lib/pubnub/version.rb +0 -3
- data/lib/tasks/examples.rake +0 -39
- data/spec/lib/crypto_spec.rb +0 -89
- data/spec/lib/history_integration_spec.rb +0 -0
- data/spec/lib/presence_integration_spec.rb +0 -16
- data/spec/lib/publish_integration_spec.rb +0 -994
- data/spec/lib/pubnub_spec.rb +0 -12
- data/spec/lib/request_spec.rb +0 -151
- data/spec/lib/subscribe_integration_spec.rb +0 -944
- data/spec/lib/subscribe_timeout_spec.rb +0 -65
- data/spec/lib/time_integration_spec.rb +0 -0
data/lib/pubnub/configuration.rb
CHANGED
@@ -1,25 +1,32 @@
|
|
1
1
|
module Pubnub
|
2
2
|
module Configuration
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
3
|
+
DEFAULT_ERROR_CALLBACK = lambda { |err| puts err.inspect }
|
4
|
+
DEFAULT_CONNECT_CALLBACK = lambda { |msg| puts msg.inspect }
|
5
|
+
DEFAULT_SSL = false
|
6
|
+
DEFAULT_CONNECTION_PORT = 80
|
7
|
+
DEFAULT_NON_SUBSCRIBE_TIMEOUT = 310
|
8
|
+
DEFAULT_SUBSCRIBE_TIMEOUT = 310
|
9
|
+
DEFAULT_RECONNECT_ATTEMPTS = 10
|
10
|
+
DEFAULT_RECONNECT_INTERVAL = 10
|
11
|
+
DEFAULT_RECONNECT_RESPONSE_TIMEOUT = 10
|
12
|
+
DEFAULT_TIMETOKEN = 0
|
13
|
+
DEFAULT_ORIGIN = 'pubsub.pubnub.com'
|
14
|
+
DEFAULT_PORT = 80
|
15
|
+
DEFAULT_METHOD = 'GET'
|
16
|
+
DEFAULT_CONTENT_TYPE = 'application/json'
|
17
|
+
DEFAULT_PATH = '/'
|
18
|
+
DEFAULT_PARAMS = {}
|
19
|
+
DEFAULT_HEADERS = {}
|
20
|
+
DEFAULT_SSL_SET = false
|
21
|
+
DEFAULT_TIMEOUT = 5
|
22
|
+
DEFAULT_ENCODING = nil
|
23
|
+
DEFAULT_AUTO_RECONNECT = true
|
24
|
+
DEFAULT_CALLBACK = lambda { |data| puts data }
|
25
|
+
DEFAULT_CHANNEL = 'hello_world'
|
26
|
+
PERIODIC_TIMER_INTERVAL = 0.25
|
27
|
+
MAX_RETRIES = 10
|
28
|
+
RETRIES_INTERVAL = 1
|
29
|
+
DEFAULT_TTL = 1440
|
23
30
|
end
|
24
31
|
end
|
25
32
|
|
data/lib/pubnub/crypto.rb
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
# TODO that file isn't refactored yet!
|
1
2
|
module Pubnub
|
2
3
|
class Crypto
|
3
4
|
def initialize(cipher_key)
|
5
|
+
$logger.debug('Initializing Crypto')
|
4
6
|
@alg = 'AES-256-CBC'
|
5
7
|
sha256_key = Digest::SHA256.hexdigest(cipher_key)
|
6
8
|
@key = sha256_key.slice(0,32)
|
7
9
|
|
8
10
|
@iv = '0123456789012345'
|
11
|
+
$logger.debug('Initialized Crypto')
|
9
12
|
end
|
10
13
|
|
11
14
|
|
@@ -24,8 +27,8 @@ module Pubnub
|
|
24
27
|
|
25
28
|
end
|
26
29
|
|
27
|
-
|
28
30
|
def decrypt(cipher_text)
|
31
|
+
$logger.debug("Decrypting: #{cipher_text}")
|
29
32
|
decode_cipher = OpenSSL::Cipher::Cipher.new(@alg)
|
30
33
|
decode_cipher.decrypt
|
31
34
|
decode_cipher.key = @key
|
@@ -38,16 +41,20 @@ module Pubnub
|
|
38
41
|
plain_text = decode_cipher.update(undecoded_text)
|
39
42
|
plain_text << decode_cipher.final
|
40
43
|
rescue => e
|
41
|
-
|
44
|
+
$logger.error 'DECRYPTION ERROR'
|
45
|
+
plain_text = '"DECRYPTION ERROR"'
|
42
46
|
end
|
43
47
|
|
44
48
|
begin
|
45
49
|
JSON.load(plain_text)
|
46
50
|
rescue JSON::ParserError
|
47
51
|
JSON.load("[#{plain_text}]")[0] # srsly ruby? srsly?
|
48
|
-
rescue
|
49
|
-
return 'PARSE DECRYPTION MESSAGE ERROR'
|
50
52
|
end
|
53
|
+
|
54
|
+
$logger.debug('Finished decrypting')
|
55
|
+
|
56
|
+
plain_text
|
57
|
+
|
51
58
|
end
|
52
59
|
end
|
53
60
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Pubnub
|
2
|
+
class Envelope
|
3
|
+
|
4
|
+
INSTANCE_VARIABLES = [
|
5
|
+
:channel,
|
6
|
+
:error,
|
7
|
+
:error_message,
|
8
|
+
:first,
|
9
|
+
:history_end,
|
10
|
+
:history_start,
|
11
|
+
:last,
|
12
|
+
:message,
|
13
|
+
:object,
|
14
|
+
:payload,
|
15
|
+
:response,
|
16
|
+
:response_message,
|
17
|
+
:service,
|
18
|
+
:status,
|
19
|
+
:timetoken,
|
20
|
+
:timetoken_update,
|
21
|
+
]
|
22
|
+
|
23
|
+
INSTANCE_VARIABLES.each do |var_name|
|
24
|
+
attr_accessor var_name
|
25
|
+
end
|
26
|
+
|
27
|
+
alias_method 'msg', 'message'
|
28
|
+
alias_method 'status_code', 'status'
|
29
|
+
|
30
|
+
def initialize(parameters, app)
|
31
|
+
INSTANCE_VARIABLES.each do |var_name|
|
32
|
+
instance_variable_set("@#{var_name.to_s}", parameters[var_name])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def is_last?
|
37
|
+
@last ? true : false
|
38
|
+
end
|
39
|
+
|
40
|
+
def is_first?
|
41
|
+
@first ? true : false
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
data/lib/pubnub/event.rb
ADDED
@@ -0,0 +1,470 @@
|
|
1
|
+
module Pubnub
|
2
|
+
module Event
|
3
|
+
|
4
|
+
attr_reader :fired, :finished
|
5
|
+
|
6
|
+
def initialize(options, app)
|
7
|
+
@app = app
|
8
|
+
@origin = options[:origin] || app.env[:origin]
|
9
|
+
@channel = options[:channel]
|
10
|
+
@message = options[:message]
|
11
|
+
@http_sync = options[:http_sync]
|
12
|
+
@callback = options[:callback]
|
13
|
+
@error_callback = options[:error_callback] || app.env[:error_callback]
|
14
|
+
@connect_callback = options[:error_callback] || app.env[:connect_callback]
|
15
|
+
@ssl = options[:ssl] || app.env[:ssl]
|
16
|
+
|
17
|
+
@cipher_key = app.env[:cipher_key]
|
18
|
+
@secret_key = app.env[:secret_key]
|
19
|
+
@auth_key = options[:auth_key] || app.env[:auth_key]
|
20
|
+
@publish_key = app.env[:publish_key]
|
21
|
+
@subscribe_key = app.env[:subscribe_key]
|
22
|
+
|
23
|
+
@response = nil
|
24
|
+
@timetoken = app.env[:timetoken] || 0
|
25
|
+
validate!
|
26
|
+
@original_channel = format_channels(@channel, false)
|
27
|
+
@channel = format_channels(@channel)
|
28
|
+
$logger.debug("Event#initialize | Initialized #{self.class.to_s}")
|
29
|
+
end
|
30
|
+
|
31
|
+
def fire(app)
|
32
|
+
@fired = true
|
33
|
+
$logger.debug('Event#fire')
|
34
|
+
setup_connection(app) unless connection_exist?(app)
|
35
|
+
envelopes = start_event(app)
|
36
|
+
end
|
37
|
+
|
38
|
+
def start_event(app, count = 0)
|
39
|
+
if count <= app.env[:max_retries]
|
40
|
+
$logger.debug('Event#start_event | sending request')
|
41
|
+
$logger.debug("Event#start_event | tt: #{@timetoken}; ctt #{app.env[:timetoken]}")
|
42
|
+
@response = get_connection(app).request(uri(app))
|
43
|
+
end
|
44
|
+
|
45
|
+
error = response_error(@response, app)
|
46
|
+
|
47
|
+
if ![error].flatten.include?(:json) || count > app.env[:max_retries]
|
48
|
+
handle_response(@response, app, error)
|
49
|
+
else
|
50
|
+
start_event(app, count + 1)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def validate!
|
55
|
+
if @allow_multiple_channels == true
|
56
|
+
raise ArgumentError.new(:object => self, :message => 'Invalid channel(s) format! Should be type of: String, Symbol, or Array of both') unless valid_channel?(true)
|
57
|
+
elsif @allow_multiple_channels == false
|
58
|
+
raise ArgumentError.new(:object => self, :message => 'Invalid channel(s) format! Should be type of: String, Symbol') unless valid_channel?(false)
|
59
|
+
end
|
60
|
+
|
61
|
+
raise ArgumentError.new(:object => self, :message => 'Callback parameter is required while using async') if (!@http_sync && @callback.blank?) && !@doesnt_require_callback
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
private
|
66
|
+
|
67
|
+
def response_error(response, app)
|
68
|
+
if Parser.valid_json?(response.body) && (200..206).include?(response.code.to_i)
|
69
|
+
error = false
|
70
|
+
elsif Parser.valid_json?(response.body) && !(200..206).include?(response.code.to_i)
|
71
|
+
error = [:code]
|
72
|
+
elsif !Parser.valid_json?(response.body) && (200..206).include?(response.code.to_i)
|
73
|
+
error = [:json]
|
74
|
+
else
|
75
|
+
error = [:code, :json]
|
76
|
+
end
|
77
|
+
|
78
|
+
error
|
79
|
+
end
|
80
|
+
|
81
|
+
def handle_response(response, app, error)
|
82
|
+
|
83
|
+
$logger.debug('Event#handle_response')
|
84
|
+
envelopes = format_envelopes(response, app, error)
|
85
|
+
update_app_timetoken(envelopes, app)
|
86
|
+
fire_callbacks(envelopes,app)
|
87
|
+
@finished = true
|
88
|
+
envelopes
|
89
|
+
|
90
|
+
end
|
91
|
+
|
92
|
+
def update_app_timetoken(envelopes, app)
|
93
|
+
# stub
|
94
|
+
end
|
95
|
+
|
96
|
+
def fire_callbacks(envelopes, app)
|
97
|
+
$logger.debug('Firing callbacks')
|
98
|
+
envelopes.each do |envelope|
|
99
|
+
@callback.call(envelope) if !envelope.error && @callback && !envelope.timetoken_update
|
100
|
+
#if envelope.timetoken_update || envelope.timetoken.to_i > app.env[:timetoken].to_i
|
101
|
+
# update_timetoken(app, envelope.timetoken)
|
102
|
+
#end
|
103
|
+
end
|
104
|
+
@error_callback.call(envelopes.first) if envelopes.first.error
|
105
|
+
|
106
|
+
end
|
107
|
+
|
108
|
+
def update_timetoken(app, timetoken)
|
109
|
+
@timetoken = timetoken.to_i
|
110
|
+
app.update_timetoken(timetoken.to_i)
|
111
|
+
$logger.debug("Updated timetoken to #{timetoken}")
|
112
|
+
end
|
113
|
+
|
114
|
+
def add_common_data_to_envelopes(envelopes, response, app, error)
|
115
|
+
$logger.debug('Event#add_common_data_to_envelopes')
|
116
|
+
|
117
|
+
envelopes.each do |envelope|
|
118
|
+
envelope.response = response.body
|
119
|
+
envelope.object = response
|
120
|
+
envelope.status = response.code.to_i
|
121
|
+
end
|
122
|
+
|
123
|
+
envelopes.last.last = true
|
124
|
+
envelopes.first.first = true
|
125
|
+
|
126
|
+
envelopes = insert_errors(envelopes, error, app) if error
|
127
|
+
|
128
|
+
envelopes
|
129
|
+
end
|
130
|
+
|
131
|
+
def insert_errors(envelopes, error_symbol, app)
|
132
|
+
case error_symbol
|
133
|
+
when [:json]
|
134
|
+
error_message = '[0,"Invalid JSON in response."]'
|
135
|
+
error = JSONParseError.new(
|
136
|
+
:app => app,
|
137
|
+
:message => error_message,
|
138
|
+
:request => self.class,
|
139
|
+
:response => @response.body,
|
140
|
+
:error => error_symbol
|
141
|
+
)
|
142
|
+
when [:code]
|
143
|
+
error_message = '[0,"Non 2xx server response."]'
|
144
|
+
error = ResponseError.new(
|
145
|
+
:app => app,
|
146
|
+
:message => error_message,
|
147
|
+
:request => self.class,
|
148
|
+
:response => @response.body,
|
149
|
+
:error => error_symbol
|
150
|
+
)
|
151
|
+
when [:code, :json]
|
152
|
+
error_message = '[0,"Invalid JSON in response."]'
|
153
|
+
error = ResponseError.new(
|
154
|
+
:app => app,
|
155
|
+
:message => error_message,
|
156
|
+
:request => self.class,
|
157
|
+
:response => @response.body,
|
158
|
+
:error => error_symbol
|
159
|
+
)
|
160
|
+
else
|
161
|
+
error_message = '[0, "Unknown Error."]'
|
162
|
+
error = Error.new(
|
163
|
+
:app => app,
|
164
|
+
:message => error_message,
|
165
|
+
:request => self.class,
|
166
|
+
:response => @response.body,
|
167
|
+
:error => error_symbol
|
168
|
+
)
|
169
|
+
end
|
170
|
+
|
171
|
+
envelopes.first.error = error
|
172
|
+
envelopes.first.message = error_message
|
173
|
+
envelopes.first.last = true
|
174
|
+
|
175
|
+
[envelopes.first]
|
176
|
+
end
|
177
|
+
|
178
|
+
def uri(app)
|
179
|
+
$logger.debug("#{self.class}#uri #{[origin(app), path(app), '?', params_hash_to_url_params(parameters(app))].join}")
|
180
|
+
URI [origin(app), path(app), '?', params_hash_to_url_params(parameters(app))].join
|
181
|
+
end
|
182
|
+
|
183
|
+
def origin(app)
|
184
|
+
h = @ssl ? 'https://' : 'http://'
|
185
|
+
h + @origin
|
186
|
+
end
|
187
|
+
|
188
|
+
def parameters(app)
|
189
|
+
required = {
|
190
|
+
:auth => @auth_key,
|
191
|
+
:pnsdk => "PubNub-Ruby/#{Pubnub::VERSION}"
|
192
|
+
}
|
193
|
+
|
194
|
+
empty_if_blank = {
|
195
|
+
:uuid => app.env[:uuid]
|
196
|
+
}
|
197
|
+
|
198
|
+
empty_if_blank.delete_if {|k, v| v.nil? }
|
199
|
+
|
200
|
+
required.merge(empty_if_blank)
|
201
|
+
end
|
202
|
+
|
203
|
+
end
|
204
|
+
|
205
|
+
module SingleEvent
|
206
|
+
|
207
|
+
def fire(app)
|
208
|
+
$logger.debug('Pubnub::SingleEvent#fire')
|
209
|
+
if @http_sync
|
210
|
+
$logger.debug('Pubnub::SingleEvent#fire | Sync event!')
|
211
|
+
super(app)
|
212
|
+
elsif app.async_events.include? self
|
213
|
+
$logger.debug('Pubnub::SingleEvent#fire | Event already on list!')
|
214
|
+
super(app)
|
215
|
+
else
|
216
|
+
$logger.debug('Pubnub::SingleEvent#fire | Adding event to async_events')
|
217
|
+
app.async_events << self
|
218
|
+
$logger.debug('Pubnub::SingleEvent#fire | Starting railgun')
|
219
|
+
app.start_railgun
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
private
|
224
|
+
|
225
|
+
def setup_connection(app)
|
226
|
+
app.single_event_connections_pool[@origin] = new_connection(app)
|
227
|
+
end
|
228
|
+
|
229
|
+
def connection_exist?(app)
|
230
|
+
!app.single_event_connections_pool[@origin].nil? && !app.single_event_connections_pool[@origin].nil?
|
231
|
+
end
|
232
|
+
|
233
|
+
def get_connection(app)
|
234
|
+
app.single_event_connections_pool[@origin]
|
235
|
+
end
|
236
|
+
|
237
|
+
def new_connection(app)
|
238
|
+
connection = Net::HTTP::Persistent.new "pubnub_ruby_client_v#{Pubnub::VERSION}"
|
239
|
+
connection.idle_timeout = app.env[:timeout]
|
240
|
+
connection.read_timeout = app.env[:timeout]
|
241
|
+
connection
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
module SubscribeEvent
|
246
|
+
|
247
|
+
|
248
|
+
def fire(app)
|
249
|
+
begin
|
250
|
+
$logger.debug('SubscribeEvent#fire')
|
251
|
+
if @http_sync
|
252
|
+
$logger.debug('SubscribeEvent#fire sync')
|
253
|
+
super
|
254
|
+
else
|
255
|
+
$logger.debug('SubscribeEvent#fire async')
|
256
|
+
$logger.debug("Channel: #{@channel}")
|
257
|
+
setup_connection(app) unless connection_exist?(app)
|
258
|
+
unless app.env[:subscriptions][@origin].blank?
|
259
|
+
@channel.each do |channel|
|
260
|
+
if app.env[:subscriptions][@origin].get_channels.include?(channel)
|
261
|
+
@channel.delete(channel)
|
262
|
+
$logger.error("Already subscribed to channel #{channel}, you have to leave that channel first")
|
263
|
+
end
|
264
|
+
$logger.debug('SubscribeEvent#add_channel | Adding channel')
|
265
|
+
app.env[:subscriptions][@origin].add_channel(channel, app)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
if app.env[:subscriptions][@origin].nil?
|
270
|
+
app.env[:subscriptions][@origin] = self if app.env[:subscriptions][@origin].nil?
|
271
|
+
app.env[:callbacks_pool][@origin] = Hash.new if app.env[:callbacks_pool][@origin].nil?
|
272
|
+
app.env[:error_callbacks_pool][@origin] = @error_callback if app.env[:error_callbacks_pool][@origin].nil?
|
273
|
+
|
274
|
+
@channel.each do |channel|
|
275
|
+
app.env[:callbacks_pool][@origin][channel] = Hash.new
|
276
|
+
|
277
|
+
app.env[:callbacks_pool][@origin][channel][:callback] = @callback unless app.env[:callbacks_pool][@origin][:callback]
|
278
|
+
end
|
279
|
+
|
280
|
+
else
|
281
|
+
@channel.each do |channel|
|
282
|
+
app.env[:callbacks_pool][@origin][channel] = Hash.new
|
283
|
+
app.env[:callbacks_pool][@origin][channel] = Hash.new
|
284
|
+
|
285
|
+
app.env[:callbacks_pool][@origin][channel][:callback] = @callback unless app.env[:callbacks_pool][@origin][:callback]
|
286
|
+
app.env[:callbacks_pool][@origin][channel][:error_callback] = @error_callback unless app.env[:callbacks_pool][@origin][:error_callback]
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
app.start_subscribe
|
291
|
+
|
292
|
+
end
|
293
|
+
rescue => error
|
294
|
+
$logger.error(error)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
def set_timetoken(timetoken)
|
299
|
+
@timetoken = timetoken
|
300
|
+
end
|
301
|
+
|
302
|
+
def add_channel(channel, app)
|
303
|
+
@channel = @channel + format_channels(channel)
|
304
|
+
$logger.debug('SubscribeEvent#add_channel | Added channel')
|
305
|
+
end
|
306
|
+
|
307
|
+
def remove_channel(channel, app)
|
308
|
+
@channel = @channel - format_channels(channel)
|
309
|
+
$logger.debug('SubscribeEvent#remove_channel | Removed channel')
|
310
|
+
begin
|
311
|
+
shutdown_subscribe(app) if @channel.empty?
|
312
|
+
rescue => e
|
313
|
+
$logger.error(e.message)
|
314
|
+
$logger.error(e.backtrace)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
def get_channels
|
319
|
+
@channel
|
320
|
+
end
|
321
|
+
|
322
|
+
private
|
323
|
+
|
324
|
+
def update_app_timetoken(envelopes, app)
|
325
|
+
$logger.debug('Event#update_app_timetoken')
|
326
|
+
envelopes.each do |envelope|
|
327
|
+
if envelope.timetoken_update || envelope.timetoken.to_i > app.env[:timetoken].to_i
|
328
|
+
update_timetoken(app, envelope.timetoken)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
app.env[:wait_for_response][@origin] = false unless @http_sync
|
332
|
+
end
|
333
|
+
|
334
|
+
def shutdown_subscribe(app)
|
335
|
+
app.env[:subscriptions][@origin] = nil
|
336
|
+
app.env[:subscriptions].delete(@origin)
|
337
|
+
app.env[:callbacks_pool][@origin] = nil
|
338
|
+
app.env[:callbacks_pool].delete(@origin)
|
339
|
+
app.subscribe_event_connections_pool[@origin].shutdown_in_all_threads
|
340
|
+
app.subscribe_event_connections_pool[@origin] = nil
|
341
|
+
app.subscribe_event_connections_pool.delete(@origin)
|
342
|
+
end
|
343
|
+
|
344
|
+
def fire_callbacks(envelopes, app)
|
345
|
+
if @http_sync
|
346
|
+
super
|
347
|
+
else
|
348
|
+
begin
|
349
|
+
$logger.debug('Event#fire_callbacks async')
|
350
|
+
envelopes.each do |envelope|
|
351
|
+
app.env[:callbacks_pool][@origin][envelope.channel][:callback].call(envelope) if !envelope.error && !envelope.timetoken_update
|
352
|
+
end
|
353
|
+
$logger.debug('We can send next request now')
|
354
|
+
app.env[:error_callbacks_pool][@origin].call(envelopes.first) if envelopes.first.error
|
355
|
+
rescue => error
|
356
|
+
$logger.error(error)
|
357
|
+
$logger.error(error.backtrace)
|
358
|
+
end
|
359
|
+
end unless envelopes.nil?
|
360
|
+
|
361
|
+
end
|
362
|
+
|
363
|
+
def setup_connection(app)
|
364
|
+
app.subscribe_event_connections_pool[@origin] = new_connection(app)
|
365
|
+
end
|
366
|
+
|
367
|
+
def connection_exist?(app)
|
368
|
+
!app.subscribe_event_connections_pool[@origin].nil? && !app.subscribe_event_connections_pool[@origin].nil?
|
369
|
+
end
|
370
|
+
|
371
|
+
def get_connection(app)
|
372
|
+
app.subscribe_event_connections_pool[@origin]
|
373
|
+
end
|
374
|
+
|
375
|
+
def channels_for_url(channels)
|
376
|
+
channels.join(',')
|
377
|
+
end
|
378
|
+
|
379
|
+
def path(app)
|
380
|
+
path = URI.escape("/subscribe/#{@subscribe_key}/#{channels_for_url(@channel)}/0/#{@timetoken}").gsub(/\?/,'%3F')
|
381
|
+
end
|
382
|
+
|
383
|
+
def timetoken(parsed_response)
|
384
|
+
parsed_response[1] if parsed_response.is_a? Array
|
385
|
+
end
|
386
|
+
|
387
|
+
def message(parsed_response, i, channel, app)
|
388
|
+
if app.env[:cipher_key].blank? || channel.index('-pnpres')
|
389
|
+
parsed_response.first[i]
|
390
|
+
else
|
391
|
+
pc = Crypto.new(app.env[:cipher_key])
|
392
|
+
pc.decrypt(parsed_response.first[i])
|
393
|
+
end
|
394
|
+
end
|
395
|
+
|
396
|
+
def format_envelopes(response, app, error)
|
397
|
+
|
398
|
+
$logger.debug('Subscribe#format_envelopes')
|
399
|
+
|
400
|
+
parsed_response = Parser.parse_json(response.body) if Parser.valid_json?(response.body)
|
401
|
+
|
402
|
+
$logger.debug('Subscribe#format_envelopes | Response parsed')
|
403
|
+
|
404
|
+
envelopes = Array.new
|
405
|
+
if error
|
406
|
+
$logger.debug('Subscribe#format_envelopes | Error')
|
407
|
+
envelopes << Envelope.new(
|
408
|
+
{
|
409
|
+
:channel => @channel,
|
410
|
+
:timetoken => timetoken(parsed_response)
|
411
|
+
},
|
412
|
+
app
|
413
|
+
)
|
414
|
+
elsif parsed_response[0].empty?
|
415
|
+
$logger.debug('Subscribe#format_envelopes | Timetoken')
|
416
|
+
envelopes << Envelope.new(
|
417
|
+
{
|
418
|
+
:channel => @channel.first,
|
419
|
+
:response_message => parsed_response,
|
420
|
+
:timetoken => timetoken(parsed_response),
|
421
|
+
:timetoken_update => true
|
422
|
+
},
|
423
|
+
app
|
424
|
+
)
|
425
|
+
else
|
426
|
+
$logger.debug('Subscribe#format_envelopes | Not timetoken update')
|
427
|
+
parsed_response[0].size.times do |i|
|
428
|
+
if parsed_response[2].is_a? Array
|
429
|
+
channel = parsed_response[2][i]
|
430
|
+
elsif parsed_response[2].is_a? String
|
431
|
+
channel = parsed_response[2]
|
432
|
+
else
|
433
|
+
channel = @channel.first
|
434
|
+
end
|
435
|
+
$logger.debug('Subscribe#format_envelopes | Channel created')
|
436
|
+
|
437
|
+
$logger.debug("#{parsed_response}")
|
438
|
+
|
439
|
+
envelopes << Envelope.new(
|
440
|
+
{
|
441
|
+
:message => message(parsed_response, i, channel, app),
|
442
|
+
:channel => channel,
|
443
|
+
:response_message => parsed_response,
|
444
|
+
:timetoken => timetoken(parsed_response)
|
445
|
+
},
|
446
|
+
app
|
447
|
+
)
|
448
|
+
|
449
|
+
$logger.debug('Subscribe#format_envelopes | Envelopes created')
|
450
|
+
|
451
|
+
end
|
452
|
+
end
|
453
|
+
|
454
|
+
$logger.debug('Subscribe#format_envelopes | envelopes created')
|
455
|
+
|
456
|
+
envelopes = add_common_data_to_envelopes(envelopes, response, app, error)
|
457
|
+
|
458
|
+
envelopes
|
459
|
+
|
460
|
+
end
|
461
|
+
|
462
|
+
def new_connection(app)
|
463
|
+
connection = Net::HTTP::Persistent.new "pubnub_ruby_client_v#{Pubnub::VERSION}"
|
464
|
+
connection.idle_timeout = app.env[:subscribe_timeout]
|
465
|
+
connection.read_timeout = app.env[:subscribe_timeout]
|
466
|
+
@connect_callback.call "New subscribe connection to #{@origin}"
|
467
|
+
connection
|
468
|
+
end
|
469
|
+
end
|
470
|
+
end
|