kafo 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 37920206589ad542c671af010f5b8dd1bb02dff0
4
- data.tar.gz: 3e001186cf0bd9f809a28d92e5223d6345e264e8
3
+ metadata.gz: 095e7777fcdd067feaccae76002cebd20bedc8ee
4
+ data.tar.gz: c9c0fab972d24f509aba17b1015d0c22c8ca6287
5
5
  SHA512:
6
- metadata.gz: c59eac78e4965f90f98b1bab03275aa2044e724f71e7ed3f90339e7dbc0201812d3cb04bf1ddd0b3b390a309a1c3455620bcd961cadba6fcca01c9b6e581a9f1
7
- data.tar.gz: 797b544447e37f68faf90fe2a54afd033bda2254fa27d18b7c93d1c9ba453644db8b0c145ce9588e5c146507eebdaa60f59ac3321ad379d6f1b64fa3587f05a9
6
+ metadata.gz: e903393ce3a36c473e6c727ef91dc5bad87819aeb8499578ab1924ac679efca6cb7178feb5f1be7b6f6fe8e0876da9097e9aae77a15f7fc94317c2c4fb0a3e76
7
+ data.tar.gz: 62227ed73ca0beed7b90acadcc187e55bf6be2d57a74ddee7a52283d3edf6fa0b6ea7e27b6e674c8fb76f4f5adcfefa72bad5ae7ee6e14f4046d97cb5ffb2b8f
@@ -197,6 +197,10 @@ module Kafo
197
197
  self.class.exit(:unknown_module)
198
198
  end
199
199
 
200
+ def enabled_params
201
+ params.select { |p| p.module.enabled? }
202
+ end
203
+
200
204
  def reset_params_cache
201
205
  @params = nil
202
206
  params
@@ -391,7 +395,7 @@ module Kafo
391
395
 
392
396
  def validate_all(logging = true)
393
397
  logger.info 'Running validation checks'
394
- results = params.map do |param|
398
+ results = enabled_params.map do |param|
395
399
  result = param.valid?
396
400
  errors = param.validation_errors.join(', ')
397
401
  progress_log(:error, "Parameter #{with_prefix(param)} invalid: #{errors}") if logging && !result
data/lib/kafo/param.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  require 'kafo/condition'
3
+ require 'kafo/data_type'
3
4
  require 'kafo/validator'
4
5
 
5
6
  module Kafo
@@ -20,7 +21,7 @@ module Kafo
20
21
 
21
22
  # we use @value_set flag because even nil can be valid value
22
23
  def value
23
- @value_set ? @type.typecast(@value) : default
24
+ @type.typecast(@value_set ? @value : default)
24
25
  end
25
26
 
26
27
  def value=(value)
data/lib/kafo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
2
  module Kafo
3
3
  PARSER_CACHE_VERSION = 1
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kafo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Hulan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-13 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler