hoover 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,7 @@
1
+ ## Version 0.0.4 - Oct 22, 2011
2
+
3
+ * Fix some crashes in the middleware
4
+
1
5
  ## Version 0.0.3 - Oct 22, 2011
2
6
 
3
7
  * Remove Jeweler dependency
@@ -12,6 +12,10 @@ module Hoover
12
12
  ! active_job.nil?
13
13
  end
14
14
 
15
+ def ready_to_post?
16
+ initialized? && active_job.ready_to_post?
17
+ end
18
+
15
19
  def reset!
16
20
  self.active_job = nil
17
21
  end
@@ -1,7 +1,7 @@
1
1
  module Hoover
2
2
  module ActionControllerMethods
3
3
  def set_hoover_logglier(logglier)
4
- before_filter do
4
+ prepend_before_filter do
5
5
  if Hoover.initialized?
6
6
  Hoover.logglier = logglier
7
7
  else
@@ -30,7 +30,9 @@ module Hoover
30
30
  end
31
31
 
32
32
  def after_dispatch(env)
33
- Hoover.flush
33
+ # FIXME: Hoover is often not ready to post, if the before_filter that sets the logglier instance
34
+ # hasn't run. Examples are routing redirects. This will be fixed by proper logglier configuration
35
+ Hoover.flush if Hoover.ready_to_post?
34
36
  end
35
37
  end
36
38
  end
@@ -1,3 +1,3 @@
1
1
  module Hoover
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -33,6 +33,10 @@ describe Hoover do
33
33
  it "is initialized" do
34
34
  Hoover.initialized?.must_equal true
35
35
  end
36
+
37
+ it "isnt ready to post" do
38
+ Hoover.ready_to_post?.must_equal false
39
+ end
36
40
  end
37
41
 
38
42
  describe "initialized with logglier" do
@@ -55,5 +59,9 @@ describe Hoover do
55
59
  Hoover::Job.any_instance.expects(:post)
56
60
  Hoover.flush
57
61
  end
62
+
63
+ it "is ready to post" do
64
+ Hoover.ready_to_post?.must_equal true
65
+ end
58
66
  end
59
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hoover
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-10-22 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logglier
16
- requirement: &70160916621160 !ruby/object:Gem::Requirement
16
+ requirement: &70213345909620 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.2.6
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70160916621160
24
+ version_requirements: *70213345909620
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70160916620240 !ruby/object:Gem::Requirement
27
+ requirement: &70213345909200 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70160916620240
35
+ version_requirements: *70213345909200
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70160916618860 !ruby/object:Gem::Requirement
38
+ requirement: &70213345908540 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70160916618860
46
+ version_requirements: *70213345908540
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
- requirement: &70160916616480 !ruby/object:Gem::Requirement
49
+ requirement: &70213345907880 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70160916616480
57
+ version_requirements: *70213345907880
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mocha
60
- requirement: &70160916615140 !ruby/object:Gem::Requirement
60
+ requirement: &70213345907420 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70160916615140
68
+ version_requirements: *70213345907420
69
69
  description: Sets up a hash at the beginning of each request and flushes it to Loggly
70
70
  at the end of the request. Also comes with standard Rails 3 log subscribers.
71
71
  email: