analytics-rails 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +34 -0
- data/lib/analytics/rails/action_view/base.rb +1 -1
- data/lib/analytics/rails/version.rb +1 -1
- data/lib/analytics/rails.rb +0 -1
- data/test/dummy/config/environments/production.rb +5 -1
- data/test/dummy/config/environments/test.rb +9 -1
- data/test/dummy/log/test.log +35 -0
- data/test/include_tag_test.rb +2 -2
- metadata +11 -12
- data/README.rdoc +0 -24
- data/test/dummy/app/views/pages/index.html.erb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0df059c391f3d05a2e26b2ffafe9ac94bbf308b
|
4
|
+
data.tar.gz: cdb2a198bbafc36f53837322b1369b8a57e82e1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c280bcd117515017639656a17fb0ca07127725e5c61735cb5519c9a4dfab24b411f17e5cbcde555773dd6b7cfc4067603a74cfc0aeab825a0774948e24dcb6f
|
7
|
+
data.tar.gz: 06ca665da521ac9fa4e701ed86009c3ea8c7860a4fe97257255b915cb4afbef500c67e4bb16939d8ec30ba8a07ba5c1924b8925b404bc2bd4c553a5f2e793578
|
data/MIT-LICENSE
CHANGED
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/analytics-rails.svg)](http://badge.fury.io/rb/analytics-rails) [![Code Climate](https://codeclimate.com/github/museways/analytics-rails/badges/gpa.svg)](https://codeclimate.com/github/museways/analytics-rails) [![Build Status](https://travis-ci.org/museways/analytics-rails.svg?branch=master)](https://travis-ci.org/museways/analytics-rails) [![Dependency Status](https://gemnasium.com/museways/analytics-rails.svg)](https://gemnasium.com/museways/analytics-rails)
|
2
|
+
|
3
|
+
# Analytics Rails
|
4
|
+
|
5
|
+
Adds a simple helper to create the google analytics include tag.
|
6
|
+
|
7
|
+
## Install
|
8
|
+
|
9
|
+
Put this line in your Gemfile:
|
10
|
+
```ruby
|
11
|
+
gem 'analytics-rails'
|
12
|
+
```
|
13
|
+
|
14
|
+
Then bundle:
|
15
|
+
```
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
In your layout add a line like this in your head:
|
22
|
+
```erb
|
23
|
+
<%= google_analytics_include_tag 'your-id' %>
|
24
|
+
```
|
25
|
+
|
26
|
+
NOTE: Will only show the include tag in production environment.
|
27
|
+
|
28
|
+
## Credits
|
29
|
+
|
30
|
+
This gem is maintained and funded by [museways](http://museways.com).
|
31
|
+
|
32
|
+
## License
|
33
|
+
|
34
|
+
It is free software, and may be redistributed under the terms specified in the MIT-LICENSE file.
|
data/lib/analytics/rails.rb
CHANGED
@@ -20,7 +20,11 @@ Dummy::Application.configure do
|
|
20
20
|
# config.action_dispatch.rack_cache = true
|
21
21
|
|
22
22
|
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
-
|
23
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
24
|
+
config.serve_static_files = false
|
25
|
+
else
|
26
|
+
config.serve_static_assets = false
|
27
|
+
end
|
24
28
|
|
25
29
|
# Compress JavaScripts and CSS.
|
26
30
|
config.assets.js_compressor = :uglifier
|
@@ -13,7 +13,11 @@ Dummy::Application.configure do
|
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
|
16
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
17
|
+
config.serve_static_files = false
|
18
|
+
else
|
19
|
+
config.serve_static_assets = false
|
20
|
+
end
|
17
21
|
config.static_cache_control = "public, max-age=3600"
|
18
22
|
|
19
23
|
# Show full error reports and disable caching.
|
@@ -33,4 +37,8 @@ Dummy::Application.configure do
|
|
33
37
|
|
34
38
|
# Print deprecation notices to the stderr.
|
35
39
|
config.active_support.deprecation = :stderr
|
40
|
+
|
41
|
+
if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR >= 2
|
42
|
+
config.active_support.test_order = :random
|
43
|
+
end
|
36
44
|
end
|
data/test/dummy/log/test.log
CHANGED
@@ -86,3 +86,38 @@ Completed 200 OK in 13ms (Views: 12.5ms | ActiveRecord: 0.0ms)
|
|
86
86
|
IncludeTagTest: test_should_return_include_tag
|
87
87
|
----------------------------------------------
|
88
88
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
89
|
+
[1m[36m (0.2ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
90
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
91
|
+
[1m[36m (0.2ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
92
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
93
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
94
|
+
[1m[35m (0.1ms)[0m begin transaction
|
95
|
+
------------------------------------------------------
|
96
|
+
IncludeTagTest: test_should_return_include_tag_with_id
|
97
|
+
------------------------------------------------------
|
98
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
99
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
100
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
101
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
102
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
103
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
104
|
+
[1m[35m (0.1ms)[0m begin transaction
|
105
|
+
------------------------------------------------------
|
106
|
+
IncludeTagTest: test_should_return_include_tag_with_id
|
107
|
+
------------------------------------------------------
|
108
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
109
|
+
[1m[36m (0.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
110
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
111
|
+
[1m[36m (0.3ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
112
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
113
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
114
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar NOT NULL) [0m
|
115
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
116
|
+
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
117
|
+
[1m[35m (0.1ms)[0m SELECT version FROM "schema_migrations"
|
118
|
+
[1m[36m (0.1ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('0')[0m
|
119
|
+
[1m[35m (0.1ms)[0m begin transaction
|
120
|
+
---------------------------
|
121
|
+
IncludeTagTest: test_tag_id
|
122
|
+
---------------------------
|
123
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
data/test/include_tag_test.rb
CHANGED
@@ -2,9 +2,9 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
class IncludeTagTest < ActionView::TestCase
|
4
4
|
|
5
|
-
test
|
5
|
+
test 'tag id' do
|
6
6
|
with_env 'production' do
|
7
|
-
|
7
|
+
assert google_analytics_include_tag('id').include?("_gaq.push(['_setAccount', 'id']);")
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analytics-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Museways
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,8 +16,8 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
- - "
|
19
|
+
version: 4.0.0
|
20
|
+
- - "<="
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 4.2.0
|
23
23
|
type: :runtime
|
@@ -26,8 +26,8 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
30
|
-
- - "
|
29
|
+
version: 4.0.0
|
30
|
+
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 4.2.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
@@ -44,7 +44,8 @@ dependencies:
|
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '1.3'
|
47
|
-
description: Adds a simple view helper to create the google analytics include tag
|
47
|
+
description: Adds a simple view helper to create the google analytics include tag
|
48
|
+
in rails.
|
48
49
|
email:
|
49
50
|
- hello@museways.com
|
50
51
|
executables: []
|
@@ -52,7 +53,7 @@ extensions: []
|
|
52
53
|
extra_rdoc_files: []
|
53
54
|
files:
|
54
55
|
- MIT-LICENSE
|
55
|
-
- README.
|
56
|
+
- README.md
|
56
57
|
- Rakefile
|
57
58
|
- lib/analytics-rails.rb
|
58
59
|
- lib/analytics/rails.rb
|
@@ -66,7 +67,6 @@ files:
|
|
66
67
|
- test/dummy/app/controllers/application_controller.rb
|
67
68
|
- test/dummy/app/helpers/application_helper.rb
|
68
69
|
- test/dummy/app/views/layouts/application.html.erb
|
69
|
-
- test/dummy/app/views/pages/index.html.erb
|
70
70
|
- test/dummy/bin/bundle
|
71
71
|
- test/dummy/bin/rails
|
72
72
|
- test/dummy/bin/rake
|
@@ -123,17 +123,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.4.5
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
|
-
summary: Google
|
129
|
+
summary: Google analytics for rails.
|
130
130
|
test_files:
|
131
131
|
- test/dummy/app/assets/javascripts/application.js
|
132
132
|
- test/dummy/app/assets/stylesheets/application.css
|
133
133
|
- test/dummy/app/controllers/application_controller.rb
|
134
134
|
- test/dummy/app/helpers/application_helper.rb
|
135
135
|
- test/dummy/app/views/layouts/application.html.erb
|
136
|
-
- test/dummy/app/views/pages/index.html.erb
|
137
136
|
- test/dummy/bin/bundle
|
138
137
|
- test/dummy/bin/rails
|
139
138
|
- test/dummy/bin/rake
|
data/README.rdoc
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
=== WARNING: From version 0.0.8 and above the include tag will only be show in production environment.
|
2
|
-
|
3
|
-
---
|
4
|
-
|
5
|
-
{<img src="https://badge.fury.io/rb/analytics-rails.png" alt="Gem Version" />}[http://badge.fury.io/rb/analytics-rails] {<img src="https://codeclimate.com/github/museways/analytics-rails.png" />}[https://codeclimate.com/github/museways/analytics-rails] {<img src="https://travis-ci.org/museways/analytics-rails.png?branch=master" alt="Build Status" />}[https://travis-ci.org/museways/analytics-rails] {<img src="https://gemnasium.com/museways/analytics-rails.png" alt="Dependency Status" />}[https://gemnasium.com/museways/analytics-rails]
|
6
|
-
|
7
|
-
= Analytics Rails
|
8
|
-
|
9
|
-
Adds a simple helper to create the google analytics include tag.
|
10
|
-
|
11
|
-
= Install
|
12
|
-
|
13
|
-
Put this line in your Gemfile:
|
14
|
-
gem 'analytics-rails'
|
15
|
-
|
16
|
-
Then bundle:
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
= Usage
|
20
|
-
|
21
|
-
In your layout add a line like this in your head:
|
22
|
-
<%= google_analytics_include_tag 'your-id' %>
|
23
|
-
|
24
|
-
(Will only show the include tag in production)
|
File without changes
|