mirror of
https://github.com/inspec/inspec
synced 2024-11-26 06:30:26 +00:00
Also issue default: option for backwards compatibility
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
This commit is contained in:
parent
5868eb52e7
commit
18011ccfec
1 changed files with 4 additions and 0 deletions
|
@ -94,6 +94,10 @@ module Inspec
|
|||
res = ["#{ruby_var_identifier} = attribute('#{@name}',{"]
|
||||
res.push " title: '#{title}'," unless title.to_s.empty?
|
||||
res.push " value: #{value.inspect}," unless value.to_s.empty?
|
||||
# to_ruby may generate code that is to be used by older versions of inspec.
|
||||
# Anything older than 3.4 will not recognize the value: option, so
|
||||
# send the default: option as well. See #3759
|
||||
res.push " default: #{value.inspect}," unless value.to_s.empty?
|
||||
res.push " description: '#{description}'," unless description.to_s.empty?
|
||||
res.push '})'
|
||||
res.join("\n")
|
||||
|
|
Loading…
Reference in a new issue