- Outside ENV strings are frozen:
example.rb:
ENV['foo'].strip!
Run:
foo='bar' ruby example.rb
`strip!': can't modify frozen String (RuntimeError)
- Assigning anything but String to ENV produces TypeError
ENV['foo'] = :bar
# => `[]=': no implicit conversion of Symbol into String (TypeError)
ENV['foo'] = 5
# => `[]=': no implicit conversion of Fixnum into String (TypeError)
ENV['foo'] = {}
# => `[]=': no implicit conversion of Hash into String (TypeError)
- Logging true/false:
Chef::Log.warn(true)
=> WARN: true
Chef::Log.warn(false)
=> WARN: nil # Gotcha!