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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 823024dba735d78188dfb40014ad66a746ec1633
|
4
|
+
data.tar.gz: ee58ab64b1c20f62864edeaa36f76d5ba046b624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28a9736826cd12c73c302bd94afcec9b22fda0785b849cb793a4aceb3cf1890e68bb604467748ae0110a2ad02035499e6bab25378cf3d2bee72229bd75c5cbb4
|
7
|
+
data.tar.gz: 016fc32654f807868280218ab34370054a75492b37f154a69f8c8900b41effa0b6f856c294548bf7334f77ab098cfc9830c9e383dd99d07dbe06544fd2b7e937
|
data/.gitignore
CHANGED
data/CHANGELOG
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
-
3.
|
2
|
-
|
3
|
-
|
1
|
+
3-17-14 - 3.5.1 Release
|
2
|
+
. PAM Support!
|
3
|
+
. extensive refactor, removed a lot of dependencies, such as Faraday for HTTP_SYNC mode
|
4
|
+
. connection callback can be set per subscribe call
|
5
|
+
. fixed issue where EM could silently fail after some time with Passenger
|
data/README.md
CHANGED
@@ -1,31 +1,27 @@
|
|
1
1
|
##### YOU MUST HAVE A PUBNUB ACCOUNT TO USE THE API.
|
2
2
|
##### http://www.pubnub.com/account
|
3
3
|
|
4
|
-
## PubNub Gem version 3.
|
4
|
+
## PubNub Gem version 3.5.0
|
5
5
|
|
6
|
-
www.pubnub.com - PubNub Real-time Push Service in the Cloud.
|
6
|
+
www.pubnub.com - PubNub Real-time Push Service in the Cloud.
|
7
7
|
|
8
|
-
PubNub is a
|
8
|
+
The PubNub Network is a blazingly fast Global Messaging Service for building real-time web and mobile apps. Thousands of apps and developers rely on PubNub for delivering human-perceptive real-time experiences that scale to millions of users worldwide. PubNub delivers the infrastructure needed to build amazing Mobile, MMO games, social apps, business collaborative solutions, and more.
|
9
9
|
|
10
10
|
### Upgrading from PubNub 3.3.x and Earlier
|
11
|
-
PubNub 3.
|
11
|
+
PubNub 3.5.0 is NOT compatible with earlier than 3.4 versions of Pubnub Ruby Client.
|
12
12
|
|
13
|
-
###
|
14
|
-
|
15
|
-
|
16
|
-
* Ability to carry out requests asynchronously or synchronously
|
17
|
-
* Message handling via callback, block, and return
|
18
|
-
* Heroku and JRuby Support (JRuby requires calls to be made synchronously)
|
13
|
+
### Upgrading from PubNub 3.4
|
14
|
+
PubNub 3.5.0 is compatible with 3.4 version.
|
19
15
|
|
20
16
|
#### Asynchronous vs Synchronous Responses
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
Every event you will fire could be fired asynchronous ro synchonous just by passing
|
18
|
+
```ruby
|
19
|
+
:http_sync
|
20
|
+
```
|
21
|
+
set to true to that event. Asynchronous events will not block your main thread and will be fired withing new thread.
|
24
22
|
|
25
23
|
#### Message Handling: callback, block, return
|
26
|
-
|
27
|
-
|
28
|
-
In 3.4, you can now have both, even on a per-call basis!
|
24
|
+
You could pass to every even callback as callback or just by block that will get envelope with message. Callback will be fired for every message that will event get in response. Synchornous events will return array of envelopes (if you passed callback to sychronous event it will be called too!).
|
29
25
|
|
30
26
|
### Code Examples
|
31
27
|
|
@@ -35,10 +31,10 @@ require 'pubnub'
|
|
35
31
|
```
|
36
32
|
|
37
33
|
#### Init and instantiate a new PubNub instance
|
38
|
-
|
39
34
|
```ruby
|
40
|
-
|
41
35
|
# If you wish to override the default logger, create one and pass it in.
|
36
|
+
# Default logger writes into pubnub.log file
|
37
|
+
|
42
38
|
my_logger = Logger.new(STDOUT)
|
43
39
|
|
44
40
|
pubnub = Pubnub.new(
|
@@ -46,7 +42,7 @@ pubnub = Pubnub.new(
|
|
46
42
|
:publish_key => 'demo',
|
47
43
|
:origin => origin,
|
48
44
|
:error_callback => lambda { |msg|
|
49
|
-
puts "
|
45
|
+
puts "Error callback says: #{msg.inspect}"
|
50
46
|
},
|
51
47
|
:connect_callback => lambda { |msg|
|
52
48
|
puts "CONNECTED: #{msg.inspect}"
|
@@ -66,7 +62,7 @@ There are a few different ways to make any given PubNub call. How to do it depen
|
|
66
62
|
|
67
63
|
##### Asynchronous (non-blocking) calling
|
68
64
|
|
69
|
-
If you wish to make asyncronous calls (implemented via
|
65
|
+
If you wish to make asyncronous calls (implemented via EventMachine), you have a few different patterns you can follow:
|
70
66
|
|
71
67
|
```ruby
|
72
68
|
# Lets use a callback for the first example...
|
@@ -76,17 +72,17 @@ cb = lambda { |envelope| puts envelope.message }
|
|
76
72
|
pubnub.publish(:message => msg, :channel => channel, :callback => cb)
|
77
73
|
|
78
74
|
# You can also explicitly request async with :http_sync => false
|
79
|
-
pubnub.publish(:message => msg, :channel => channel, :callback => cb, :http_sync =>
|
75
|
+
pubnub.publish(:message => msg, :channel => channel, :callback => cb, :http_sync => false)
|
80
76
|
|
81
77
|
# Alternatively, you can pass in the callback as a block
|
82
78
|
|
83
79
|
pubnub.publish(:message => msg, :channel => channel, &cb)
|
84
80
|
|
85
|
-
pubnub.publish(:message => msg, :channel => channel) do |envelope|
|
81
|
+
pubnub.publish(:message => msg, :channel => channel) do |envelope|
|
86
82
|
puts envelope.message
|
87
83
|
puts envelope.channel
|
88
84
|
puts envelope.status_code
|
89
|
-
puts envelope.timetoken
|
85
|
+
puts envelope.timetoken
|
90
86
|
end
|
91
87
|
```
|
92
88
|
|
@@ -105,14 +101,14 @@ pubnub.publish(:http_sync => true, :message => msg, :channel => channel, &cb)
|
|
105
101
|
|
106
102
|
# Sync (blocking), with assignment via return
|
107
103
|
myResponse = pubnub.publish(:http_sync => true, :message => msg, :channel => channel)
|
108
|
-
puts "myR: #{myResponse}"
|
104
|
+
puts "myR: #{myResponse.inspect}"
|
109
105
|
|
110
106
|
# Sync (blocking), with a block
|
111
|
-
pubnub.publish(:http_sync => true, :message => msg, :channel => channel) do |envelope|
|
107
|
+
pubnub.publish(:http_sync => true, :message => msg, :channel => channel) do |envelope|
|
112
108
|
puts envelope.message
|
113
109
|
puts envelope.channel
|
114
110
|
puts envelope.status_code
|
115
|
-
puts envelope.timetoken
|
111
|
+
puts envelope.timetoken
|
116
112
|
end
|
117
113
|
```
|
118
114
|
|
@@ -122,31 +118,37 @@ When you receive messages asynchronously from PubNub, your block or callback wil
|
|
122
118
|
|
123
119
|
Conceptually, the callback or block is fired once for each message in the raw server response:
|
124
120
|
|
125
|
-
```
|
126
|
-
|
127
|
-
|
121
|
+
```ruby
|
122
|
+
envelopes.each do |envelope|
|
123
|
+
callback.call envelope
|
124
|
+
end
|
128
125
|
```
|
129
126
|
|
130
127
|
|
131
|
-
#### The Envelope Object
|
128
|
+
#### The Envelope Object
|
132
129
|
The callback (or block) will receive the message(s) in the form of an envelope hash. An envelope will contain the following keys:
|
133
130
|
|
134
|
-
* message (aliased as 'msg') -> Holds message
|
131
|
+
* message (aliased as 'msg') -> Holds message, if publish, holds published message
|
132
|
+
* response_message -> as above, except that if publish holds server response (String "Send")
|
135
133
|
* channel -> Holds channel for current message
|
136
134
|
* timetoken -> Timetoken of server response
|
137
|
-
* status_code -> Server response status code
|
135
|
+
* status (aliased as 'status_code') -> Server response status code
|
138
136
|
* response -> Whole and unmodified server response
|
137
|
+
* first -> true if it's first envelope in single response messages array
|
138
|
+
* last -> true if it's last envelope in single response messages array
|
139
|
+
* And a bit more, specific to some events, you will find it in description of certain events
|
139
140
|
|
140
141
|
Don't confuse the **message** with the **response**. In a given callback cycle, the **response** will always be the same, as its the raw server response. It may consist of one or more messages.
|
141
142
|
|
142
143
|
Internally, the block or callback is iterates over the response array, similar to:
|
143
144
|
|
144
|
-
```
|
145
|
-
|
146
|
-
|
145
|
+
```ruby
|
146
|
+
envelopes.each do |envelope|
|
147
|
+
callback.call envelope
|
148
|
+
end
|
147
149
|
```
|
148
150
|
|
149
|
-
In a given callback cycle, the **
|
151
|
+
In a given callback cycle, the **envelope** will be the currently iterated envelopes item of the response.
|
150
152
|
|
151
153
|
### Simple Usage Examples
|
152
154
|
|
@@ -197,7 +199,7 @@ Optional start, end, and reverse option usage can be found in the tests.
|
|
197
199
|
```ruby
|
198
200
|
pubnub.history(
|
199
201
|
:channel => channel,
|
200
|
-
:count => 10,
|
202
|
+
:count => 10,
|
201
203
|
:callback => @my_callback
|
202
204
|
)
|
203
205
|
```
|
@@ -212,7 +214,7 @@ pubnub.presence(
|
|
212
214
|
)
|
213
215
|
```
|
214
216
|
|
215
|
-
####
|
217
|
+
#### HereNow
|
216
218
|
See who is "here now" in a channel at this very moment.
|
217
219
|
|
218
220
|
```ruby
|
@@ -233,16 +235,200 @@ pubnub.uuid
|
|
233
235
|
If you wish to manually set a custom UUID, pass in a uuid key in the initializer. See "Init and instantiate a new PubNub instance" for an example.
|
234
236
|
|
235
237
|
|
236
|
-
#### Time
|
238
|
+
#### Time
|
237
239
|
Get the current PubNub time. This is great to use as a "PubNub Ping"
|
238
240
|
|
239
241
|
```ruby
|
240
242
|
pubnub.time("callback" => @my_callback)
|
241
243
|
```
|
242
244
|
|
245
|
+
### PAM
|
246
|
+
|
247
|
+
Developers can grant fine-grained Publish/Subscribe permissions for their real-time apps and data, without hosting authentication services Access control can be granted at various levels.
|
248
|
+
|
249
|
+
Envelopes returned by PAM events have additional :service and :payload keys.
|
250
|
+
|
251
|
+
#### PAM Usage Examples
|
252
|
+
|
253
|
+
##### Audit
|
254
|
+
Audits auths for given parameters
|
255
|
+
|
256
|
+
```ruby
|
257
|
+
pubnub.audit(:channel => :forbidden_for_jim) do |envelope|
|
258
|
+
puts envelope.payload
|
259
|
+
end
|
260
|
+
|
261
|
+
pubnub.audit(:channel => :forbidden_for_jim, :auth_key => :jim) do |envelope|
|
262
|
+
puts envelope.payload
|
263
|
+
end
|
264
|
+
```
|
265
|
+
|
266
|
+
##### Grant
|
267
|
+
Grants auths for given parameters, you can pass :read and :write keys as parameters
|
268
|
+
|
269
|
+
```ruby
|
270
|
+
pubnub.grant(:channel => :forbidden_to_write, :read => true, :write => false) do |envelope|
|
271
|
+
puts envelope.payload
|
272
|
+
end
|
273
|
+
|
274
|
+
pubnub.grant(:channel => :forbidden_to_write, :read => true, :write => true, :auth_key => :admin) do |envelope|
|
275
|
+
puts envelope.payload
|
276
|
+
end
|
277
|
+
```
|
278
|
+
|
279
|
+
##### Revoke
|
280
|
+
Revokes right to read and write
|
281
|
+
|
282
|
+
```ruby
|
283
|
+
pubnub.revoke(:channel => :forbidden) do |envelope|
|
284
|
+
puts envelope.payload
|
285
|
+
end
|
286
|
+
|
287
|
+
pubnub.grant(:channel => :forbidden, :auth_key => :godzilla) do |envelope|
|
288
|
+
puts envelope.payload
|
289
|
+
end
|
290
|
+
```
|
291
|
+
|
292
|
+
|
243
293
|
### Advanced Usage Examples
|
244
294
|
|
245
|
-
|
295
|
+
##### Init
|
296
|
+
```ruby
|
297
|
+
# Example below shows passing more options for client
|
298
|
+
# Pubnub.new returns Pubnub::Client instance
|
299
|
+
pubnub = Pubnub.new(
|
300
|
+
:error_callback => custom_error_callback,
|
301
|
+
:connect_callback => custom_connect_callback,
|
302
|
+
:ssl => true,
|
303
|
+
:uuid => 'newton',
|
304
|
+
:port => 80,
|
305
|
+
:origin => custom_origin,
|
306
|
+
:subscribe_timeout => 310,
|
307
|
+
:non_subscribe_timeout => 5,
|
308
|
+
:max_retries => 10, # max retries if response got invalid json
|
309
|
+
:ttl => custom_default_ttl_for_pam,
|
310
|
+
:secret_key => 0
|
311
|
+
)
|
312
|
+
```
|
313
|
+
|
314
|
+
##### Publish
|
315
|
+
```ruby
|
316
|
+
# Message could be any object that have .to_json method
|
317
|
+
# You do not need to jsonify message before sending
|
318
|
+
# This time publish event will block main thread until callback will finish as we set :http_sync to true
|
319
|
+
pubnub.publish(
|
320
|
+
:messsage => message,
|
321
|
+
:channel => :whatever,
|
322
|
+
:http_sync => true )
|
323
|
+
```
|
324
|
+
|
325
|
+
##### Subscribe
|
326
|
+
```ruby
|
327
|
+
# You can pass in :channel or :channels String, Symbol, Array of both, or csv separated with commas, remember, as space is valid channel part, there should not be any spaces between commas (unless you want them)
|
328
|
+
# Some example of valid channels:
|
329
|
+
# :example_symbol
|
330
|
+
# 'example_string'
|
331
|
+
# [:one, :two, 'three']
|
332
|
+
# [:anything]
|
333
|
+
# 'one,two,three'
|
334
|
+
|
335
|
+
# Firing sync subscribe could lock your thread even for 5 minutes
|
336
|
+
# When there's no traffic on channel server will send timetoken without
|
337
|
+
# any messages every ~300s.
|
338
|
+
# First sync subscribe will just update your timetoken, you will not get any messages
|
339
|
+
# example:
|
340
|
+
pubnub.subscribe(:channel => 'alerts', :http_sync => true) # just update timetoken
|
341
|
+
pubnub.subscribe(:channel => 'alerts', :http_sync => true) # Will fire request with current timetoken and can possibly get messages
|
342
|
+
|
343
|
+
# Async subscribe starts infinity loop in seperate thread (EM.periodic_timer precisely)
|
344
|
+
# It will update your timetoken and will fire given callback for every message that it gets
|
345
|
+
# example:
|
346
|
+
pubnub.subscribe(
|
347
|
+
:channel => 'fight_log'
|
348
|
+
) do |envelope|
|
349
|
+
puts envelope.message['attacker']
|
350
|
+
puts envelope.message['defender']
|
351
|
+
puts envelope.message['demage']
|
352
|
+
end
|
353
|
+
```
|
354
|
+
|
355
|
+
##### History
|
356
|
+
History returns :count messages from given channel.
|
357
|
+
```ruby
|
358
|
+
pubnub.history(
|
359
|
+
:channel => :actions,
|
360
|
+
:count => 10,
|
361
|
+
:start => 13942156708212448,
|
362
|
+
:end => 13942156908212448,
|
363
|
+
:callback => replay
|
364
|
+
)
|
365
|
+
```
|
366
|
+
|
367
|
+
:reverse set to true will traverse the time line in reverse starting with the newest message first. Default is false.
|
368
|
+
If both start and end arguments are provided, reverse is ignored and messages are returned starting with the newest message.
|
369
|
+
|
370
|
+
```ruby
|
371
|
+
pubnub.history(
|
372
|
+
:channel => :actions,
|
373
|
+
:count => 10,
|
374
|
+
:reverse => true,
|
375
|
+
:callback => replay
|
376
|
+
)
|
377
|
+
```
|
378
|
+
History envelope also contains .history_start and .history_end values
|
379
|
+
|
380
|
+
##### Presence
|
381
|
+
Presence works exactly the same way as subscribe, it just adds '-pnpres' to channel name.
|
382
|
+
```ruby
|
383
|
+
pubnub.subscribe(
|
384
|
+
:channel => :mars
|
385
|
+
) do |envelope|
|
386
|
+
show_in_roster(envelope.uuid)
|
387
|
+
end
|
388
|
+
```
|
389
|
+
|
390
|
+
##### HereNow
|
391
|
+
HereNow shows us who is currently subscribing channel and how much clients are online on given channel.
|
392
|
+
```ruby
|
393
|
+
pubnub.here_now(
|
394
|
+
:channel => :pamam_moon_iv
|
395
|
+
) do |envelope|
|
396
|
+
puts envelope.msg['uuids']
|
397
|
+
puts envelope.msg['occupancy']
|
398
|
+
end
|
399
|
+
```
|
400
|
+
#### Pam
|
401
|
+
PAM allows you to grant read and write access basing on channels and auth_keys.
|
402
|
+
Every pam event requires :secret_key (Remember! You should set it while initializing pubnub)
|
403
|
+
|
404
|
+
##### Audit
|
405
|
+
```ruby
|
406
|
+
pubnub.audit(:channel => 'hidden_system'){ |envelope| puts envelope.msg }
|
407
|
+
|
408
|
+
```
|
409
|
+
|
410
|
+
##### Grant
|
411
|
+
```ruby
|
412
|
+
# Channel level
|
413
|
+
pubnub.grant(:channel => 'hidden_system', :read => true, :write => false){ |envelope| puts envelope.msg }
|
414
|
+
|
415
|
+
# Auth key level
|
416
|
+
pubnub.grant(:channel => 'hidden_system', :read => true, :write => false, :auth_key => :lemon){ |envelope| puts envelope.msg }
|
417
|
+
```
|
418
|
+
|
419
|
+
##### Revoke
|
420
|
+
Works like grant but revokes all previously given privilages
|
421
|
+
```ruby
|
422
|
+
# Channel level
|
423
|
+
pubnub.revoke(:channel => 'hidden_system'){ |envelope| puts envelope.msg }
|
424
|
+
|
425
|
+
# Auth key level
|
426
|
+
pubnub.revoke(:channel => 'hidden_system', :auth_key => :lemon){ |envelope| puts envelope.msg }
|
427
|
+
```
|
428
|
+
|
429
|
+
### Other
|
430
|
+
|
431
|
+
Advanced usage examples can be found also in the examples directory.
|
246
432
|
|
247
433
|
#### demo_console
|
248
434
|
A demo console app which shows how to use just about every PubNub Ruby call, just about every possible way!
|
@@ -260,5 +446,45 @@ Sinatra demo.
|
|
260
446
|
Mixing up some async pubs and subs, using blocks and callbacks.
|
261
447
|
|
262
448
|
#### serial_publish
|
263
|
-
Publish
|
449
|
+
Publish 10000 times with an explicit 0.05s delay between publishes
|
450
|
+
|
451
|
+
## Comment on Passenger users
|
452
|
+
Passenger is orphaning threads and it causes issues with EM which is need to run async pubnub events.
|
453
|
+
Below is fix that worked with our tests. You should fire that code from your initializers.
|
454
|
+
|
455
|
+
Some other environments could cause similar problems with EM, if you think you're affected, feel free to open issue and we will do our best to help.
|
456
|
+
|
457
|
+
```ruby
|
458
|
+
module Pubnub
|
459
|
+
# Taken from http://www.hiringthing.com/2011/11/04/eventmachine-with-rails.html
|
460
|
+
# Thanks Joshua!
|
461
|
+
def self.start
|
462
|
+
if defined?(PhusionPassenger)
|
463
|
+
PhusionPassenger.on_event(:starting_worker_process) do |forked|
|
464
|
+
# for passenger, we need to avoid orphaned threads
|
465
|
+
|
466
|
+
$my_logger.debug "=> Starting worker process"
|
467
|
+
|
468
|
+
if forked && EM.reactor_running?
|
469
|
+
$my_logger.debug "=> EventMachine stopped fork"
|
470
|
+
EM.stop
|
471
|
+
end
|
472
|
+
Thread.new {
|
473
|
+
EM.run do
|
474
|
+
$my_logger.debug "=> EventMachine started"
|
475
|
+
end
|
476
|
+
}
|
477
|
+
die_gracefully_on_signal
|
478
|
+
end
|
479
|
+
end
|
480
|
+
end
|
481
|
+
|
482
|
+
def self.die_gracefully_on_signal
|
483
|
+
$my_logger.debug "=> EventMachine stopped die"
|
484
|
+
Signal.trap("INT") { EM.stop }
|
485
|
+
Signal.trap("TERM") { EM.stop }
|
486
|
+
end
|
487
|
+
end
|
264
488
|
|
489
|
+
Pubnub.start
|
490
|
+
```
|