mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
can-t go in else when nil either
This commit is contained in:
parent
6a9f015527
commit
4241cbf7ce
1 changed files with 7 additions and 5 deletions
|
@ -48,11 +48,13 @@ module Inspec
|
|||
|
||||
if @qualifier.length > 1
|
||||
last = @qualifier[-1]
|
||||
# preventing its('to_i') as the value returned is always 0
|
||||
if last.length == 1 && last[0] !~ /^to_.$/ && !last[0].nil? && !last[0].include?('[')
|
||||
xres = last[0]
|
||||
else
|
||||
res += '.' + ruby_qualifier(last)
|
||||
unless last.is_a?(Array) && last[0].to_s.empty?
|
||||
if last.length == 1 && last[0] !~ /^to_.$/ && !last[0].include?('[')
|
||||
# this will go in its()
|
||||
xres = last[0]
|
||||
else
|
||||
res += '.' + ruby_qualifier(last)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue