subelsky_power_tools 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/lib/subelsky_power_tools/ext/exception.rb +5 -0
- data/lib/subelsky_power_tools/version.rb +1 -1
- data/spec/lib/ext/exception_spec.rb +9 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c27fd47fa9847c7cc2bef1defca3ffc73b826c6
|
4
|
+
data.tar.gz: a837d3a02e6b69ab1143932afecf0f28c58aceb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb465667a864089bb31aaaf3a9e2527c921d0a75c04d0422f0882e6879d1bef3628caddb8f8dfd47b553eec117e7091eb9dcc2a3d6b7999ac0d9ec3b865b37b2
|
7
|
+
data.tar.gz: 128a9dfd469a2e13ce48c57ea55ef4bfa57f54ec3494a5804b39f59509a70bc09b3093342b986ee8eb774ead13586ee08b8f7c3f3052043ca2ac1743cfa11848
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0-p576
|
@@ -12,8 +12,13 @@ class Exception
|
|
12
12
|
#
|
13
13
|
# CREDIT: George Moschovitis
|
14
14
|
|
15
|
+
# @return [String] long description of the error including backtrace
|
15
16
|
def detail
|
16
17
|
return %{#{self.class.name}: #{message}\n#{backtrace.join("\n ")}\n LOGGED FROM: #{caller[0]}}
|
17
18
|
end
|
18
19
|
|
20
|
+
# @return [String] exception class and message, useful for logging
|
21
|
+
def summary
|
22
|
+
"#{self.class.name}: #{message}"
|
23
|
+
end
|
19
24
|
end
|
@@ -2,11 +2,19 @@ require "spec_helper"
|
|
2
2
|
require "subelsky_power_tools/ext/exception"
|
3
3
|
|
4
4
|
describe Exception do
|
5
|
+
let(:exception) do
|
6
|
+
StandardError.new("something bad happened")
|
7
|
+
end
|
8
|
+
|
5
9
|
it "reports details" do
|
6
10
|
begin
|
7
|
-
raise
|
11
|
+
raise exception
|
8
12
|
rescue StandardError => e
|
9
13
|
expect(e.detail).to match(/StandardError: something bad happened\n/)
|
10
14
|
end
|
11
15
|
end
|
16
|
+
|
17
|
+
it "reports a summary" do
|
18
|
+
expect(exception.summary).to eq("StandardError: something bad happened")
|
19
|
+
end
|
12
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: subelsky_power_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Subelsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.4.2
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: This is a collection of Ruby extensions and utilities I've been carting around
|