hoover 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## Version 0.0.2 - Oct 22, 2011
2
+
3
+ * Fix for Rails functional testing
4
+
1
5
  ## Version 0.0.1 - Oct 22, 2011
2
6
 
3
7
  * Initial release
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/hoover.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{hoover}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Gabe da Silveira}]
@@ -62,6 +62,14 @@ Gem::Specification.new do |s|
62
62
  s.add_development_dependency(%q<bundler>, [">= 0"])
63
63
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
64
64
  s.add_development_dependency(%q<mocha>, [">= 0"])
65
+ s.add_development_dependency(%q<minitest>, [">= 0"])
66
+ s.add_development_dependency(%q<bundler>, [">= 0"])
67
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
68
+ s.add_development_dependency(%q<mocha>, [">= 0"])
69
+ s.add_development_dependency(%q<minitest>, [">= 0"])
70
+ s.add_development_dependency(%q<bundler>, [">= 0"])
71
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
72
+ s.add_development_dependency(%q<mocha>, [">= 0"])
65
73
  s.add_runtime_dependency(%q<logglier>, ["~> 0.2.6"])
66
74
  else
67
75
  s.add_dependency(%q<hoover>, [">= 0"])
@@ -76,6 +84,14 @@ Gem::Specification.new do |s|
76
84
  s.add_dependency(%q<bundler>, [">= 0"])
77
85
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
78
86
  s.add_dependency(%q<mocha>, [">= 0"])
87
+ s.add_dependency(%q<minitest>, [">= 0"])
88
+ s.add_dependency(%q<bundler>, [">= 0"])
89
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
90
+ s.add_dependency(%q<mocha>, [">= 0"])
91
+ s.add_dependency(%q<minitest>, [">= 0"])
92
+ s.add_dependency(%q<bundler>, [">= 0"])
93
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
94
+ s.add_dependency(%q<mocha>, [">= 0"])
79
95
  s.add_dependency(%q<logglier>, ["~> 0.2.6"])
80
96
  end
81
97
  else
@@ -91,6 +107,14 @@ Gem::Specification.new do |s|
91
107
  s.add_dependency(%q<bundler>, [">= 0"])
92
108
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
93
109
  s.add_dependency(%q<mocha>, [">= 0"])
110
+ s.add_dependency(%q<minitest>, [">= 0"])
111
+ s.add_dependency(%q<bundler>, [">= 0"])
112
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
113
+ s.add_dependency(%q<mocha>, [">= 0"])
114
+ s.add_dependency(%q<minitest>, [">= 0"])
115
+ s.add_dependency(%q<bundler>, [">= 0"])
116
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
117
+ s.add_dependency(%q<mocha>, [">= 0"])
94
118
  s.add_dependency(%q<logglier>, ["~> 0.2.6"])
95
119
  end
96
120
  end
data/lib/hoover.rb CHANGED
@@ -8,6 +8,10 @@ module Hoover
8
8
  self.active_job = Job.new(logglier)
9
9
  end
10
10
 
11
+ def initialized?
12
+ ! active_job.nil?
13
+ end
14
+
11
15
  def reset!
12
16
  self.active_job = nil
13
17
  end
@@ -1,7 +1,13 @@
1
1
  module Hoover
2
2
  module ActionControllerMethods
3
3
  def set_hoover_logglier(logglier)
4
- before_filter { Hoover.logglier = logglier }
4
+ before_filter do
5
+ if Hoover.initialized?
6
+ Hoover.logglier = logglier
7
+ else
8
+ Hoover.init(logglier)
9
+ end
10
+ end
5
11
  end
6
12
  end
7
13
  end
data/spec/hoover_spec.rb CHANGED
@@ -4,11 +4,11 @@ describe Hoover do
4
4
  after { Hoover.reset! }
5
5
 
6
6
  describe "unitialized" do
7
- it "should not allow add" do
7
+ it "doesnt allow add" do
8
8
  proc{ Hoover.add(:key => 'val') }.must_raise RuntimeError, "Must init Hoover before calling add"
9
9
  end
10
10
 
11
- it "should not allow setting logglier" do
11
+ it "allows setting logglier" do
12
12
  proc{ Hoover.logglier = nil }.must_raise RuntimeError, "Must init Hoover before setting logglier"
