def build_crontab_output(opts)
      chdir = Makesure.chdir || File.dirname(Makesure.makesurefile)
      crontab = ""
      crontab << "# Autogenerated by makesure: you probably don't want to edit this file\n\n"
      crontab << "# Cron environment\n"
      crontab << (Makesure.cron_env || "#   customize this by setting Makesure.cron_env in your Makesurefile")
      crontab << "\n"
      Makesure.systems.each do |s|
        uid = s.uid || Makesure.uid
        crontab << "\n"
        crontab << "## Tasks for '#{s.name}'\n"
        crontab << "# Commands\n"
        s.cmds.each do |c|
          crontab << "#{c.cron}\t"
          crontab << "#{uid} " if uid
          crontab << "cd #{chdir} && "

          cmd = "makesure-runner run #{c.command.inspect}"
          crontab << if (opts[:rvm])
            "/bin/bash -l -c '#{cmd}'"
          else
            cmd
          end
          crontab << "\n"
        end

        crontab << "# Verification\n"
        s.verifies.each do |v|
          crontab << "#{v.cron}\t"
          crontab << "#{uid} " if uid
          crontab << "cd #{chdir} && "

          cmd = "makesure-runner verify #{s.name} #{v.name}"
          crontab << if (opts[:rvm])
            "/bin/bash -l -c '#{cmd}'"
          else
            cmd
          end
          crontab << "\n"
        end
        # TODO summarizes
      end
      crontab
    end
def build_crontab_output(opts)
      chdir = Makesure.chdir || File.dirname(Makesure.makesurefile)
      crontab = ""
      crontab << "# Autogenerated by makesure: you probably don't want to edit this file\n\n"
      crontab << "# Cron environment\n"
      crontab << (Makesure.cron_env || "#   customize this by setting Makesure.cron_env in your Makesurefile")
      crontab << "\n"
      Makesure.systems.each do |s|
        uid = s.uid || Makesure.uid
        crontab << "\n"
        crontab << "## Tasks for '#{s.name}'\n"
        crontab << "# Commands\n"
        s.cmds.each do |c|
          crontab << "#{c.cron}\t"
          crontab << "#{uid} " if uid
          crontab << "cd #{chdir} && "

          cmd = "makesure-runner run #{c.command.inspect}"
          crontab << if (opts[:rvm])
            "/bin/bash -l -c '#{cmd}'"
          else
            cmd
          end
          crontab << "\n"
        end

        crontab << "# Verification\n"
        s.verifies.each do |v|
          crontab << "#{v.cron}\t"
          crontab << "#{uid} " if uid
          crontab << "cd #{chdir} && "

          cmd = "makesure-runner verify #{s.name} #{v.name}"
          crontab << if (opts[:rvm])
            "/bin/bash -l -c '#{cmd}'"
          else
            cmd
          end
          crontab << "\n"
        end
        # TODO summarizes
      end
      crontab
    end
specify a file (or directory containing files) to load system specifications from