crowdskout 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: 842885fbb40fa26b173f6ffe64924d7a69f3442c
4
- data.tar.gz: 3132a480ac36c0d0218fc32cd24aecb3627537d4
3
+ metadata.gz: 9c11e380a90d3eed4822ce3fd700ca4b7731bd34
4
+ data.tar.gz: bd92f540abcdaddf24694a9858a83f70997af221
5
5
  SHA512:
6
- metadata.gz: 61c35db006bf2216a3dc94f6d4ddff5c117711acb5d1b430f1a5199abb7e300950b4146c87daabc8379070566fcfff735120456366e08d28c7df38a8e40ad1f5
7
- data.tar.gz: 3c89c3e1b23789628826782f90f814d02b03499aef3815b7948f17ab22235f66e0c37391251a3158e714885a57c8cdb5cf7853478d9c6b7b991bd1bd15f37ff0
6
+ metadata.gz: e73e26b0550180cc3f53aed283b602b3b4f671c071bbfacbecd96f3d1eca6335cf5c7ba76300ad501dc172626805afe6cedf4f83393e6696c9e9e5cfed0cd50e
7
+ data.tar.gz: 732de1f2827176b0328c65539c7f54f2d84ee0fc5d65703e62409da3a9879b041c093c92da343b1f5782afd03bf8e00fbd494ded9d56458d289ede9e25aa5434
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "crowdskout"
8
- s.version = '0.1.1'
8
+ s.version = '0.1.2'
9
9
  s.platform = Gem::Platform::RUBY
10
10
  s.authors = ["Crowdskout", "Revv","Kyle Schutt"]
11
11
  s.homepage = "https://github.com/revvco/crowdskout"
@@ -29,37 +29,52 @@ module Crowdskout
29
29
  %{
30
30
  <!-- Crowdskout -->
31
31
  <script>
32
- (function(s,k,o,u,t){
33
- s.cs=s.cs||function(){cs.q.push(arguments);};
34
- cs.q=cs.q||[];cs.apiUrl=t;
35
- s.sourceId = #{source};s.clientId = #{client};s.organizationId = #{organization};
36
- var a=k.getElementsByTagName(o)[0];var b=k.createElement(o);b.src=u+'/analytics.js';
37
- b.onreadystatechange = b.onload = function() {
38
- if ((!b.readyState || /loaded|complete/.test(b.readyState))) {
39
- s._csCalledBackup = s._csCalled;
40
- s._csCalled = function(type, body) {
41
- if (type === 'page-view') {
42
- s.cspageviewuuid = body.uuid;
43
- }
44
- if (s._csCalledBackup) {
45
- s._csCalledBackup(type, body);
46
- }
32
+ (function(s,k,o,u,t){
33
+ s.cs=s.cs||function(){cs.q.push(arguments);};
34
+ cs.q=cs.q||[];cs.apiUrl=t;
35
+ s.sourceId = #{source};s.clientId = #{client};s.organizationId = #{organization};
36
+ var a=k.getElementsByTagName(o)[0];var b=k.createElement(o);b.src=u+'/analytics.js';
37
+ b.onreadystatechange = b.onload = function() {
38
+ if ((!b.readyState || /loaded|complete/.test(b.readyState))) {
39
+ s._csCalledBackup = s._csCalled;
40
+ s._csCalled = function(type, body) {
41
+ if (type === 'page-view') {
42
+ s.cspageviewuuid = body.uuid;
43
+ }
44
+ if (s._csCalledBackup) {
45
+ s._csCalledBackup(type, body);
46
+ }
47
47
  };
48
48
  }
49
- };
50
- a.parentNode.insertBefore(b,a);
51
- })(window,document,'script','//s.crowdskout.com','https://a.crowdskout.com');
52
- </script>
53
- }
54
- else
55
- %{
56
- Tracking Codes Error
57
- Source: #{source}
58
- Organization: #{organization}
59
- Client: #{client}
60
- }
49
+ };
50
+ a.parentNode.insertBefore(b,a);
51
+ })(window,document,'script','//s.crowdskout.com','https://a.crowdskout.com');
52
+ </script>
53
+ }
54
+ else
55
+ %{
56
+ Tracking Codes Error
57
+ Source: #{source}
58
+ Organization: #{organization}
59
+ Client: #{client}
60
+ }
61
+ end
61
62
  end
62
- end
63
+
64
+ # Generate the crowdskout tracking source without script tags and minimized based on the codes
65
+ # @return [String] javascript function with the tracking information
66
+ def tracking_code_source_no_script
67
+ if !source.nil? && !organization.nil? && !client.nil?
68
+ script = "(function(s,k,o,u,t){s.cs=s.cs||function(){cs.q.push(arguments);};cs.q=cs.q||[];cs.apiUrl=t;s.sourceId = #{source};s.clientId = #{client};s.organizationId = #{organization};var a=k.getElementsByTagName(o)[0];var b=k.createElement(o);b.src=u+'/analytics.js';b.onreadystatechange = b.onload = function() {if ((!b.readyState || /loaded|complete/.test(b.readyState))) {s._csCalledBackup = s._csCalled;s._csCalled = function(type, body) {if (type === 'page-view') {s.cspageviewuuid = body.uuid;} if (s._csCalledBackup) {s._csCalledBackup(type, body);}};}};a.parentNode.insertBefore(b,a);})(window,document,'script','//s.crowdskout.com','https://a.crowdskout.com');"
69
+ else
70
+ %{
71
+ Tracking Codes Error
72
+ Source: #{source}
73
+ Organization: #{organization}
74
+ Client: #{client}
75
+ }
63
76
  end
64
77
  end
65
- end
78
+ end
79
+ end
80
+ end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Crowdskout
22
- VERSION = '0.1.1'
22
+ VERSION = '0.1.2'
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crowdskout
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
  - Crowdskout