pousse 0.0.3 → 0.0.4

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.
Files changed (3) hide show
  1. data/lib/pousse/version.rb +1 -1
  2. data/lib/pousse.rb +3 -1
  3. metadata +1 -1
@@ -1,3 +1,3 @@
1
1
  module Pousse
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/pousse.rb CHANGED
@@ -27,11 +27,13 @@ module Pousse
27
27
  yield configuration
28
28
  end
29
29
 
30
- def js(channels, server, secret = nil)
30
+ def js(channels, server = nil, secret = nil)
31
31
  require 'erb'
32
32
  require 'json'
33
33
  secret ||= configuration.secret
34
34
  raise 'You should configure your secret or specify it.' if secret == nil
35
+ server ||= configuration.server
36
+ raise 'You should configure your secret or specify it.' if server == nil
35
37
  token, iv = Pousse::Crypt.encrypt(channels.to_json, secret)
36
38
  return ERB.new(File.read(TEMPLATE_MIN)).result(binding)
37
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pousse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: