peritus_private_pub 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/peritus_private_pub.rb +4 -1
- data/peritus_private_pub-1.0.2.gem +0 -0
- data/peritus_private_pub.gemspec +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 335ef15119f83b52a8ad14273e3c9ddb5db48650
|
|
4
|
+
data.tar.gz: ca7bc9550e9d68e1c3764f780e7d35592a3c50f0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6d3652d2db5fff633ec4e622297dffd1979c475a11a6c04b3384e2e1f65369adb9c32d8c8af90c1e85fdcdc0930b1b17588eb862355d3452d044054dd157e1b1
|
|
7
|
+
data.tar.gz: 8b0473322ed443f29728b0521128259d2efba946da4a5cd16c2f1bb6aed140718d88900ab41144c5058a73714b7f9daff99f6caa28844c4853a700d97df8c2a4
|
data/lib/peritus_private_pub.rb
CHANGED
|
@@ -32,7 +32,8 @@ module PrivatePub
|
|
|
32
32
|
|
|
33
33
|
# Sends the given message hash to the Faye server using Net::HTTP.
|
|
34
34
|
def publish_message(message)
|
|
35
|
-
|
|
35
|
+
if config[:server].nil? or config[:server].blank?
|
|
36
|
+
raise Error, "No server specified, ensure private_pub.yml was loaded properly and that LOCAL_IP is defined."
|
|
36
37
|
url = URI.parse(config[:server])
|
|
37
38
|
|
|
38
39
|
form = Net::HTTP::Post.new(url.path.empty? ? '/' : url.path)
|
|
@@ -57,6 +58,8 @@ module PrivatePub
|
|
|
57
58
|
# Returns a subscription hash to pass to the PrivatePub.sign call in JavaScript.
|
|
58
59
|
# Any options passed are merged to the hash.
|
|
59
60
|
def subscription(options = {})
|
|
61
|
+
if config[:server].nil? or config[:server].blank?
|
|
62
|
+
raise Error, "No server specified, ensure private_pub.yml was loaded properly and that LOCAL_IP is defined."
|
|
60
63
|
sub = {:server => config[:server], :timestamp => (Time.now.to_f * 1000).round}.merge(options)
|
|
61
64
|
sub[:signature] = Digest::SHA1.hexdigest([config[:secret_token], sub[:channel], sub[:timestamp]].join)
|
|
62
65
|
sub
|
|
Binary file
|
data/peritus_private_pub.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: peritus_private_pub
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tyler DeWitt
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faye
|
|
@@ -85,6 +85,7 @@ files:
|
|
|
85
85
|
- lib/private_pub/engine.rb
|
|
86
86
|
- lib/private_pub/faye_extension.rb
|
|
87
87
|
- lib/private_pub/view_helpers.rb
|
|
88
|
+
- peritus_private_pub-1.0.2.gem
|
|
88
89
|
- peritus_private_pub.gemspec
|
|
89
90
|
- spec/fixtures/private_pub.yml
|
|
90
91
|
- spec/javascripts/private_pub_spec.js
|