analytical 1.4.0 → 1.5.0
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.
- data/VERSION +1 -1
- data/analytical.gemspec +4 -4
- data/lib/analytical/console.rb +16 -5
- metadata +4 -13
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.5.0
|
data/analytical.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{analytical}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.5.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Joshua Krall", "Nathan Phelps"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-27}
|
13
13
|
s.description = %q{Gem for managing multiple analytics services in your rails app.}
|
14
14
|
s.email = %q{josh@transfs.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -106,7 +106,7 @@ Gem::Specification.new do |s|
|
|
106
106
|
s.homepage = %q{http://github.com/jkrall/analytical}
|
107
107
|
s.rdoc_options = ["--charset=UTF-8"]
|
108
108
|
s.require_paths = ["lib"]
|
109
|
-
s.rubygems_version = %q{1.3.
|
109
|
+
s.rubygems_version = %q{1.3.6}
|
110
110
|
s.summary = %q{Gem for managing multiple analytics services in your rails app.}
|
111
111
|
s.test_files = [
|
112
112
|
"spec/analytical/api_spec.rb",
|
@@ -126,7 +126,7 @@ Gem::Specification.new do |s|
|
|
126
126
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
127
127
|
s.specification_version = 3
|
128
128
|
|
129
|
-
if Gem::Version.new(Gem::
|
129
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
130
130
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
131
131
|
s.add_runtime_dependency(%q<activesupport>, [">= 0"])
|
132
132
|
else
|
data/lib/analytical/console.rb
CHANGED
@@ -23,21 +23,32 @@ module Analytical
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def track(*args)
|
26
|
-
check_for_console
|
26
|
+
check_for_console <<-HERE
|
27
|
+
console.log("Analytical Track: "+"#{escape args.first}");
|
28
|
+
HERE
|
27
29
|
end
|
28
30
|
|
29
31
|
def identify(id, *args)
|
30
32
|
data = args.first || {}
|
31
|
-
check_for_console
|
33
|
+
check_for_console <<-HERE
|
34
|
+
console.log("Analytical Identify: "+"#{escape id}");
|
35
|
+
console.log(#{data.to_json});
|
36
|
+
HERE
|
32
37
|
end
|
33
38
|
|
34
39
|
def event(name, *args)
|
35
40
|
data = args.first || {}
|
36
|
-
check_for_console
|
41
|
+
check_for_console <<-HERE
|
42
|
+
console.log("Analytical Event: "+"#{escape name}");
|
43
|
+
console.log(#{data.to_json});
|
44
|
+
HERE
|
37
45
|
end
|
38
46
|
|
39
47
|
def set(data)
|
40
|
-
check_for_console
|
48
|
+
check_for_console <<-HERE
|
49
|
+
console.log("Analytical Set: ");
|
50
|
+
console.log(#{data.to_json});
|
51
|
+
HERE
|
41
52
|
end
|
42
53
|
|
43
54
|
private
|
@@ -53,7 +64,7 @@ module Analytical
|
|
53
64
|
}
|
54
65
|
|
55
66
|
def escape(js)
|
56
|
-
js.gsub(/(\\|<\/|\r\n|[\n\r"'])/) { CONSOLE_JS_ESCAPE_MAP[$1] }
|
67
|
+
js.to_s.gsub(/(\\|<\/|\r\n|[\n\r"'])/) { CONSOLE_JS_ESCAPE_MAP[$1] }
|
57
68
|
end
|
58
69
|
|
59
70
|
def check_for_console(data)
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: analytical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 7
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
|
-
-
|
7
|
+
- 5
|
9
8
|
- 0
|
10
|
-
version: 1.
|
9
|
+
version: 1.5.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Joshua Krall
|
@@ -16,18 +15,16 @@ autorequire:
|
|
16
15
|
bindir: bin
|
17
16
|
cert_chain: []
|
18
17
|
|
19
|
-
date: 2010-08-
|
18
|
+
date: 2010-08-27 00:00:00 -05:00
|
20
19
|
default_executable:
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: rspec
|
24
23
|
prerelease: false
|
25
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
25
|
requirements:
|
28
26
|
- - ">="
|
29
27
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 13
|
31
28
|
segments:
|
32
29
|
- 1
|
33
30
|
- 2
|
@@ -39,11 +36,9 @@ dependencies:
|
|
39
36
|
name: activesupport
|
40
37
|
prerelease: false
|
41
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
42
|
-
none: false
|
43
39
|
requirements:
|
44
40
|
- - ">="
|
45
41
|
- !ruby/object:Gem::Version
|
46
|
-
hash: 3
|
47
42
|
segments:
|
48
43
|
- 0
|
49
44
|
version: "0"
|
@@ -154,27 +149,23 @@ rdoc_options:
|
|
154
149
|
require_paths:
|
155
150
|
- lib
|
156
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
157
|
-
none: false
|
158
152
|
requirements:
|
159
153
|
- - ">="
|
160
154
|
- !ruby/object:Gem::Version
|
161
|
-
hash: 3
|
162
155
|
segments:
|
163
156
|
- 0
|
164
157
|
version: "0"
|
165
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
-
none: false
|
167
159
|
requirements:
|
168
160
|
- - ">="
|
169
161
|
- !ruby/object:Gem::Version
|
170
|
-
hash: 3
|
171
162
|
segments:
|
172
163
|
- 0
|
173
164
|
version: "0"
|
174
165
|
requirements: []
|
175
166
|
|
176
167
|
rubyforge_project:
|
177
|
-
rubygems_version: 1.3.
|
168
|
+
rubygems_version: 1.3.6
|
178
169
|
signing_key:
|
179
170
|
specification_version: 3
|
180
171
|
summary: Gem for managing multiple analytics services in your rails app.
|