hemju-google-analytics 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/hemju-google-analytics/generators/install_generator.rb +6 -8
- data/lib/hemju-google-analytics/templates/_google_analytics.html.erb.erb +2 -2
- data/lib/hemju-google-analytics/templates/initializer.rb +1 -1
- data/lib/hemju-google-analytics/version.rb +2 -4
- data/lib/hemju-google-analytics.rb +7 -9
- metadata +3 -3
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'rake/testtask'
|
|
7
7
|
|
8
8
|
spec = Gem::Specification.new do |s|
|
9
9
|
s.name = 'hemju-google-analytics'
|
10
|
-
s.version = '0.0.
|
10
|
+
s.version = '0.0.6'
|
11
11
|
s.has_rdoc = true
|
12
12
|
s.extra_rdoc_files = ['README', 'LICENSE']
|
13
13
|
s.summary = "A gem that generates Google Analytics Javascript code."
|
@@ -1,12 +1,10 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
source_root File.expand_path("../templates", __FILE__)
|
1
|
+
module HemjuGoogleAnalytics
|
2
|
+
class InstallGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path("../templates", __FILE__)
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
end
|
5
|
+
# all public methods in here will be run in order
|
6
|
+
def add_my_initializer
|
7
|
+
template "initializer.rb", "config/initializers/google_analytics_initializer.rb"
|
10
8
|
end
|
11
9
|
end
|
12
10
|
end
|
@@ -1,5 +1,5 @@
|
|
1
|
-
<% if
|
1
|
+
<% if HemjuGoogleAnalytics.environments.nil? || HemjuGoogleAnalytics.environments.include?(Rails.env) %>
|
2
2
|
<script type="text/javascript">
|
3
|
-
var _gaq = _gaq || [];_gaq.push(['_setAccount',
|
3
|
+
var _gaq = _gaq || [];_gaq.push(['_setAccount', HemjuGoogleAnalytics.account]);_gaq.push(['_setDomainName', HemjuGoogleAnalytics.domain]);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script');ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';ga.setAttribute('async', 'true');document.documentElement.firstChild.appendChild(ga);})();
|
4
4
|
</script>
|
5
5
|
<% end -%>
|
@@ -1,13 +1,11 @@
|
|
1
|
-
module
|
2
|
-
|
3
|
-
|
4
|
-
attr_accessor :domain
|
1
|
+
module HemjuGoogleAnalytics
|
2
|
+
attr_accessor :account
|
3
|
+
attr_accessor :domain
|
5
4
|
|
6
|
-
|
5
|
+
attr_accessor :production_only
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
7
|
+
def self.setup
|
8
|
+
yield self
|
12
9
|
end
|
10
|
+
|
13
11
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hemju-google-analytics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Helmut Michael Juskewycz
|