yandex_metrika 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/VERSION +1 -1
- data/lib/yandex/metrika.rb +27 -6
- data/yandex_metrika.gemspec +20 -23
- metadata +41 -44
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 45e66a4eb58c300987991e235d97905a7a23daf5
|
4
|
+
data.tar.gz: c0800d8d6d369320e4f7d9ccc275176fff7327ed
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9fba3c3635efcfaec66ab8c02e44a522d4b9c3c78eeade82460fdca2d863d40787e243312734a844bc75dd01d11d451faf1a84eab4e7bc0455d147d3549b61e9
|
7
|
+
data.tar.gz: 869350b625f2c79c93172e00350c9d6b7842ef434704c451beb8db0d66db662fd47d9b871cfc9e580bb88b14cdbcd731c9ae055f76bb95e04bdfa4fe1709663d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/lib/yandex/metrika.rb
CHANGED
@@ -69,19 +69,40 @@ module Yandex # :nodoc:
|
|
69
69
|
# correctly for the specified format
|
70
70
|
def self.enabled?(format)
|
71
71
|
raise ConfigurationError if counter_id.blank?
|
72
|
-
environments.include?(Rails.env) && formats.include?(format.to_sym)
|
72
|
+
environments.include?(Rails.env) && formats.include?(format.to_s.to_sym)
|
73
73
|
end
|
74
74
|
|
75
75
|
# Construct the javascript code to be inserted on the calling page.
|
76
76
|
def self.code
|
77
77
|
<<-EOHTML
|
78
|
-
<!-- Yandex.Metrika -->
|
79
|
-
<script src="//mc.yandex.ru/resource/watch.js" type="text/javascript"></script>
|
78
|
+
<!-- Yandex.Metrika counter -->
|
80
79
|
<script type="text/javascript">
|
81
|
-
|
80
|
+
(function (d, w, c) {
|
81
|
+
(w[c] = w[c] || []).push(function() {
|
82
|
+
try {
|
83
|
+
w.yaCounter#{counter_id} = new Ya.Metrika({id:#{counter_id},
|
84
|
+
webvisor:true,
|
85
|
+
clickmap:true,
|
86
|
+
trackLinks:true,
|
87
|
+
accurateTrackBounce:true,
|
88
|
+
trackHash:true});
|
89
|
+
} catch(e) { }
|
90
|
+
});
|
91
|
+
|
92
|
+
var n = d.getElementsByTagName("script")[0],
|
93
|
+
s = d.createElement("script"),
|
94
|
+
f = function () { n.parentNode.insertBefore(s, n); };
|
95
|
+
s.type = "text/javascript";
|
96
|
+
s.async = true;
|
97
|
+
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
|
98
|
+
|
99
|
+
if (w.opera == "[object Opera]") {
|
100
|
+
d.addEventListener("DOMContentLoaded", f, false);
|
101
|
+
} else { f(); }
|
102
|
+
})(document, window, "yandex_metrika_callbacks");
|
82
103
|
</script>
|
83
|
-
<noscript><div
|
84
|
-
<!-- /Yandex.Metrika -->
|
104
|
+
<noscript><div><img src="//mc.yandex.ru/watch/#{counter_id}" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
|
105
|
+
<!-- /Yandex.Metrika counter -->
|
85
106
|
EOHTML
|
86
107
|
end
|
87
108
|
end
|
data/yandex_metrika.gemspec
CHANGED
@@ -2,20 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: yandex_metrika 0.0.3 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "0.0.
|
8
|
+
s.name = "yandex_metrika".freeze
|
9
|
+
s.version = "0.0.3"
|
9
10
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
<br/><br
|
15
|
-
|
16
|
-
Yandex::Metrika.counter_id = '123456' <br/>
|
17
|
-
to your `config/environment.rb`, inserting your own COUNTER_ID. This can be discovered by looking at the value of "new Ya.Metrika(123456)" in the Javascript code.}
|
18
|
-
s.email = %q{zed.0xff@gmail.com}
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Andrey 'Zed' Zaikin".freeze]
|
14
|
+
s.date = "2017-04-08"
|
15
|
+
s.description = "[Rails] Easily enable Yandex.Metrika support in your Rails application.\n<br/><br/>\nBy default this gem will output Yandex.Metrika code for every page automagically, if it's configured correctly. This is done by adding: <br/>\nYandex::Metrika.counter_id = '123456' <br/>\nto your `config/environment.rb`, inserting your own COUNTER_ID. This can be discovered by looking at the value of \"new Ya.Metrika(123456)\" in the Javascript code.".freeze
|
16
|
+
s.email = "zed.0xff@gmail.com".freeze
|
19
17
|
s.extra_rdoc_files = [
|
20
18
|
"LICENSE",
|
21
19
|
"README.rdoc"
|
@@ -34,25 +32,24 @@ to your `config/environment.rb`, inserting your own COUNTER_ID. This can be disc
|
|
34
32
|
"test/yandex_metrika_test.rb",
|
35
33
|
"yandex_metrika.gemspec"
|
36
34
|
]
|
37
|
-
s.homepage =
|
38
|
-
s.
|
39
|
-
s.
|
40
|
-
s.
|
41
|
-
s.summary = %q{[Rails] Easily enable Yandex.Metrika support in your Rails application.}
|
35
|
+
s.homepage = "http://github.com/zed-0xff/yandex_metrika".freeze
|
36
|
+
s.rubyforge_project = "yandex-metrika".freeze
|
37
|
+
s.rubygems_version = "2.6.8".freeze
|
38
|
+
s.summary = "[Rails] Easily enable Yandex.Metrika support in your Rails application.".freeze
|
42
39
|
|
43
40
|
if s.respond_to? :specification_version then
|
44
|
-
s.specification_version =
|
41
|
+
s.specification_version = 4
|
45
42
|
|
46
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
47
|
-
s.add_runtime_dependency(%q<actionpack
|
48
|
-
s.add_runtime_dependency(%q<activesupport
|
44
|
+
s.add_runtime_dependency(%q<actionpack>.freeze, [">= 2.3.3"])
|
45
|
+
s.add_runtime_dependency(%q<activesupport>.freeze, [">= 2.3.3"])
|
49
46
|
else
|
50
|
-
s.add_dependency(%q<actionpack
|
51
|
-
s.add_dependency(%q<activesupport
|
47
|
+
s.add_dependency(%q<actionpack>.freeze, [">= 2.3.3"])
|
48
|
+
s.add_dependency(%q<activesupport>.freeze, [">= 2.3.3"])
|
52
49
|
end
|
53
50
|
else
|
54
|
-
s.add_dependency(%q<actionpack
|
55
|
-
s.add_dependency(%q<activesupport
|
51
|
+
s.add_dependency(%q<actionpack>.freeze, [">= 2.3.3"])
|
52
|
+
s.add_dependency(%q<activesupport>.freeze, [">= 2.3.3"])
|
56
53
|
end
|
57
54
|
end
|
58
55
|
|
metadata
CHANGED
@@ -1,39 +1,43 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: yandex_metrika
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Andrey 'Zed' Zaikin
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2017-04-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
16
14
|
name: actionpack
|
17
|
-
|
18
|
-
|
19
|
-
none: false
|
20
|
-
requirements:
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
21
17
|
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
18
|
+
- !ruby/object:Gem::Version
|
23
19
|
version: 2.3.3
|
24
20
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: activesupport
|
28
21
|
prerelease: false
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.3
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
32
31
|
- - ">="
|
33
|
-
- !ruby/object:Gem::Version
|
32
|
+
- !ruby/object:Gem::Version
|
34
33
|
version: 2.3.3
|
35
34
|
type: :runtime
|
36
|
-
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.3.3
|
37
41
|
description: |-
|
38
42
|
[Rails] Easily enable Yandex.Metrika support in your Rails application.
|
39
43
|
<br/><br/>
|
@@ -42,14 +46,12 @@ description: |-
|
|
42
46
|
to your `config/environment.rb`, inserting your own COUNTER_ID. This can be discovered by looking at the value of "new Ya.Metrika(123456)" in the Javascript code.
|
43
47
|
email: zed.0xff@gmail.com
|
44
48
|
executables: []
|
45
|
-
|
46
49
|
extensions: []
|
47
|
-
|
48
|
-
extra_rdoc_files:
|
50
|
+
extra_rdoc_files:
|
49
51
|
- LICENSE
|
50
52
|
- README.rdoc
|
51
|
-
files:
|
52
|
-
- .document
|
53
|
+
files:
|
54
|
+
- ".document"
|
53
55
|
- CREDITS
|
54
56
|
- LICENSE
|
55
57
|
- README.rdoc
|
@@ -63,30 +65,25 @@ files:
|
|
63
65
|
- yandex_metrika.gemspec
|
64
66
|
homepage: http://github.com/zed-0xff/yandex_metrika
|
65
67
|
licenses: []
|
66
|
-
|
68
|
+
metadata: {}
|
67
69
|
post_install_message:
|
68
70
|
rdoc_options: []
|
69
|
-
|
70
|
-
require_paths:
|
71
|
+
require_paths:
|
71
72
|
- lib
|
72
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
-
|
74
|
-
requirements:
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
75
|
- - ">="
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version:
|
78
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
-
|
80
|
-
requirements:
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
81
80
|
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version:
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
84
83
|
requirements: []
|
85
|
-
|
86
84
|
rubyforge_project: yandex-metrika
|
87
|
-
rubygems_version:
|
85
|
+
rubygems_version: 2.6.8
|
88
86
|
signing_key:
|
89
|
-
specification_version:
|
87
|
+
specification_version: 4
|
90
88
|
summary: "[Rails] Easily enable Yandex.Metrika support in your Rails application."
|
91
89
|
test_files: []
|
92
|
-
|