analytical 0.16.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.16.0
1
+ 1.0.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 = "0.16.0"
8
+ s.version = "1.0.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"]
12
- s.date = %q{2010-06-17}
12
+ s.date = %q{2010-06-25}
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 = [
@@ -99,7 +99,7 @@ Gem::Specification.new do |s|
99
99
  s.homepage = %q{http://github.com/jkrall/analytical}
100
100
  s.rdoc_options = ["--charset=UTF-8"]
101
101
  s.require_paths = ["lib"]
102
- s.rubygems_version = %q{1.3.6}
102
+ s.rubygems_version = %q{1.3.7}
103
103
  s.summary = %q{Gem for managing multiple analytics services in your rails app.}
104
104
  s.test_files = [
105
105
  "spec/analytical/api_spec.rb",
@@ -115,7 +115,7 @@ Gem::Specification.new do |s|
115
115
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
116
116
  s.specification_version = 3
117
117
 
118
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
118
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
119
119
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
120
120
  s.add_runtime_dependency(%q<activesupport>, [">= 0"])
121
121
  else
@@ -11,9 +11,24 @@ module Analytical
11
11
  @commands = []
12
12
  end
13
13
 
14
+ # This is used to record page-view events, where you want to pass a URL to an analytics service
14
15
  def track(*args); ''; end
16
+
17
+ # Identify provides a unique identifier to an analytics service to keep track of the current user
18
+ # id should be a unique string (depending on which service you use), and some services also
19
+ # make use of a data hash as a second parameters, containing :email=>'test@test.com', for instance
15
20
  def identify(id, *args); ''; end
21
+
22
+ # Event is meant to track important funnel conversions in your app, or other important events
23
+ # that you want to inform a funnel analytics service about. You can pass optional data to this method as well.
16
24
  def event(name, *args); ''; end
25
+
26
+ # Set passes some data to the analytics service that should be attached to the current user identity
27
+ # It can be used to set AB-testing choices and other unique data, so that split testing results can be
28
+ # reported by an analytics service
29
+ def set(data, *args); ''; end
30
+
31
+ # This method generates the initialization javascript that an analytics service uses to track your site
17
32
  def init_javascript(location); {}; end
18
33
 
19
34
  def queue(*args)
@@ -33,6 +33,11 @@ module Analytical
33
33
  "_kmq.push([\"record\", \"#{name}\", #{data.to_json}]);"
34
34
  end
35
35
 
36
+ def set(data, *args)
37
+ return '' if data.blank?
38
+ "_kmq.push([\"set\", #{data.to_json}]);"
39
+ end
40
+
36
41
  end
37
42
  end
38
43
  end
@@ -21,17 +21,23 @@ describe "Analytical::KissMetrics::Api" do
21
21
  end
22
22
  end
23
23
  describe '#identify' do
24
- it 'should return an empty string' do
24
+ it 'should return a js string' do
25
25
  @api = Analytical::KissMetrics::Api.new @parent, {:key=>'abcdef'}
26
26
  @api.identify('id', {:email=>'test@test.com'}).should == "_kmq.push([\"identify\", \"test@test.com\"]);"
27
27
  end
28
28
  end
29
29
  describe '#event' do
30
- it 'should return an empty string' do
30
+ it 'should return a js string' do
31
31
  @api = Analytical::KissMetrics::Api.new @parent, {:key=>'abcdef'}
32
32
  @api.event('Big Deal', {:something=>'good'}).should == "_kmq.push([\"record\", \"Big Deal\", #{{:something=>'good'}.to_json}]);"
33
33
  end
34
34
  end
35
+ describe '#set' do
36
+ it 'should return a js string' do
37
+ @api = Analytical::KissMetrics::Api.new @parent, {:key=>'abcdef'}
38
+ @api.set({:something=>'good', :b=>2}).should == "_kmq.push([\"set\", {\"something\":\"good\",\"b\":2}]);"
39
+ end
40
+ end
35
41
  describe '#init_javascript' do
36
42
  it 'should return the init javascript' do
37
43
  @api = Analytical::KissMetrics::Api.new @parent, {:key=>'abcdef'}
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: analytical
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
7
+ - 1
6
8
  - 0
7
- - 16
8
9
  - 0
9
- version: 0.16.0
10
+ version: 1.0.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Joshua Krall
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-06-17 00:00:00 -05:00
18
+ date: 2010-06-25 00:00:00 -05:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: rspec
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 13
27
30
  segments:
28
31
  - 1
29
32
  - 2
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: activesupport
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 3
41
46
  segments:
42
47
  - 0
43
48
  version: "0"
@@ -141,23 +146,27 @@ rdoc_options:
141
146
  require_paths:
142
147
  - lib
143
148
  required_ruby_version: !ruby/object:Gem::Requirement
149
+ none: false
144
150
  requirements:
145
151
  - - ">="
146
152
  - !ruby/object:Gem::Version
153
+ hash: 3
147
154
  segments:
148
155
  - 0
149
156
  version: "0"
150
157
  required_rubygems_version: !ruby/object:Gem::Requirement
158
+ none: false
151
159
  requirements:
152
160
  - - ">="
153
161
  - !ruby/object:Gem::Version
162
+ hash: 3
154
163
  segments:
155
164
  - 0
156
165
  version: "0"
157
166
  requirements: []
158
167
 
159
168
  rubyforge_project:
160
- rubygems_version: 1.3.6
169
+ rubygems_version: 1.3.7
161
170
  signing_key:
162
171
  specification_version: 3
163
172
  summary: Gem for managing multiple analytics services in your rails app.