13
13
  end
14
14
  end
@@ -16,19 +16,23 @@ describe Hoover do
16
16
  describe "initialized wo logglier" do
17
17
  before { Hoover.init }
18
18
 
19
- it "should allow add" do
19
+ it "allows add" do
20
20
  Hoover::Job.any_instance.expects(:add).with({})
21
21
  Hoover.add({})
22
22
  end
23
23
 
24
- it "should allow setting logglier" do
24
+ it "allows setting logglier" do
25
25
  logglier = Object.new
26
26
  (Hoover.logglier = logglier).must_equal logglier
27
27
  end
28
28
 
29
- it "should not allow flushing" do
29
+ it "doesnt allow flushing" do
30
30
  proc{ Hoover.flush }.must_raise RuntimeError, "Hoover.logglier must be set before calling flush"
31
31
  end
32
+
33
+ it "is initialized" do
34
+ Hoover.initialized?.must_equal true
35
+ end
32
36
  end
33
37
 
34
38
  describe "initialized with logglier" do
@@ -37,17 +41,17 @@ describe Hoover do
37
41
  Hoover.init(@logglier)
38
42
  end
39
43
 
40
- it "should allow add" do
44
+ it "allows add" do
41
45
  Hoover::Job.any_instance.expects(:add).with({})
42
46
  Hoover.add({})
43
47
  end
44
48
 
45
- it "should allow setting logglier" do
49
+ it "allows setting logglier" do
46
50
  logglier = Object.new
47
51
  (Hoover.logglier = logglier).must_equal logglier
48
52
  end
49
53
 
50
- it "should allow flush" do
54
+ it "allows flush" do
51
55
  Hoover::Job.any_instance.expects(:post)
52
56
  Hoover.flush
53
57
  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.1
4
+ version: 0.0.2
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: hoover
16
- requirement: &70125973944240 !ruby/object:Gem::Requirement
16
+ requirement: &70365960338100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70125973944240
24
+ version_requirements: *70365960338100
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &70125973942960 !ruby/object:Gem::Requirement
27
+ requirement: &70365960337560 !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: *70125973942960
35
+ version_requirements: *70365960337560
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70125973941140 !ruby/object:Gem::Requirement
38
+ requirement: &70365960336720 !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: *70125973941140
46
+ version_requirements: *70365960336720
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: jeweler
49
- requirement: &70125973940420 !ruby/object:Gem::Requirement
49
+ requirement: &70365960336100 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.6.4
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70125973940420
57
+ version_requirements: *70365960336100
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: minitest
60
- requirement: &70125973937200 !ruby/object:Gem::Requirement
60
+ requirement: &70365960335440 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70125973937200
68
+ version_requirements: *70365960335440
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
- requirement: &70125973935440 !ruby/object:Gem::Requirement
71
+ requirement: &70365960334820 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70125973935440
79
+ version_requirements: *70365960334820
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: jeweler
82
- requirement: &70125973934320 !ruby/object:Gem::Requirement
82
+ requirement: &70365960334120 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.6.4
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70125973934320
90
+ version_requirements: *70365960334120
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: mocha
93
- requirement: &70125973933000 !ruby/object:Gem::Requirement
93
+ requirement: &70365960316020 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: '0'
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70125973933000
101
+ version_requirements: *70365960316020
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: minitest
104
- requirement: &70125973931780 !ruby/object:Gem::Requirement
104
+ requirement: &70365960315140 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ! '>='
@@ -109,10 +109,10 @@ dependencies:
109
109
  version: '0'
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70125973931780
112
+ version_requirements: *70365960315140
113
113
  - !ruby/object:Gem::Dependency
114
114
  name: bundler
115
- requirement: &70125973930200 !ruby/object:Gem::Requirement
115
+ requirement: &70365960314340 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ! '>='
@@ -120,10 +120,10 @@ dependencies:
120
120
  version: '0'
121
121
  type: :development
122
122
  prerelease: false
123
- version_requirements: *70125973930200
123
+ version_requirements: *70365960314340
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: jeweler
126
- requirement: &70125973929040 !ruby/object:Gem::Requirement
126
+ requirement: &70365960313000 !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
129
129
  - - ~>
