alula-plugins 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/alula/plugins/analytics.rb +35 -0
- metadata +3 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'alula/plugin'
|
2
|
+
|
3
|
+
module Alula
|
4
|
+
class Analytics
|
5
|
+
def self.path
|
6
|
+
File.join(File.dirname(__FILE__), %w{.. .. .. plugins analytics})
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.install(options)
|
10
|
+
return false unless options.kind_of?(Hash)
|
11
|
+
|
12
|
+
options.each do |provider, opts|
|
13
|
+
if provider == "gosquared"
|
14
|
+
Alula::Plugin.addon(:body, ->(context) {<<-EOT
|
15
|
+
<script type="text/javascript">
|
16
|
+
var GoSquared={};
|
17
|
+
GoSquared.acct = "#{opts}";
|
18
|
+
(function(w){
|
19
|
+
function gs(){
|
20
|
+
w._gstc_lt=+(new Date); var d=document;
|
21
|
+
var g = d.createElement("script"); g.type = "text/javascript"; g.async = true; g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js";
|
22
|
+
var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s);
|
23
|
+
}
|
24
|
+
w.addEventListener?w.addEventListener("load",gs,false):w.attachEvent("onload",gs);
|
25
|
+
})(window);
|
26
|
+
</script>
|
27
|
+
EOT
|
28
|
+
})
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
Alula::Plugin.register :analytics, Alula::Analytics
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alula-plugins
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: alula
|
@@ -58,6 +58,7 @@ files:
|
|
58
58
|
- VERSION
|
59
59
|
- alula-plugins.gemspec
|
60
60
|
- lib/alula/plugins.rb
|
61
|
+
- lib/alula/plugins/analytics.rb
|
61
62
|
- lib/alula/plugins/disqus.rb
|
62
63
|
- lib/alula/plugins/emphasis.rb
|
63
64
|
- lib/alula/plugins/fancybox.rb
|