openstudio-workflow 1.3.1 → 1.3.2

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: 4d9ae4b703c92eef60ef68cb61114502b4b0e2c3
4
- data.tar.gz: 1387f3ab160a42eb9403d8c62958622fe374baef
3
+ metadata.gz: 6c2fb37683cd9406a57cc473d90812987900bda9
4
+ data.tar.gz: 5c452453f70acf650da05e3632322e743dc9b858
5
5
  SHA512:
6
- metadata.gz: f0a94a722672ef570e6819f89702605922fa3a585e2058ad976444571818fc1962ef14f42d0ff0949978a8965f1e305472ada3d2ec0566184794db5a20d699c6
7
- data.tar.gz: 470ba2ed0e0a832256f5cc564a3bbf2fd4bbfe7449037de128230411360b9a09c58a3795188c4e24d5f19899cfe934fad58c32245ed6c87b31671d1b0de93204
6
+ metadata.gz: b9b318fef0c727d9c53174e6604eb93fd36b01a1162339b2d807bd1b32bbde519c285f01a0f32b7cc0e0bcd34e8d1e90610aa4279f4de2ddc91e0436238a163b
7
+ data.tar.gz: d78e837fca16cf879ecd1034a36b831095d11a34f68aadb443c6bfbf86d8427f5a2fe5ce5e0be38c81feb2efc4a54eefb5bdeb6c1acadcfef917a8a240fd195a
@@ -337,53 +337,70 @@ module OpenStudio
337
337
  # Set argument values if they exist
338
338
  logger.debug "Iterating over arguments for workflow item '#{measure_dir_name}'"
339
339
  if step.arguments
340
- step.arguments.each do |argument_name, argument_value|
341
- if argument_name.to_s == '__SKIP__'
342
- if registry[:openstudio_2]
343
- variant_type = argument_value.variantType
344
- if variant_type == "String".to_VariantType
345
- argument_value = argument_value.valueAsString
346
- elsif variant_type == "Double".to_VariantType
347
- argument_value = argument_value.valueAsDouble
348
- elsif variant_type == "Integer".to_VariantType
349
- argument_value = argument_value.valueAsInteger
350
- elsif variant_type == "Boolean".to_VariantType
351
- argument_value = argument_value.valueAsBoolean
352
- end
340
+
341
+ # handle skip first
342
+ argument_value = step.arguments['__SKIP__']
343
+ if !argument_value.nil?
344
+
345
+ if registry[:openstudio_2]
346
+ variant_type = argument_value.variantType
347
+ if variant_type == "String".to_VariantType
348
+ argument_value = argument_value.valueAsString
349
+ elsif variant_type == "Double".to_VariantType
350
+ argument_value = argument_value.valueAsDouble
351
+ elsif variant_type == "Integer".to_VariantType
352
+ argument_value = argument_value.valueAsInteger
353
+ elsif variant_type == "Boolean".to_VariantType
354
+ argument_value = argument_value.valueAsBoolean
353
355
  end
354
-
355
- if argument_value.class == String
356
- argument_value = argument_value.downcase
357
- if argument_value == "false"
358
- skip_measure = false
359
- else
360
- skip_measure = true
361
- end
362
- elsif argument_value.class == Fixnum
363
- skip_measure = (argument_value != 0)
364
- elsif argument_value.class == Float
365
- skip_measure = (argument_value != 0.0)
366
- elsif argument_value.class == FalseClass
356
+ end
357
+
358
+ if argument_value.class == String
359
+ argument_value = argument_value.downcase
360
+ if argument_value == "false"
367
361
  skip_measure = false
368
- elsif argument_value.class == TrueClass
362
+ else
369
363
  skip_measure = true
370
- elsif argument_value.class == NilClass
371
- skip_measure = false
372
364
  end
365
+ elsif argument_value.class == Fixnum
366
+ skip_measure = (argument_value != 0)
367
+ elsif argument_value.class == Float
368
+ skip_measure = (argument_value != 0.0)
369
+ elsif argument_value.class == FalseClass
370
+ skip_measure = false
371
+ elsif argument_value.class == TrueClass
372
+ skip_measure = true
373
+ elsif argument_value.class == NilClass
374
+ skip_measure = false
375
+ end
376
+ end
377
+
378
+ # process other arguments
379
+ step.arguments.each do |argument_name, argument_value|
380
+
381
+ # don't validate choices if measure is being skipped
382
+ next if skip_measure
383
+
384
+ # already handled skip
385
+ next if argument_name.to_s == '__SKIP__'
386
+
387
+ # regular argument
388
+ if registry[:openstudio_2]
389
+ success = apply_arguments_2(argument_map, argument_name, argument_value, logger)
373
390
  else
374
- # regular argument
375
- if registry[:openstudio_2]
376
- success = apply_arguments_2(argument_map, argument_name, argument_value, logger)
377
- else
378
- success = apply_arguments(argument_map, argument_name, argument_value, logger)
379
- end
380
- fail 'Could not set arguments' unless success
391
+ success = apply_arguments(argument_map, argument_name, argument_value, logger)
381
392
  end
393
+ fail 'Could not set arguments' unless success
382
394
  end
395
+
383
396
  end
384
397
 
385
398
  # map any choice display names to choice values, in either set values or defaults
386
399
  argument_map.each_key do |argument_name|
400
+
401
+ # don't validate choices if measure is being skipped
402
+ next if skip_measure
403
+
387
404
  v = argument_map[argument_name]
388
405
  choice_values = v.choiceValues
389
406
  if !choice_values.empty?
@@ -19,6 +19,6 @@
19
19
 
20
20
  module OpenStudio
21
21
  module Workflow
22
- VERSION = '1.3.1'.freeze # Suffixes must have periods (not dashes)
22
+ VERSION = '1.3.2'.freeze # Suffixes must have periods (not dashes)
23
23
  end
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-06-27 00:00:00.000000000 Z
12
+ date: 2018-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler