ultra_config 0.11.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ultra_config/config.rb +1 -1
- data/lib/ultra_config/validation.rb +11 -1
- data/ultra_config.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58a62bd2b4590fb7d00e698c1bd3514773eb7de8
|
4
|
+
data.tar.gz: 10fbaa211096cc69a4ee95a40ecf01ed5d2536e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 164325f002a4eead14d033410e0aacdd72c6eb8e962c9de84d8c4999e0ff22b6009cfbbec91e4a05c1bf2d163ebe653979fda80b5c644a788ba77518b61ecfa2
|
7
|
+
data.tar.gz: 7b53809a1b08a2cee51941080eae2b879f0ae0c953417db076f631c74ceab49e9556720eebe05117ca541e4150e7293664a4c5053adc803b2fef45d33e016e9b
|
data/lib/ultra_config/config.rb
CHANGED
@@ -21,7 +21,7 @@ module UltraConfig
|
|
21
21
|
type_safety(Settings.type_safety) unless @type_safety_checked
|
22
22
|
@value = @intermediate_value
|
23
23
|
rescue UltraConfig::Validation::ValidationError
|
24
|
-
raise UltraConfig::Validation::ValidationError, @
|
24
|
+
raise UltraConfig::Validation::ValidationError.new(@error_msg, sanitize? ? '*****' : @intermediate_value)
|
25
25
|
ensure
|
26
26
|
@type_safety_checked = false
|
27
27
|
@intermediate_value = nil
|
@@ -4,7 +4,17 @@ module UltraConfig
|
|
4
4
|
module Validation
|
5
5
|
include Boolean
|
6
6
|
|
7
|
-
class ValidationError < StandardError
|
7
|
+
class ValidationError < StandardError
|
8
|
+
attr_reader :config
|
9
|
+
attr_reader :value
|
10
|
+
|
11
|
+
def initialize(msg = nil, value = nil)
|
12
|
+
@value = value
|
13
|
+
|
14
|
+
super(msg)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
8
18
|
class TypeValidationError < ValidationError; end
|
9
19
|
|
10
20
|
def type_safety(type)
|
data/ultra_config.gemspec
CHANGED