metry 2.0.2 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 2.0.3 / 2009-08-08
2
+
3
+ * Really ignore events generated by Psycho.
4
+ * Handle bogus visitor ids.
5
+
1
6
  === 2.0.2 / 2009-08-08
2
7
 
3
8
  * More ObjectID handling.
data/TODO CHANGED
@@ -1,4 +1,12 @@
1
+ Figure out why Psycho events are not being ignored in production
2
+ Allow goals to have N paths
3
+ Limit visitors on dashboard to 10 most recent
4
+ Add full listing of visitors
5
+ Show more details about visitors
6
+ Add referrer to event display on visitor pages
7
+ Add display of last 10 events to dashboard
1
8
  Show goal conversion for each experiment
9
+ Allow manually viewing a particular alternatively
2
10
 
3
11
  Switch to submodules for vendor'd libs
4
12
 
@@ -6,7 +6,7 @@ require 'metry/experiment'
6
6
  require 'metry/psycho'
7
7
 
8
8
  module Metry
9
- VERSION = '2.0.2'
9
+ VERSION = '2.0.3'
10
10
 
11
11
  def self.init(dbname)
12
12
  @storage = Storage.new(dbname)
@@ -14,7 +14,7 @@ module Metry
14
14
 
15
15
  before do
16
16
  if unescape(@request.path_info) =~ /^#{path}/
17
- @request.env["metry.ignore"] = "true"
17
+ @env["metry.event"]["ignore"] = "true"
18
18
  if !auth.call(env)
19
19
  reply = on_deny.call(env)
20
20
  status reply.first
@@ -20,7 +20,7 @@ module Metry
20
20
 
21
21
  save_visitor(response, visitor)
22
22
 
23
- unless env["metry.ignore"] == "true"
23
+ unless event["ignore"] == "true"
24
24
  event["status"] = status.to_s
25
25
  event["visitor"] = visitor['_id'].to_s
26
26
  @storage.add_event(event)
@@ -94,7 +94,11 @@ module Metry
94
94
  elsif id = selector['_id']
95
95
  case id
96
96
  when String
97
- selector['_id'] = ObjectID.from_string(id)
97
+ begin
98
+ selector['_id'] = ObjectID.from_string(id)
99
+ rescue RuntimeError => e
100
+ raise unless e.message =~ /illegal objectid/i
101
+ end
98
102
  end
99
103
  end
100
104
  selector
@@ -15,5 +15,11 @@ class TestTokyo < Test::Unit::TestCase
15
15
  v = @storage.new_visitor
16
16
  assert_equal v, @storage.visitor(v['_id'].to_s)
17
17
  end
18
+
19
+ should "handle bad object ids" do
20
+ assert_nothing_raised do
21
+ assert_nil @storage.visitor('1')
22
+ end
23
+ end
18
24
  end
19
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metry
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathaniel Talbott