Register • FAQ • Memberlist • Usergroups • Tutorials Point • Log in

| Page 1 of 1

syntax error, unexpected '\n', expecting tCOLON2 or '[' or
Author | Message
--- | ---
kbuttler Joined: 24 Nov 2010 Posts: 1 | syntax error, unexpected '\n', expecting tCOLON2 or '[' or Im seem to be having a bit of a problem with my program. i am setting an exception within a for loop and i cant seem to get the loop to stop instead I am getting syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.' could any one tell what i am doing wrong. I left out the hard coded url for security purposes. but please let say thanks in advance for any help i could get.
for (1..7).each do |days_ago|
#here we take the file path from each customer and replace the day with todays date.
url = "sample url"
todays_url = url.gsub( '2010-10-01' ,y+"-"+m+"-"+d )
try_again = 0
time.now -1*60*60*24*days_ago
#this is where we want to check weather the file actually exist in the directory.
#here we will take the new url and retrive the new file from the server.
uri = todays_url
begin
source = open(uri)
rescue
try_again = 1
end
unless try_again == 0
break
end
end
exit
Wed Nov 24, 2010 6:43 pm |

Display posts from previous: |

| Page 1 of 1

You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum

Powered by phpBB © phpBB Group Design by Vjacheslav Trushkin for phpBBStyles.com