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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21bd456cff4450708f26b05a5b92c743de20490c
4
- data.tar.gz: 82ac661411c106c7a7f97de6d75249a82537a520
3
+ metadata.gz: a0df059c391f3d05a2e26b2ffafe9ac94bbf308b
4
+ data.tar.gz: cdb2a198bbafc36f53837322b1369b8a57e82e1d
5
5
  SHA512:
6
- metadata.gz: 9a547715081e57a32ef4dfae69ae1bf69e614130498f64c48fa59404a09b3530ae95ad96c84c8445ec1f7ebc6056f4c8d70069c7d3a3a3b3146ff363d2ab799f
7
- data.tar.gz: f1ff30c183fe154c4660857b8deaa1124399abe255382370224787a270e20f6ac93ebcef365a685c882e9d56139537a370b70b6b56900ede134274d3a65398d4
6
+ metadata.gz: 3c280bcd117515017639656a17fb0ca07127725e5c61735cb5519c9a4dfab24b411f17e5cbcde555773dd6b7cfc4067603a74cfc0aeab825a0774948e24dcb6f
7
+ data.tar.gz: 06ca665da521ac9fa4e701ed86009c3ea8c7860a4fe97257255b915cb4afbef500c67e4bb16939d8ec30ba8a07ba5c1924b8925b404bc2bd4c553a5f2e793578
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2014 Museways
1
+ Copyright 2015 Museways
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
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.
@@ -5,7 +5,7 @@ module Analytics
5
5
 
6
6
  def google_analytics_include_tag(account)
7
7
  if ::Rails.env.production?
8
- script = <<-SCRIPT.strip_heredoc
8
+ script = <<-SCRIPT
9
9
  var _gaq = _gaq || [];
10
10
  _gaq.push(['_setAccount', '#{account}']);
11
11
  _gaq.push(['_trackPageview']);
@@ -1,7 +1,7 @@
1
1
  module Analytics
2
2
  module Rails
3
3
 
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
 
6
6
  end
7
7
  end
@@ -1,6 +1,5 @@
1
1
  require 'analytics/rails/action_view/base'
2
2
  require 'analytics/rails/railtie'
3
- require 'analytics/rails/version'
4
3
 
5
4
  module Analytics
6
5
  module Rails
@@ -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
- config.serve_static_assets = false
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
- config.serve_static_assets = true
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
@@ -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
   (0.0ms) rollback transaction
89
+  (0.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
90
+  (0.1ms) select sqlite_version(*)
91
+  (0.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
92
+  (0.1ms) SELECT version FROM "schema_migrations"
93
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
94
+  (0.1ms) begin transaction
95
+ ------------------------------------------------------
96
+ IncludeTagTest: test_should_return_include_tag_with_id
97
+ ------------------------------------------------------
98
+  (0.0ms) rollback transaction
99
+  (0.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
100
+  (0.1ms) select sqlite_version(*)
101
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
102
+  (0.1ms) SELECT version FROM "schema_migrations"
103
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
104
+  (0.1ms) begin transaction
105
+ ------------------------------------------------------
106
+ IncludeTagTest: test_should_return_include_tag_with_id
107
+ ------------------------------------------------------
108
+  (0.0ms) rollback transaction
109
+  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
110
+  (0.1ms) select sqlite_version(*)
111
+  (0.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
112
+  (0.1ms) SELECT version FROM "schema_migrations"
113
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
114
+  (0.3ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
115
+  (0.1ms) select sqlite_version(*)
116
+  (0.1ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
117
+  (0.1ms) SELECT version FROM "schema_migrations"
118
+  (0.1ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
119
+  (0.1ms) begin transaction
120
+ ---------------------------
121
+ IncludeTagTest: test_tag_id
122
+ ---------------------------
123
+  (0.0ms) rollback transaction
@@ -2,9 +2,9 @@ require 'test_helper'
2
2
 
3
3
  class IncludeTagTest < ActionView::TestCase
4
4
 
5
- test "should return include tag with id" do
5
+ test 'tag id' do
6
6
  with_env 'production' do
7
- assert_equal "<script type=\"text/javascript\">var _gaq = _gaq || [];\n_gaq.push(['_setAccount', 'id']);\n_gaq.push(['_trackPageview']);\n(function(){\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n})();\n</script>", google_analytics_include_tag('id')
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.0
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: 2014-06-09 00:00:00.000000000 Z
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: 3.1.0
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: 3.1.0
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.rdoc
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.2.2
126
+ rubygems_version: 2.4.5
127
127
  signing_key:
128
128
  specification_version: 4
129
- summary: Google Analytics for Rails.
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