tartarus 2.0.1 → 2.0.3

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/.rvmrc CHANGED
@@ -1,2 +1,9 @@
1
- rvm_install_on_use_flag=1
2
- rvm ruby-1.8.7-p302@tartarus
1
+ export rvm_gemset_create_on_use_flag=1
2
+ rvm_gemset_create_on_use_flag=1
3
+ rvm ruby-1.8.7-p334@tartarus
4
+
5
+ if ! command -v bundle ; then
6
+ printf "The rubygem 'bundler' is not installed, installing it now.\n"
7
+ gem install bundler
8
+ fi
9
+
data/Gemfile.lock CHANGED
@@ -101,4 +101,3 @@ DEPENDENCIES
101
101
  rspec-rails (~> 2.3.1)
102
102
  sqlite3-ruby
103
103
  tartarus!
104
- will_paginate (~> 3.0.pre2)
data/Rakefile CHANGED
@@ -9,10 +9,6 @@ require "rspec/core/rake_task"
9
9
  RSpec::Core::RakeTask.new(:spec) do |spec|
10
10
  spec.rspec_opts = ['--color', '--format progress']
11
11
  spec.pattern = 'spec/**/*_spec.rb'
12
- # spec.rcov = true
13
- # spec.rcov_opts = lambda do
14
- # IO.readlines("spec/rcov.opts").map { |l| l.chomp.split " " }.flatten
15
- # end
16
12
  end
17
13
 
18
14
  task :default => :spec
@@ -15,7 +15,7 @@ module Tartarus::Logger
15
15
  def handle_notifications
16
16
  notification_address = Tartarus.configuration['notification_address']
17
17
  return unless notification_address.present?
18
- Tartarus::Notifiers::Mail.deliver_notification( notification_address, self ) if group_count == 1 or (group_count%Tartarus.configuration['notification_threshold']).zero?
18
+ Tartarus::Notifiers::Mail.notification( notification_address, self ).deliver if group_count == 1 or (group_count%Tartarus.configuration['notification_threshold']).zero?
19
19
  end
20
20
 
21
21
  def json_serialize
@@ -1,3 +1,3 @@
1
1
  module Tartarus
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.3"
3
3
  end
@@ -2,6 +2,7 @@ PATH
2
2
  remote: ../../
3
3
  specs:
4
4
  tartarus (2.0.0)
5
+ json (~> 1.4.6)
5
6
  will_paginate (~> 3.0.pre2)
6
7
 
7
8
  GEM
@@ -40,6 +41,7 @@ GEM
40
41
  erubis (2.6.6)
41
42
  abstract (>= 1.0.0)
42
43
  i18n (0.5.0)
44
+ json (1.4.6)
43
45
  mail (2.2.13)
44
46
  activesupport (>= 2.3.6)
45
47
  i18n (>= 0.4.0)
@@ -39,32 +39,35 @@ describe Tartarus::Logger do
39
39
  end
40
40
 
41
41
  describe '#handle_notifications' do
42
- before(:each) do
42
+ before(:each) do
43
+ @notification = stub('notification', :deliver => true)
43
44
  @logged_exception = LoggedException.create(:request => {})
44
45
  Tartarus.stub(:configuration).and_return({ 'notification_threshold' => 10, 'notification_address' => 'test@example.com', 'enabled' => true, "logger_class"=>"LoggedException" })
45
46
  end
46
47
 
47
48
  it 'should return and not deliver notification if there is no address present' do
48
49
  Tartarus.should_receive(:configuration).and_return({ 'enabled' => true, "logger_class"=>"LoggedException" })
49
- Tartarus::Notifiers::Mail.should_receive( :deliver_notification ).never
50
+ Tartarus::Notifiers::Mail.should_receive( :notification ).never
50
51
 
51
52
  @logged_exception.handle_notifications
52
53
  end
53
54
 
54
55
  it 'should send email if there is an address present and the count matches the threshold' do
55
- Tartarus::Notifiers::Mail.should_receive( :deliver_notification ).with( 'test@example.com', @logged_exception )
56
+ Tartarus::Notifiers::Mail.should_receive( :notification ).with( 'test@example.com', @logged_exception ).and_return(@notification)
57
+ @notification.should_receive(:deliver)
56
58
  @logged_exception.stub( :group_count ).and_return( 20 )
57
59
  @logged_exception.handle_notifications
58
60
  end
59
61
 
60
62
  it 'should send email if there is an address present and it is the first exception in a group' do
61
- Tartarus::Notifiers::Mail.should_receive( :deliver_notification ).with( 'test@example.com', @logged_exception )
63
+ Tartarus::Notifiers::Mail.should_receive( :notification ).with( 'test@example.com', @logged_exception ).and_return(@notification)
64
+ @notification.should_receive(:deliver)
62
65
  @logged_exception.stub( :group_count ).and_return( 1 )
63
66
  @logged_exception.handle_notifications
64
67
  end
65
68
 
66
69
  it 'should not send email if there is an address present and the count does not match the threshold' do
67
- Tartarus::Notifiers::Mail.should_receive( :deliver_notification ).never
70
+ Tartarus::Notifiers::Mail.should_receive( :notification ).never
68
71
  @logged_exception.stub( :group_count ).and_return( 22 )
69
72
  @logged_exception.handle_notifications
70
73
  end
data/tartarus.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{tartarus}
3
- s.version = "2.0.1"
3
+ s.version = "2.0.3"
4
4
  s.platform = Gem::Platform::RUBY
5
5
 
6
6
  s.authors = ["Daniel Insley"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tartarus
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
5
- prerelease: false
4
+ hash: 9
5
+ prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 1
10
- version: 2.0.1
9
+ - 3
10
+ version: 2.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Daniel Insley
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-17 00:00:00 -08:00
18
+ date: 2011-06-30 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,11 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: -1876988247
29
+ hash: 1923831917
30
30
  segments:
31
31
  - 3
32
32
  - 0
33
- - pre2
33
+ - pre
34
+ - 2
34
35
  version: 3.0.pre2
35
36
  type: :runtime
36
37
  version_requirements: *id001
@@ -174,7 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
175
  requirements: []
175
176
 
176
177
  rubyforge_project:
177
- rubygems_version: 1.3.7
178
+ rubygems_version: 1.6.2
178
179
  signing_key:
179
180
  specification_version: 3
180
181
  summary: Exception Logging for Rails