Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created August 6, 2015 15:00
Show Gist options
  • Save anonymous/1040a8065187b000e519 to your computer and use it in GitHub Desktop.
Save anonymous/1040a8065187b000e519 to your computer and use it in GitHub Desktop.
# Medical Records Stamper
# (Builds Daily Records of Food, Pills, etc.)
# Shit to Learn:
# How to make global variables that work everywhere
# How to get the file to exist, add to, add to if it already exists
# Section: Program Data Building
# Dates
todays_date = Time.now.strftime("%Y/%m/%d, %A")
# Section: Program Data From User
# Section: Program Gears
# main menu options
def entry
current_time = Time.now.strftime("%I:%M, %p")
todays_date = Time.now.strftime("%Y/%m/%d, %A")
puts "Time is: #{current_time}"
print "Entry: "
entry = gets.chomp
# Figuring this out..
File.open("/Users/cndiv/MEGA/code/#{todays_date}", "a") do |fh| fh.puts "#{entry}" end
#File.write("#{todays_date}", "#{entry}")
#File.open("#{todays_date}.txt", '<a>') {|entry| entry.write("#{entry}") }
end
# Section: Program Interface
# terminal clear, welcome
system "clear" or system "cls" # clears terminal screen
puts "Chip's Daily Health Stamper"
puts "Today's Date is #{todays_date}"
puts ""
# calls for entry
entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment