debugtrace 1.0.0 → 1.0.1
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/lib/debugtrace/common.rb +3 -3
- data/lib/debugtrace/config.rb +1 -1
- data/lib/debugtrace/loggers.rb +1 -1
- data/lib/debugtrace/version.rb +1 -1
- data/lib/debugtrace.rb +1 -1
- 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: 0e872094eb59159d108f2e52625b202800b7278dc17679fbae19e06d5a23d422
|
4
|
+
data.tar.gz: bca0f74ed3a13386f01d77b1ae07b2b204c6eb3c93b55d48478ac35d0745436b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcaafba29d038f8f15cbb6cfbb9936065ee352a7d71441a832e72b20ac97f149c5752121f74776d0ecaf79e491a556542af18cbf4b524000cc73243a419b4478
|
7
|
+
data.tar.gz: e56bf266a536877979e38a3492e192f270a38b4c92524f57b1991b4c3da8d15603f10cbefa3b9888d8711c642152ff3d6017a6003abcca3435c740208f8cbf52
|
data/lib/debugtrace/common.rb
CHANGED
@@ -12,8 +12,8 @@ module Common
|
|
12
12
|
# @return [String] the value
|
13
13
|
# @raise [TypeError] if the value is not an instance of the type or the subclass of the type
|
14
14
|
def self.check_type(value_name, value, type)
|
15
|
-
raise TypeError
|
16
|
-
raise TypeError
|
15
|
+
raise TypeError, "Argument value_name (=#{value_name}) must be a String" unless value_name.is_a?(String)
|
16
|
+
raise TypeError, "Argument type (=#{type}) must be a Class" unless type.is_a?(Class)
|
17
17
|
|
18
18
|
error = false
|
19
19
|
if type == FalseClass || type == TrueClass
|
@@ -30,7 +30,7 @@ module Common
|
|
30
30
|
top_type_name = type.name.slice(0).upcase
|
31
31
|
a = top_type_name == 'A' || top_type_name == 'I' || top_type_name == 'U' ||
|
32
32
|
top_type_name == 'E' || top_type_name == 'O' ? 'an' : 'a'
|
33
|
-
raise TypeError
|
33
|
+
raise TypeError, "Argument #{value_name} (=#{value_string}) must be #{a} #{type}"
|
34
34
|
end
|
35
35
|
return value
|
36
36
|
end
|
data/lib/debugtrace/config.rb
CHANGED
@@ -38,7 +38,7 @@ class Config
|
|
38
38
|
#
|
39
39
|
# @param config_path [String] path of the yml file
|
40
40
|
def initialize(config_path)
|
41
|
-
@config_path =
|
41
|
+
@config_path = config_path
|
42
42
|
if File.exist?(@config_path)
|
43
43
|
@config = YAML.load_file(@config_path)
|
44
44
|
else
|
data/lib/debugtrace/loggers.rb
CHANGED
@@ -11,7 +11,7 @@ class LoggerBase
|
|
11
11
|
# @param message [String] The message to output
|
12
12
|
# @raise [Exception] always
|
13
13
|
def print(message)
|
14
|
-
raise Exception
|
14
|
+
raise Exception, 'LoggerBase.print is an abstract method.'
|
15
15
|
end
|
16
16
|
|
17
17
|
# Returns a string representation of this object.
|
data/lib/debugtrace/version.rb
CHANGED
data/lib/debugtrace.rb
CHANGED