foobara 0.0.26 → 0.0.27
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/projects/common/src/error.rb +49 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 463e274d4eb6227cdf473fc12bab4a7519db226c07f458c7bd04e8a9f84f1440
|
4
|
+
data.tar.gz: bfaaf65911fb2c87363ea619f58ea042b1236653797d11ab9c59793f83b26d34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34f1340468762419907715d77f6f98e13ee551b645bc94c258984458dd2120ed5e607f8ea6148f5fdda3f53ceae1ad981bf82a522060bae948869119b309fa45
|
7
|
+
data.tar.gz: 945c3807af1fdf55aab4e87bc635abfc8ee1bec12ff5458ee5c4336a71174f5671f768e87daa72bfc97178ad10a9ebefc3b93757a9afd8d276ee50f5bc2202b8
|
data/CHANGELOG.md
CHANGED
@@ -18,8 +18,22 @@ module Foobara
|
|
18
18
|
@abstract
|
19
19
|
end
|
20
20
|
|
21
|
-
def symbol
|
22
|
-
|
21
|
+
def symbol(*args)
|
22
|
+
args_size = args.size
|
23
|
+
|
24
|
+
case args_size
|
25
|
+
when 0
|
26
|
+
Util.non_full_name_underscore(self).gsub(/_error$/, "").to_sym
|
27
|
+
when 1
|
28
|
+
arg = args.first
|
29
|
+
singleton_class.define_method :symbol do
|
30
|
+
arg
|
31
|
+
end
|
32
|
+
else
|
33
|
+
# :nocov:
|
34
|
+
raise ArgumentError, "expected 0 or 1 argument, got #{args_size}"
|
35
|
+
# :nocov:
|
36
|
+
end
|
23
37
|
end
|
24
38
|
|
25
39
|
# Is this actually used?
|
@@ -35,12 +49,40 @@ module Foobara
|
|
35
49
|
nil
|
36
50
|
end
|
37
51
|
|
38
|
-
def message
|
39
|
-
|
52
|
+
def message(*args)
|
53
|
+
args_size = args.size
|
54
|
+
|
55
|
+
case args_size
|
56
|
+
when 0
|
57
|
+
Util.humanize(symbol.to_s)
|
58
|
+
when 1
|
59
|
+
arg = args.first
|
60
|
+
singleton_class.define_method :message do
|
61
|
+
arg
|
62
|
+
end
|
63
|
+
else
|
64
|
+
# :nocov:
|
65
|
+
raise ArgumentError, "expected 0 or 1 argument, got #{args_size}"
|
66
|
+
# :nocov:
|
67
|
+
end
|
40
68
|
end
|
41
69
|
|
42
|
-
def context
|
43
|
-
|
70
|
+
def context(*args)
|
71
|
+
args_size = args.size
|
72
|
+
|
73
|
+
case args_size
|
74
|
+
when 0
|
75
|
+
{}
|
76
|
+
when 1
|
77
|
+
arg = args.first
|
78
|
+
singleton_class.define_method :context_type_declaration do
|
79
|
+
arg
|
80
|
+
end
|
81
|
+
else
|
82
|
+
# :nocov:
|
83
|
+
raise ArgumentError, "expected 0 or 1 argument, got #{args_size}"
|
84
|
+
# :nocov:
|
85
|
+
end
|
44
86
|
end
|
45
87
|
|
46
88
|
def fatal?
|
@@ -92,7 +134,7 @@ module Foobara
|
|
92
134
|
end
|
93
135
|
|
94
136
|
def subclass(
|
95
|
-
# TODO: technically
|
137
|
+
# TODO: technically context doesn't belong here. But maybe it should.
|
96
138
|
context: {},
|
97
139
|
name: nil,
|
98
140
|
symbol: nil,
|