exception_handling 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07258fd3838c1f4ad88afcc407b5a48c515cc1bb
4
- data.tar.gz: 6bc4a796d301b5739a71b6436a9a3c348f03f2f3
3
+ metadata.gz: ba22d4665ccfec321d2f12cd3dbf965aa470ce0f
4
+ data.tar.gz: 59d92855f4428b245ccafdab96ae2690a8df4be4
5
5
  SHA512:
6
- metadata.gz: 866f948f04a3ac4c2abf81d221c148a6c236692242dbc318743344dc4f8bc5fb14b39ece122895438ba4c7e48305baef130a489c1b5d712399822b9ff5bad448
7
- data.tar.gz: 82e94f9f3eb8030a852a93f341cc7b7694070267edc3773fa74aa3e7e3ac66fbe145a5be242816b20202912016836ebfef6898ea31433b02295920c6e2c35f90
6
+ metadata.gz: ac10edb35d2d2e7ee25fe17aa7df89137452a368c5e95b599ed62a780c02bdf9e5cd9a0bbc334d7cb410dc8320ae8aaf3afbfc995ad489018a1b9e016c9b2a1c
7
+ data.tar.gz: 85c0eb7988d28e5fcbcb6f2e8e66f9a13b25dc8a174f4dff6ab6b414df4eb5dfbe3dfa2a01abaaf8a7e5f05d2416d4f1fc62024e4afc9d58f3340c4f771af94b
data/Rakefile CHANGED
@@ -14,4 +14,5 @@ namespace :test do
14
14
 
15
15
  end
16
16
 
17
- task :default => 'test:unit'
17
+ task :test => 'test:unit'
18
+ task :default => 'test'
@@ -1,3 +1,3 @@
1
1
  module ExceptionHandling
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -232,13 +232,7 @@ EOF
232
232
  #
233
233
  def write_exception_to_log(ex, exception_context, timestamp)
234
234
  ActiveSupport::Deprecation.silence do
235
- ExceptionHandling.logger.fatal(
236
- if ActionView::TemplateError === ex
237
- "#{ex} Error:#{timestamp}"
238
- else
239
- "\n(Error:#{timestamp}) #{ex.class} #{exception_context} (#{ex.message}):\n " + clean_backtrace(ex).join("\n ") + "\n\n"
240
- end
241
- )
235
+ ExceptionHandling.logger.fatal("\n(Error:#{timestamp}) #{ex.class} #{exception_context} (#{ex.message}):\n " + clean_backtrace(ex).join("\n ") + "\n\n")
242
236
  end
243
237
  end
244
238
 
@@ -107,10 +107,15 @@ class ExceptionHandlingTest < ActiveSupport::TestCase
107
107
  end
108
108
 
109
109
  context "ExceptionHandling.ensure_safe" do
110
- should "log an exception if an exception is raised." do
110
+ should "log an exception with call stack if an exception is raised." do
111
111
  mock(ExceptionHandling.logger).fatal(/\(blah\):\n.*exception_handling_test\.rb/)
112
112
  ExceptionHandling.ensure_safe { raise ArgumentError.new("blah") }
113
113
  end
114
+
115
+ should "log an exception with call stack if an ActionView template exception is raised." do
116
+ mock(ExceptionHandling.logger).fatal(/\(Error:\d+\) ActionView::Template::Error \(blah\):\n <no backtrace>/)
117
+ ExceptionHandling.ensure_safe { raise ActionView::TemplateError.new({}, {}, ArgumentError.new("blah")) }
118
+ end
114
119
 
115
120
  should "should not log an exception if an exception is not raised." do
116
121
  dont_allow(ExceptionHandling.logger).fatal
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exception_handling
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Kelley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-24 00:00:00.000000000 Z
11
+ date: 2014-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -216,3 +216,4 @@ test_files:
216
216
  - test/unit/exception_handling/mailer_test.rb
217
217
  - test/unit/exception_handling/methods_test.rb
218
218
  - test/unit/exception_handling_test.rb
219
+ has_rdoc: