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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b10b6f1af8faf25a6daf4bedcf5bb46c06572a0f
4
- data.tar.gz: d03480c2eea5ef1ca65578cd6b42cffe4da1f7dc
3
+ metadata.gz: 7b6104e99c53aa7f83c50a07ca44f73a905571f2
4
+ data.tar.gz: b19aa8964105ebd0b51a92d804078435a8de8290
5
5
  SHA512:
6
- metadata.gz: 4af45c64773445afaa08340233e3424e57af54c8a90fdb79819b9ed95e9e51351dc7d6cb72922bff23748026a34ab68cf2a8375a6e5ad6d6aab10247e4f61a9c
7
- data.tar.gz: caa75b8d638a6aebb68ac6639e0176c7df37043ee8849fb17167b262613f5205d76ad4abda1cf9672ba6e9d34699c9b8971c3568b86b99e9b189d1532ba63ff1
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);})('http://#{feeligo_api_hostname}/#{hostname}/loader'+o+'.js');
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] || 'stickersapi.feeligo.com'
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
 
@@ -1,5 +1,5 @@
1
1
  module Feeligo
2
2
  module Stickers
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feeligo-stickers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Feeligo Tech