Method: Chef::Provider::Env#compare_value

Defined in:
lib/chef/provider/env.rb

#compare_valueObject

Check to see if value needs any changes

Returns

<true>

If a change is required

<false>

If a change is not required



61
62
63
64
65
66
67
68
69
70
# File 'lib/chef/provider/env.rb', line 61

def compare_value
  if @new_resource.delim
    #e.g. check for existing value within PATH
    not @current_resource.value.split(@new_resource.delim).any? do |val|
      val == @new_resource.value
    end
  else
    @new_resource.value != @current_resource.value
  end
end