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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06ed6e50fdf17db0029c08ee733977d86cd818f4
4
- data.tar.gz: 31ab9f18a4c66ad38ef06543fd87e540ea12b605
3
+ metadata.gz: 335ef15119f83b52a8ad14273e3c9ddb5db48650
4
+ data.tar.gz: ca7bc9550e9d68e1c3764f780e7d35592a3c50f0
5
5
  SHA512:
6
- metadata.gz: ad6feb7ce43aba6602885b40137b02346229e5c2b267e3799ef1332bd67ae0c486825945fc8552371d583084421831ed945d351094f4146c258efc84ff72b2f5
7
- data.tar.gz: f4f375dd6a7d1b54d20313125853c077abbef7bccadbd3205fe15a5dff6d3242cbb68e4d4997178d1b6b776ecca07e6087542134f055dd3a662f883b7ba29d1e
6
+ metadata.gz: 6d3652d2db5fff633ec4e622297dffd1979c475a11a6c04b3384e2e1f65369adb9c32d8c8af90c1e85fdcdc0930b1b17588eb862355d3452d044054dd157e1b1
7
+ data.tar.gz: 8b0473322ed443f29728b0521128259d2efba946da4a5cd16c2f1bb6aed140718d88900ab41144c5058a73714b7f9daff99f6caa28844c4853a700d97df8c2a4
@@ -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
- raise Error, "No server specified, ensure private_pub.yml was loaded properly." unless config[:server]
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "peritus_private_pub"
3
- s.version = "1.0.2"
3
+ s.version = "1.0.3"
4
4
  s.author = "Tyler DeWitt"
5
5
  s.email = "tdewitt@peritus.com"
6
6
  s.homepage = "https://github.com/PeritusSolutions/peritus_private_pub"
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.2
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-04-07 00:00:00.000000000 Z
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