def verify_host_key_value(given)
      current_net_ssh = Net::SSH::Version::CURRENT
      new_value_version = Net::SSH::Version[5, 0, 0]
      if current_net_ssh >= new_value_version
        # 5.0+ style
        {
          # It's not a boolean anymore.
          'true' => :always,
          'false' => :never,
          true => :always,
          false => :never,
          # May be correct value, but strings from JSON config
          'always' => :always,
          'never' => :never,
          nil => :never,
        }.fetch(given, given)
      else
        # up to 4.2 style
        {
          'true' => true,
          'false' => false,
          nil => false,
        }.fetch(given, given)
      end
    end
def verify_host_key_value(given)
      current_net_ssh = Net::SSH::Version::CURRENT
      new_value_version = Net::SSH::Version[5, 0, 0]
      if current_net_ssh >= new_value_version
        # 5.0+ style
        {
          # It's not a boolean anymore.
          'true' => :always,
          'false' => :never,
          true => :always,
          false => :never,
          # May be correct value, but strings from JSON config
          'always' => :always,
          'never' => :never,
          nil => :never,
        }.fetch(given, given)
      else
        # up to 4.2 style
        {
          'true' => true,
          'false' => false,
          nil => false,
        }.fetch(given, given)
      end
    end
Likewise, version <5 accepted false; 5+ requires :never or will
 issue a deprecation warning. This method allows a lot of common
 things through.