pousse 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pousse/version.rb +1 -1
- data/lib/pousse.rb +3 -1
- metadata +1 -1
data/lib/pousse/version.rb
CHANGED
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
|