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/.yardoc/checksums
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
lib/pubnub/client.rb 24d210ab228a4803805472666581d982de7e7460
|
2
|
-
lib/pubnub/configuration.rb 16cd59eb2bba2d60b411817fc12807e37a55342f
|
3
|
-
lib/pubnub/crypto.rb 5795f15e8380ab4e4df7b66002ba27a0ef6773ca
|
4
|
-
lib/pubnub/daemon.rb 887fe6589269f6244ac45542d278107a143cc04b
|
5
|
-
lib/pubnub/em/client.rb 8132d65f67e1128dc94c2cd7a81fcb2672efb367
|
6
|
-
lib/pubnub/em/connection.rb 0e07699d0469d8f072d9b93a711173e169bf6973
|
7
|
-
lib/pubnub/em/request.rb 6e95650a088ac04a419d18235cfe84a872803bff
|
8
|
-
lib/pubnub/em/response.rb e750b47b62843dc39bfdc006b60d6552143b3b8a
|
9
|
-
lib/pubnub/error.rb dad9a587bdeb0d53dc217a4f3e156bc6787106c1
|
10
|
-
lib/pubnub.rb eab5c5b85a1760514e2d3a7d200f2b5f53690d09
|
11
|
-
lib/pubnub/request.rb affdaa20d405404058de3f0ae19bbf2ef222a172
|
12
|
-
lib/pubnub/response.rb 47a9a785572eae36391ec7da9f214efa8f826876
|
13
|
-
lib/version.rb 47184c709077ffbfe1336763c37cfd9cbc62cd77
|
data/.yardoc/object_types
DELETED
Binary file
|
data/.yardoc/objects/root.dat
DELETED
Binary file
|
data/.yardoc/proxy_types
DELETED
Binary file
|
data/lib/pubnub/error.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
module Pubnub
|
2
|
-
module Error
|
3
|
-
class PresenceError < RuntimeError;
|
4
|
-
end
|
5
|
-
class PublishError < RuntimeError;
|
6
|
-
end
|
7
|
-
class SubscribeError < RuntimeError;
|
8
|
-
end
|
9
|
-
class InitError < RuntimeError;
|
10
|
-
end
|
11
|
-
class PublishError < RuntimeError;
|
12
|
-
end
|
13
|
-
class OperationError < RuntimeError
|
14
|
-
def operation_exception
|
15
|
-
#if @operation.present?
|
16
|
-
# ("Pubnub::" + @operation.to_s.capitalize + "Error").constantize
|
17
|
-
#else
|
18
|
-
PubnubRequest::RequestError
|
19
|
-
#end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
data/lib/pubnub/request.rb
DELETED
@@ -1,288 +0,0 @@
|
|
1
|
-
require 'pubnub/configuration.rb'
|
2
|
-
require 'pubnub/error.rb'
|
3
|
-
require 'pubnub/response.rb'
|
4
|
-
|
5
|
-
require 'openssl'
|
6
|
-
require 'digest/sha2'
|
7
|
-
require 'base64'
|
8
|
-
|
9
|
-
require 'json'
|
10
|
-
|
11
|
-
module Pubnub
|
12
|
-
class Request
|
13
|
-
include Pubnub::Configuration
|
14
|
-
include Pubnub::Error
|
15
|
-
|
16
|
-
attr_accessor :error_callback, :envelopes, :port, :timetoken, :operation, :response, :ssl, :channel, :callback, :cipher_key, :subscribe_key, :secret_key, :operation, :message, :publish_key
|
17
|
-
|
18
|
-
def initialize(options = {})
|
19
|
-
@options = options
|
20
|
-
|
21
|
-
@params = options[:params]
|
22
|
-
@operation = options[:operation]
|
23
|
-
@callback = options[:callback]
|
24
|
-
@error_callback = options[:error_callback]
|
25
|
-
@error_callback = lambda { |x| puts "AN ERROR OCCURRED: #{x.msg}" } unless @error_callback
|
26
|
-
@channel = options[:channel]
|
27
|
-
@message = options[:message]
|
28
|
-
@timetoken = options[:timetoken] || "0"
|
29
|
-
@timetoken = options[:override_timetoken] if options[:override_timetoken]
|
30
|
-
@ssl = options[:ssl]
|
31
|
-
@params = options[:params]
|
32
|
-
|
33
|
-
@history_limit = options[:limit]
|
34
|
-
|
35
|
-
@port = options[:port]
|
36
|
-
@host = options[:origin]
|
37
|
-
@query = options[:query]
|
38
|
-
|
39
|
-
set_cipher_key(options, @cipher_key) if %w(publish subscribe history).include? @operation
|
40
|
-
set_message(options, @cipher_key) if %w(publish).include? @operation
|
41
|
-
set_publish_key(options, @publish_key) if %w(publish).include? @operation
|
42
|
-
set_subscribe_key(options, @subscribe_key) if %w(publish presence here_now history subscribe leave).include? @operation
|
43
|
-
set_secret_key(options, @secret_key) if %w(publish subscribe).include? @operation
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
def ssl=(ssl)
|
48
|
-
if ssl
|
49
|
-
@ssl = true
|
50
|
-
@port = 443
|
51
|
-
else
|
52
|
-
@ssl = false
|
53
|
-
@port = 80
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def origin
|
58
|
-
if @ssl
|
59
|
-
@origin = 'https://' + @host
|
60
|
-
@port = 443
|
61
|
-
else
|
62
|
-
@origin = 'http://' + @host
|
63
|
-
@port = 80
|
64
|
-
end
|
65
|
-
@origin
|
66
|
-
end
|
67
|
-
|
68
|
-
def path
|
69
|
-
encode_path(case @operation
|
70
|
-
when 'publish'
|
71
|
-
[
|
72
|
-
@operation,
|
73
|
-
@publish_key,
|
74
|
-
@subscribe_key,
|
75
|
-
@secret_key,
|
76
|
-
@channel,
|
77
|
-
'0',
|
78
|
-
@message.to_json
|
79
|
-
]
|
80
|
-
when 'subscribe'
|
81
|
-
[
|
82
|
-
@operation,
|
83
|
-
@subscribe_key,
|
84
|
-
@channel,
|
85
|
-
'0',
|
86
|
-
@timetoken
|
87
|
-
]
|
88
|
-
when 'presence'
|
89
|
-
[
|
90
|
-
'subscribe',
|
91
|
-
@subscribe_key,
|
92
|
-
@channel.to_s + '-pnpres',
|
93
|
-
'0',
|
94
|
-
@timetoken
|
95
|
-
]
|
96
|
-
when 'time'
|
97
|
-
[
|
98
|
-
@operation,
|
99
|
-
'0'
|
100
|
-
]
|
101
|
-
when 'history'
|
102
|
-
[
|
103
|
-
'v2',
|
104
|
-
'history',
|
105
|
-
'sub-key',
|
106
|
-
@subscribe_key,
|
107
|
-
'channel',
|
108
|
-
@channel
|
109
|
-
]
|
110
|
-
when 'here_now'
|
111
|
-
[
|
112
|
-
'v2',
|
113
|
-
'presence',
|
114
|
-
'sub-key',
|
115
|
-
@subscribe_key,
|
116
|
-
'channel',
|
117
|
-
@channel
|
118
|
-
]
|
119
|
-
when 'leave'
|
120
|
-
[
|
121
|
-
'v2',
|
122
|
-
'presence',
|
123
|
-
'sub-key',
|
124
|
-
@subscribe_key,
|
125
|
-
'channel',
|
126
|
-
@channel
|
127
|
-
]
|
128
|
-
else
|
129
|
-
raise("I can't create that URL for you due to unknown operation type.")
|
130
|
-
end
|
131
|
-
)
|
132
|
-
end
|
133
|
-
|
134
|
-
def encode_path(request)
|
135
|
-
$log.debug 'ENCODING PATH'
|
136
|
-
path = URI.escape('/' + request.map{|i| i.to_s}.reject(&:empty?).join('/')).gsub(/\?/,'%3F')
|
137
|
-
if @operation == 'leave'
|
138
|
-
$log.debug "#{path}/leave"
|
139
|
-
"#{path}/leave"
|
140
|
-
else
|
141
|
-
$log.debug path
|
142
|
-
path
|
143
|
-
end
|
144
|
-
end
|
145
|
-
|
146
|
-
def params
|
147
|
-
flat = {}
|
148
|
-
@params.each do |param,val|
|
149
|
-
next if val.to_s.empty?
|
150
|
-
flat[param.to_s] = val.to_s
|
151
|
-
end
|
152
|
-
flat
|
153
|
-
end
|
154
|
-
|
155
|
-
def query
|
156
|
-
params.map do |param, value|
|
157
|
-
[param, value].join('=')
|
158
|
-
end.sort.join('&')
|
159
|
-
end
|
160
|
-
|
161
|
-
def handle_response(http)
|
162
|
-
@response = nil
|
163
|
-
|
164
|
-
if http.respond_to?(:body) && http.respond_to?(:code) && http.respond_to?(:message) && http.respond_to?(:headers) # httparty
|
165
|
-
@response = JSON.load(http.body)
|
166
|
-
else # em-http-request
|
167
|
-
@response = http.response.respond_to?(:content) ? JSON.load(http.response.content) : JSON.load(http.response)
|
168
|
-
end
|
169
|
-
|
170
|
-
|
171
|
-
@last_timetoken = @timetoken
|
172
|
-
@timetoken = @response[1] unless @operation == 'time'
|
173
|
-
|
174
|
-
if @cipher_key.present? && %w(subscribe history).include?(@operation)
|
175
|
-
|
176
|
-
response_array = Array.new
|
177
|
-
crypto = Pubnub::Crypto.new(@cipher_key)
|
178
|
-
|
179
|
-
if %w(subscribe history).include?(@operation)
|
180
|
-
iteration = @response[0]
|
181
|
-
else
|
182
|
-
iteration = @response
|
183
|
-
end
|
184
|
-
|
185
|
-
if iteration.class == Array
|
186
|
-
iteration.each do |msg|
|
187
|
-
response_array << crypto.decrypt(msg)
|
188
|
-
end if iteration
|
189
|
-
elsif iteration.class == String
|
190
|
-
response_array = [crypto.decrypt(iteration)]
|
191
|
-
end
|
192
|
-
|
193
|
-
case @operation
|
194
|
-
when 'subscribe'
|
195
|
-
@response[0] = response_array
|
196
|
-
when 'history'
|
197
|
-
json_response_data = JSON.load(http.response)
|
198
|
-
@response = [response_array, json_response_data[1], json_response_data[2]]
|
199
|
-
end
|
200
|
-
end
|
201
|
-
|
202
|
-
@envelopes = Array.new
|
203
|
-
if %w(subscribe history).include? @operation
|
204
|
-
@response.first.each_with_index do |res,index|
|
205
|
-
@envelopes << Pubnub::Response.new(:http => http, :index => index, :response => @response, :channel => @channel, :operation => @operation, :path => path, :query => query)
|
206
|
-
end
|
207
|
-
else
|
208
|
-
@envelopes << Pubnub::Response.new(:http => http, :channel => @channel, :response => @response, :operation => @operation, :path => path, :query => query)
|
209
|
-
end
|
210
|
-
end
|
211
|
-
|
212
|
-
|
213
|
-
private
|
214
|
-
|
215
|
-
def aes_encrypt(cipher_key, options, publish_request)
|
216
|
-
|
217
|
-
pc = Pubnub::Crypto.new(cipher_key)
|
218
|
-
publish_request.message = pc.encrypt(options[:message])
|
219
|
-
|
220
|
-
end
|
221
|
-
|
222
|
-
def set_cipher_key(options, self_cipher_key)
|
223
|
-
if self_cipher_key.present? && options[:cipher_key].present?
|
224
|
-
raise(OperationError, "existing cipher_key #{self_cipher_key} cannot be overridden at publish-time.")
|
225
|
-
|
226
|
-
elsif (self_cipher_key.present? && options[:cipher_key].blank?) || (self_cipher_key.blank? && options[:cipher_key].present?)
|
227
|
-
|
228
|
-
this_cipher_key = self_cipher_key || options[:cipher_key]
|
229
|
-
raise(OperationError, 'secret key must be a string.') if this_cipher_key.class != String
|
230
|
-
@cipher_key = this_cipher_key
|
231
|
-
end
|
232
|
-
end
|
233
|
-
|
234
|
-
def set_secret_key(options, self_secret_key)
|
235
|
-
if self_secret_key.present? && options[:secret_key].present?
|
236
|
-
raise(OperationError, "existing secret_key #{self_secret_key} cannot be overridden at publish-time.")
|
237
|
-
|
238
|
-
elsif (self_secret_key.present? && options[:secret_key].blank?) || (self_secret_key.blank? && options[:secret_key].present?)
|
239
|
-
|
240
|
-
my_secret_key = self_secret_key || options[:secret_key]
|
241
|
-
raise(OperationError, 'secret key must be a string.') if my_secret_key.class != String
|
242
|
-
|
243
|
-
signature = '{ @publish_key, @subscribe_key, @secret_key, channel, message}'
|
244
|
-
digest = OpenSSL::Digest.new('sha256')
|
245
|
-
key = [my_secret_key]
|
246
|
-
hmac = OpenSSL::HMAC.hexdigest(digest, key.pack('H*'), signature)
|
247
|
-
@secret_key = hmac
|
248
|
-
else
|
249
|
-
@secret_key = '0'
|
250
|
-
end
|
251
|
-
end
|
252
|
-
|
253
|
-
def set_message(options, self_cipher_key)
|
254
|
-
if options[:message].blank? && options[:message] != ''
|
255
|
-
raise(OperationError, 'message is a required parameter.')
|
256
|
-
else
|
257
|
-
my_cipher_key = options[:cipher_key] || self_cipher_key
|
258
|
-
|
259
|
-
if my_cipher_key.present?
|
260
|
-
@message = aes_encrypt(my_cipher_key, options, self)
|
261
|
-
else
|
262
|
-
@message = options[:message]
|
263
|
-
end
|
264
|
-
end
|
265
|
-
end
|
266
|
-
|
267
|
-
def set_publish_key(options, self_publish_key)
|
268
|
-
if options[:publish_key].blank? && self_publish_key.blank?
|
269
|
-
raise(OperationError, 'publish_key is a required parameter.')
|
270
|
-
elsif self_publish_key.present? && options[:publish_key].present?
|
271
|
-
raise(OperationError, "existing publish_key #{self_publish_key} cannot be overridden at publish-time.")
|
272
|
-
else
|
273
|
-
@publish_key = (self_publish_key || options[:publish_key]).to_s
|
274
|
-
end
|
275
|
-
end
|
276
|
-
|
277
|
-
def set_subscribe_key(options, self_subscribe_key)
|
278
|
-
if options[:subscribe_key].blank? && self_subscribe_key.blank?
|
279
|
-
raise(OperationError, 'subscribe_key is a required parameter.')
|
280
|
-
elsif self_subscribe_key.present? && options[:subscribe_key].present?
|
281
|
-
raise(OperationError, "existing subscribe_key #{self_subscribe_key} cannot be overridden at subscribe-time.")
|
282
|
-
else
|
283
|
-
@subscribe_key = (self_subscribe_key || options[:subscribe_key]).to_s
|
284
|
-
end
|
285
|
-
end
|
286
|
-
|
287
|
-
end
|
288
|
-
end
|
data/lib/pubnub/response.rb
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
class Pubnub::Response
|
2
|
-
attr_reader :message, :channel, :timetoken, :status_code
|
3
|
-
attr_reader :response, :path, :query
|
4
|
-
alias :msg :message
|
5
|
-
|
6
|
-
# Creates Pubnub::Response object based on options hash
|
7
|
-
#
|
8
|
-
# Sets @message, @channel, @timetoken, @status_code, :response attributes
|
9
|
-
# @message contains usable single message for callback
|
10
|
-
# @channel contains channel which was used in request
|
11
|
-
# @timetoken contains server timetoken
|
12
|
-
# @status_code contains status code of server response
|
13
|
-
# @response contains whole server response body which was used to build that Pubnub::Response
|
14
|
-
# @headers contains whole server response headers
|
15
|
-
#
|
16
|
-
# To properly init new response object it need :http, :response, :channel options
|
17
|
-
# While you pass :index option it will treat :response as array which size is greater than one
|
18
|
-
# In case you want create your custom error response, you have to pass :error_init option with true value and :message with your message
|
19
|
-
def initialize(options = {})
|
20
|
-
@path = options[:path]
|
21
|
-
@query = options[:query]
|
22
|
-
|
23
|
-
if options[:error_init]
|
24
|
-
@message = options[:message]
|
25
|
-
@response = options[:message]
|
26
|
-
@timetoken = 0
|
27
|
-
else
|
28
|
-
if options[:http].respond_to?(:body) && options[:http].respond_to?(:code) && options[:http].respond_to?(:message) && options[:http].respond_to?(:headers)
|
29
|
-
httparty = true
|
30
|
-
else
|
31
|
-
httparty = false
|
32
|
-
end
|
33
|
-
|
34
|
-
if httparty
|
35
|
-
case options[:operation]
|
36
|
-
when 'publish'
|
37
|
-
set_for_httparty(options)
|
38
|
-
when 'subscribe'
|
39
|
-
set_for_httparty(options)
|
40
|
-
when 'presence'
|
41
|
-
set_for_httparty(options)
|
42
|
-
when 'history'
|
43
|
-
set_for_httparty(options)
|
44
|
-
when 'leave'
|
45
|
-
set_for_httparty(options)
|
46
|
-
when 'here_now'
|
47
|
-
set_for_httparty(options)
|
48
|
-
when 'time'
|
49
|
-
set_for_httparty(options)
|
50
|
-
end
|
51
|
-
else # EM.http_request
|
52
|
-
case options[:operation]
|
53
|
-
when 'publish'
|
54
|
-
set_for_em_http_request(options)
|
55
|
-
when 'subscribe'
|
56
|
-
set_for_em_http_request(options)
|
57
|
-
when 'presence'
|
58
|
-
set_for_em_http_request(options)
|
59
|
-
when 'history'
|
60
|
-
set_for_em_http_request(options)
|
61
|
-
when 'leave'
|
62
|
-
set_for_em_http_request(options)
|
63
|
-
when 'here_now'
|
64
|
-
set_for_em_http_request(options)
|
65
|
-
when 'time'
|
66
|
-
set_for_em_http_request(options)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
# Simple compare to other object basing on string representation of response
|
73
|
-
# (see #to_s)
|
74
|
-
def ==(other)
|
75
|
-
@response == other.to_s
|
76
|
-
end
|
77
|
-
|
78
|
-
private
|
79
|
-
|
80
|
-
def set_for_httparty(options)
|
81
|
-
if options[:response][2] && options[:operation] == 'subscribe'
|
82
|
-
@channel = options[:index] ? options[:response][2].split(',')[options[:index]] : options[:channel]
|
83
|
-
else
|
84
|
-
@channel = options[:channel]
|
85
|
-
end
|
86
|
-
|
87
|
-
if options[:operation] == 'publish'
|
88
|
-
set_for_publish(options[:response][1],options[:response][2])
|
89
|
-
elsif %w(here_now leave).include? options[:operation]
|
90
|
-
@message = options[:response]
|
91
|
-
else
|
92
|
-
@timetoken = options[:response][1]
|
93
|
-
@message = options[:index] ? options[:response][0][options[:index]] : options[:response][0]
|
94
|
-
end
|
95
|
-
|
96
|
-
@status_code = options[:http].response.code
|
97
|
-
@headers = options[:http].headers.inspect
|
98
|
-
@response = options[:http].body
|
99
|
-
end
|
100
|
-
|
101
|
-
def set_for_em_http_request(options)
|
102
|
-
if options[:response][2] && options[:operation] == 'subscribe'
|
103
|
-
@channel = options[:index] ? options[:response][2].split(',')[options[:index]] : options[:channel]
|
104
|
-
else
|
105
|
-
@channel = options[:channel]
|
106
|
-
end
|
107
|
-
|
108
|
-
if options[:operation] == 'publish'
|
109
|
-
set_for_publish(options[:response][1],options[:response][2])
|
110
|
-
elsif %w(here_now leave).include? options[:operation]
|
111
|
-
@message = options[:response]
|
112
|
-
else
|
113
|
-
@timetoken = options[:response][1]
|
114
|
-
@message = options[:index] ? options[:response][0][options[:index]] : options[:response][0]
|
115
|
-
end
|
116
|
-
|
117
|
-
@status_code = options[:http].response_header.status.to_i
|
118
|
-
@headers = options[:http].response_header
|
119
|
-
@response = options[:http].response
|
120
|
-
end
|
121
|
-
|
122
|
-
def set_for_publish(msg, timetoken)
|
123
|
-
@message = msg
|
124
|
-
@timetoken = timetoken
|
125
|
-
end
|
126
|
-
end
|