vendor/bundle/ruby/2.1.0/gems/test-kitchen-1.7.3/lib/kitchen/provisioner/chef_base.rb
# Converts a Ruby object to a String interpretation suitable for writing
# out to a client.rb/solo.rb/knife.rb file.
#
# @param obj [Object] an object
# @return [String] a string representation
# @api private
Converts a Ruby object to a String interpretation suitable for writing
out to a client.rb/solo.rb/knife.rb file.
Converts a Ruby object to a String interpretation suitable for writing out to a client . rb / solo . rb / knife . rb file .
def format_value(obj)
        if obj.is_a?(String) && obj =~ /^:/
          obj
        elsif obj.is_a?(String)
          %{"#{obj.gsub(/\\/, "\\\\\\\\")}"}
        elsif obj.is_a?(Array)
          %{[#{obj.map { |i| format_value(i) }.join(", ")}]}
        else
          obj.inspect
        end
      end
def format_value ( obj ) if obj . is_a? ( String ) && obj =~ / ^: / obj elsif obj . is_a? ( String ) %{"#{obj.gsub(/\\/, "\\\\\\\\")}"} elsif obj . is_a? ( Array ) %{[#{obj.map { |i| format_value(i) }.join(", ")}]} else obj . inspect end end
Converts a Ruby object to a String interpretation suitable for writing
out to a client.rb/solo.rb/knife.rb file.
Converts a Ruby object to a String interpretation suitable for writing out to a client . rb / solo . rb / knife . rb file .
a string representation
a string representation
String
obj
None
api
None