@@ -131,10 +131,10 @@ dependencies:
131
131
  version: 1.6.4
132
132
  type: :development
133
133
  prerelease: false
134
- version_requirements: *70125973929040
134
+ version_requirements: *70365960313000
135
135
  - !ruby/object:Gem::Dependency
136
136
  name: mocha
137
- requirement: &70125973927380 !ruby/object:Gem::Requirement
137
+ requirement: &70365960311900 !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
140
140
  - - ! '>='
@@ -142,10 +142,98 @@ dependencies:
142
142
  version: '0'
143
143
  type: :development
144
144
  prerelease: false
145
- version_requirements: *70125973927380
145
+ version_requirements: *70365960311900
146
+ - !ruby/object:Gem::Dependency
147
+ name: minitest
148
+ requirement: &70365960311080 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: *70365960311080
157
+ - !ruby/object:Gem::Dependency
158
+ name: bundler
159
+ requirement: &70365960309720 !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ type: :development
166
+ prerelease: false
167
+ version_requirements: *70365960309720
168
+ - !ruby/object:Gem::Dependency
169
+ name: jeweler
170
+ requirement: &70365960308360 !ruby/object:Gem::Requirement
171
+ none: false
172
+ requirements:
173
+ - - ~>
174
+ - !ruby/object:Gem::Version
175
+ version: 1.6.4
176
+ type: :development
177
+ prerelease: false
178
+ version_requirements: *70365960308360
179
+ - !ruby/object:Gem::Dependency
180
+ name: mocha
181
+ requirement: &70365960306540 !ruby/object:Gem::Requirement
182
+ none: false
183
+ requirements:
184
+ - - ! '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
187
+ type: :development
188
+ prerelease: false
189
+ version_requirements: *70365960306540
190
+ - !ruby/object:Gem::Dependency
191
+ name: minitest
192
+ requirement: &70365960305520 !ruby/object:Gem::Requirement
193
+ none: false
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: *70365960305520
201
+ - !ruby/object:Gem::Dependency
202
+ name: bundler
203
+ requirement: &70365960303980 !ruby/object:Gem::Requirement
204
+ none: false
205
+ requirements:
206
+ - - ! '>='
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ type: :development
210
+ prerelease: false
211
+ version_requirements: *70365960303980
212
+ - !ruby/object:Gem::Dependency
213
+ name: jeweler
214
+ requirement: &70365960303220 !ruby/object:Gem::Requirement
215
+ none: false
216
+ requirements:
217
+ - - ~>
218
+ - !ruby/object:Gem::Version
219
+ version: 1.6.4
220
+ type: :development
221
+ prerelease: false
222
+ version_requirements: *70365960303220
223
+ - !ruby/object:Gem::Dependency
224
+ name: mocha
225
+ requirement: &70365960302320 !ruby/object:Gem::Requirement
226
+ none: false
227
+ requirements:
228
+ - - ! '>='
229
+ - !ruby/object:Gem::Version
230
+ version: '0'
231
+ type: :development
232
+ prerelease: false
233
+ version_requirements: *70365960302320
146
234
  - !ruby/object:Gem::Dependency
147
235
  name: logglier
148
- requirement: &70125973926280 !ruby/object:Gem::Requirement
236
+ requirement: &70365960301000 !ruby/object:Gem::Requirement
149
237
  none: false
150
238
  requirements:
151
239
  - - ~>
@@ -153,7 +241,7 @@ dependencies:
153
241
  version: 0.2.6
154
242
  type: :runtime
155
243
  prerelease: false
156
- version_requirements: *70125973926280
244
+ version_requirements: *70365960301000
157
245
  description: Sets up a hash at the beginning of each request and flushes it to Loggly
158
246
  at the end of the request. Also comes with standard Rails 3 log subscribers.
159
247
  email: gabe@websaviour.com
@@ -200,7 +288,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
288
  version: '0'
201
289
  segments:
202
290
  - 0
203
- hash: -2345653166920222009
291
+ hash: 3830252192841504047
204
292
  required_rubygems_version: !ruby/object:Gem::Requirement
205
293
  none: false
206
294
  requirements: