feeligo-stickers 0.1.1 → 0.1.2
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/feeligo/stickers/loader_script_tag.rb +14 -3
- data/lib/feeligo/stickers/version.rb +1 -1
- data/spec/feeligo/stickers_spec.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b6104e99c53aa7f83c50a07ca44f73a905571f2
|
|
4
|
+
data.tar.gz: b19aa8964105ebd0b51a92d804078435a8de8290
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe92353429f27db0b91b91b235897ba95c229a3157060eeadf631061f24a97945cd238ce3dd0b3c381f383202bcfbd9abca410b99d5237c330f27885674832c5
|
|
7
|
+
data.tar.gz: 46c999c13e1d95174ea55ab6171670f5e287b538866ee45493bd7402f19fad4709fdea705977c6608c1ec7e65045bd128303a431d96340f62fc1f289c32fdaab
|
|
@@ -27,7 +27,7 @@ protected
|
|
|
27
27
|
(function(f,ee,l,i,g,o){f[l]=f[l]||{};o&&(o+='').length?(f[l].context={viewer:
|
|
28
28
|
{id:o},platform:{name:i,version:g}})&&(o='-'+o):(o='');(function(s,t,k,r){
|
|
29
29
|
t=ee.createElement(r='script');k=ee.getElementsByTagName(r)[0];t.async=1;t.src=s;
|
|
30
|
-
k.parentNode.insertBefore(t,k);})('
|
|
30
|
+
k.parentNode.insertBefore(t,k);})('#{protocol}://#{feeligo_api_hostname}/#{hostname}/loader'+o+'.js');
|
|
31
31
|
f[l].q=[];f[l].on=function(s,t,k){f[l].q.push([s,t,k])};
|
|
32
32
|
})(window,document,'flg','#{product}','#{version}'#{user_id});
|
|
33
33
|
JS
|
|
@@ -45,9 +45,20 @@ protected
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
# The hostname of Feeligo's API
|
|
48
|
-
# defaults to stickersapi.feeligo.com
|
|
48
|
+
# defaults to stickersapi.feeligo.com, or stickersapissl.feeligo.com if https
|
|
49
49
|
def feeligo_api_hostname
|
|
50
|
-
@opts[:feeligo_api_hostname] ||
|
|
50
|
+
@opts[:feeligo_api_hostname] || if protocol.to_s == 'https'
|
|
51
|
+
'stickersapissl.feeligo.com'
|
|
52
|
+
else
|
|
53
|
+
'stickersapi.feeligo.com'
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# The protocol used to load the loader script
|
|
59
|
+
# defaults to http
|
|
60
|
+
def protocol
|
|
61
|
+
@opts[:protocol] || 'http'
|
|
51
62
|
end
|
|
52
63
|
|
|
53
64
|
|
|
@@ -52,6 +52,16 @@ describe Feeligo::Stickers do
|
|
|
52
52
|
let(:user_id){0}
|
|
53
53
|
it_behaves_like "it ignores the user_id"
|
|
54
54
|
end
|
|
55
|
+
context "with https protocol" do
|
|
56
|
+
it "sets https as the protocol of the loader's URL" do
|
|
57
|
+
js = subject::loader_script_tag protocol: 'https'
|
|
58
|
+
js[/https:\/\//].should_not be_nil
|
|
59
|
+
end
|
|
60
|
+
it "uses stickersapissl.feeligo.com by default" do
|
|
61
|
+
js = subject::loader_script_tag protocol: 'https'
|
|
62
|
+
js[/https:\/\/stickersapissl.feeligo.com/].should_not be_nil
|
|
63
|
+
end
|
|
64
|
+
end
|
|
55
65
|
end
|
|
56
66
|
|
|
57
67
|
end
|