ultra_config 0.2.0 → 0.3.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/utilities/boolean.rb +3 -0
- data/lib/ultra_config/validator.rb +5 -0
- data/ultra_config.gemspec +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676f5e1dfc918319086131538dedc889aa4f866e
|
4
|
+
data.tar.gz: 5d40a683ea9225df5dac8dd86091d26ef97e5afe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed611e8048ae483c96ec5a559b38f0daea2555e3350d168a753c212bddf906ffc52843e09403e7c72222df98f9ff44b5c8a3532e5f4214d9591edd90f06e496d
|
7
|
+
data.tar.gz: 2d84201a46e57b356a107ee0d285be973414b65b2e4886c01d4f73fd02daaee7c1190535964449bd59749b5b804413e5de8df1c2e98de229c5ce8180e3bffc09
|
@@ -1,5 +1,9 @@
|
|
1
|
+
require_relative 'utilities/boolean'
|
2
|
+
|
1
3
|
module UltraConfig
|
2
4
|
class Validator
|
5
|
+
extend Boolean
|
6
|
+
|
3
7
|
class ValidationError < StandardError; end
|
4
8
|
class TypeValidationError < ValidationError; end
|
5
9
|
|
@@ -14,6 +18,7 @@ module UltraConfig
|
|
14
18
|
|
15
19
|
def self.type_safety(old)
|
16
20
|
return if old.nil?
|
21
|
+
return if old.is_a?(Boolean) && @test_value.is_a?(Boolean)
|
17
22
|
|
18
23
|
raise TypeValidationError if old.class != @test_value.class
|
19
24
|
end
|
data/ultra_config.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultra_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregory Kuruc
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- lib/ultra_config/config.rb
|
69
69
|
- lib/ultra_config/namespace.rb
|
70
70
|
- lib/ultra_config/settings.rb
|
71
|
+
- lib/ultra_config/utilities/boolean.rb
|
71
72
|
- lib/ultra_config/validator.rb
|
72
73
|
- ultra_config.gemspec
|
73
74
|
homepage: https://github.com/SpyMachine/UltraConfig
|