def save(file)
      path = case file
        when :global then GLOBAL_CONFS.first
        when :user then USER_CONFS.first
        else Pathname.new(file)
      end

      raise JSS::MissingDataError, "No HOME environment variable, can't write to user conf file." if path.nil?

      # file already exists? read it in and update the values.
      if path.readable?
        data = path.read

        # go thru the known attributes/keys
        CONF_KEYS.keys.sort.each do |k|

          # if the key exists, update it.
          if data =~ /^#{k}:/
            data.sub!(/^#{k}:.*$/, "#{k}: #{self.send k}")

          # if not, add it to the end unless it's nil
          else
            data += "\n#{k}: #{self.send k}" unless self.send(k).nil?
          end # if data =~ /^#{k}:/
        end #each do |k|

      else # not readable, make a new file
        data = ""
        CONF_KEYS.keys.sort.each do |k|
          data << "#{k}: #{self.send k}\n" unless self.send(k).nil?
        end
      end # if path readable

      # make sure we end with a newline, the save it.
      data << "\n" unless data.end_with?("\n")
      path.jss_save data
    end
def save(file)
      path = case file
        when :global then GLOBAL_CONFS.first
        when :user then USER_CONFS.first
        else Pathname.new(file)
      end

      raise JSS::MissingDataError, "No HOME environment variable, can't write to user conf file." if path.nil?

      # file already exists? read it in and update the values.
      if path.readable?
        data = path.read

        # go thru the known attributes/keys
        CONF_KEYS.keys.sort.each do |k|

          # if the key exists, update it.
          if data =~ /^#{k}:/
            data.sub!(/^#{k}:.*$/, "#{k}: #{self.send k}")

          # if not, add it to the end unless it's nil
          else
            data += "\n#{k}: #{self.send k}" unless self.send(k).nil?
          end # if data =~ /^#{k}:/
        end #each do |k|

      else # not readable, make a new file
        data = ""
        CONF_KEYS.keys.sort.each do |k|
          data << "#{k}: #{self.send k}\n" unless self.send(k).nil?
        end
      end # if path readable

      # make sure we end with a newline, the save it.
      data << "\n" unless data.end_with?("\n")
      path.jss_save data
    end
Save the prefs into a file

 @param file[Symbol,String,Pathname] either :user, :global, or an arbitrary file to save.

 @return [void]