standard_exceptions 0.1.4 → 0.1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/standard_exceptions.rb +14 -7
- data/lib/standard_exceptions/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fab5039aaf71e6eb949c2cc8537744d11a9d0e4
|
4
|
+
data.tar.gz: 8d1c0b30348e8e0c2dec97875db2824ca2ee6307
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2095589abcc04156fe68eeec93c81c9671e7c02b8fd85f1c9ade4dd8cc9d818099b002512b861107120f1d9a4dbd183d7fe9ec111c37b5241370a8558e893fb3
|
7
|
+
data.tar.gz: cd349b95b628d59181a6a7131b96dee9c7c385207ffc1c06e4c092eeae354e0674f52eda397cccd387b0f5a13f04e5fcfd250c5d23bc2b1ba9db80015bdaf03d
|
data/lib/standard_exceptions.rb
CHANGED
@@ -3,6 +3,20 @@ require "standard_exceptions/version"
|
|
3
3
|
module StandardExceptions
|
4
4
|
|
5
5
|
module ExceptionInterface
|
6
|
+
|
7
|
+
def self.included(aClass)
|
8
|
+
aClass.send :extend, ClassMethods
|
9
|
+
end
|
10
|
+
|
11
|
+
module ClassMethods
|
12
|
+
# eg. 'Not Found'
|
13
|
+
def human_name(e_class=self)
|
14
|
+
i = e_class.name.rindex('::')
|
15
|
+
base_name = e_class.name[(i+2)..-1]
|
16
|
+
base_name.split(/(?=[A-Z])/).join(' ')
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
6
20
|
attr_accessor :status
|
7
21
|
|
8
22
|
attr_writer :inner
|
@@ -10,13 +24,6 @@ module StandardExceptions
|
|
10
24
|
@inner || self.cause
|
11
25
|
end
|
12
26
|
|
13
|
-
# eg. 'Not Found'
|
14
|
-
def self.human_name(e_class=self)
|
15
|
-
i = e_class.name.rindex('::')
|
16
|
-
base_name = e_class.name[(i+2)..-1]
|
17
|
-
base_name.split(/(?=[A-Z])/).join(' ')
|
18
|
-
end
|
19
|
-
|
20
27
|
def human_name
|
21
28
|
self.class.human_name
|
22
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standard_exceptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.4
|
4
|
+
version: 0.1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary McGhee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|