rundaily.rb
def parse(filename, today)
	#get the name of the project from the name of the file
  $projectname = /data\/(.*)\.txt/.match(filename)[1]
  $projectname ||= $filename
  
  including = false
  IO.foreach(filename) do |line|
    line.chomp!
    if line == today
      including = true
    elsif !/\s+.*/.match(line)
		# the line did not start with whitespace, so this is the start of another day
      including = false
    elsif including
		#the line started with whitespace, and including is set to true, so print it
      puts $projectname + " - " + line.strip
    end
  end
end
#function to take a filename and day of the week and print relevant tasks for that day
function to take a filename and day of the week and print relevant tasks for that day
function to take a filename and day of the week and print relevant tasks for that day
def parse(filename, today)
  $projectname = /data\/(.*)\.txt/.match(filename)[1]
  $projectname ||= $filename
  including = false
  IO.foreach(filename) do |line|
    line.chomp!
    if line == today
      including = true
    elsif !/\s+.*/.match(line)
      including = false
    elsif including
      puts $projectname + " - " + line.strip
    end
  end
end
def parse ( filename , today ) $projectname = / data \/ (.*) \. txt / . match ( filename ) [ 1 ] $projectname ||= $filename including = false IO . foreach ( filename ) do | line | line . chomp! if line == today including = true elsif ! / \s +.* / . match ( line ) including = false elsif including puts $projectname + " - " + line . strip end end end
function to take a filename and day of the week and print relevant tasks for that day
function to take a filename and day of the week and print relevant tasks for that day
#get the name of the project from the name of the file # the line did not start with whitespace, so this is the start of another day #the line started with whitespace, and including is set to true, so print it
filename
today