sugar 0.0.38 → 0.0.39

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.38
1
+ 0.0.39
@@ -1,6 +1,8 @@
1
1
  module Sugar
2
2
  module Actionview
3
3
  module Stats
4
+ # Set online statistics trackers
5
+ # @options
4
6
  def online_stats(options = {})
5
7
  static_includes = []
6
8
  dynamic_includes = ''
@@ -9,20 +11,20 @@ module Sugar
9
11
 
10
12
  if piwik = options.delete(:piwik)
11
13
  static_includes << "//#{piwik[:site]}/piwik.js"
12
- initializers << "var piwikTracker=Piwik.getTracker('#{piwik[:site]}/piwik.php', #{piwik[:id]});piwikTracker.trackPageView();piwikTracker.enableLinkTracking();"
14
+ initializers << "var piwikTracker=Piwik.getTracker('#{piwik[:site]}/piwik.php',#{piwik[:id]});piwikTracker.trackPageView();piwikTracker.enableLinkTracking();"
13
15
  noscript_includes << "//#{piwik[:site]}/piwik.php?idsite=#{piwik[:id]}"
14
16
  end
15
17
 
16
18
  if metrika = options.delete(:metrika)
17
19
  static_includes << '//mc.yandex.ru/resource/watch.js'
18
- initializers << "var yaCounter#{metrika} = new Ya.Metrika(#{metrika});"
20
+ initializers << "var yaCounter#{metrika}=new Ya.Metrika(#{metrika});"
19
21
  noscript_includes << "//mc.yandex.ru/watch/#{metrika}"
20
22
  end
21
23
 
22
24
  if analytics = options.delete(:analytics)
23
25
  dynamic_includes << 'var gaJsHost=("https:"==document.location.protocol)?"https://ssl.":"http://www.";'
24
- dynamic_includes << 'document.write(unescape("%3Cscript src=\'"+gaJsHost+"google-analytics.com/ga.js"\' type=\'text/javascript\'%3E%3C/script%3E));'
25
- initializers << "var pageTracker = _gat._getTracker('#{analytics}'); pageTracker._trackPageview();"
26
+ dynamic_includes << 'document.write(unescape("%3Cscript src=\'"+gaJsHost+"google-analytics.com/ga.js\' type=\'text/javascript\'%3E%3C/script%3Ei"));'
27
+ initializers << "var pageTracker=_gat._getTracker('#{analytics}');pageTracker._trackPageview();"
26
28
  end
27
29
 
28
30
  returning('') do |result|
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sugar}
8
- s.version = "0.0.38"
8
+ s.version = "0.0.39"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Semyonov"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.38
4
+ version: 0.0.39
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Semyonov