ClearMyBench
Welcome, Guest
Please Login or Register.    Lost Password?
Re:Ruby basics (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:Ruby basics
#4535
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
File Modes and Ownership

Use the chmod method with a mask to change the mode or permissions/access list of a file
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4536
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Dir.tmpdir provides the path to the temporary directory on the current system, although the method is not available by default.


To make Dir.tmpdir available it's necessary to use require 'tmpdir'.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4537
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
We can use Dir.tmpdir with File.join to create a platform-independent temporary file.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4538
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
The execution and the exception always go together.

If we are opening a file which does not exist then if we did not handle this situation properly then your program is considered to be of bad quality.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4539
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
The program stops if an exception occurs.
. So exceptions are used to handle various type of errors which may occur during a program execution and take appropriate action instead of halting program completely.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#4540
ShriNi (User)
Software Techie (PEGA) currently on a Career Break
Platinum Boarder
Posts: 4000
graph
User Offline Click here to see the profile of this user
Gender: Female Location: Secundrabad India Birthdate: 1983-09-29
Re:Ruby basics 3 Years, 10 Months ago Karma: 0  
Ruby provide a nice mechanism to handle exceptions.

. We enclose the code that could raise an exception in a begin/end block and use rescue clauses to tell Ruby the types of exceptions we want to handle.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
logo footer   Copyright 2009 - 2013 HotRecruiter.Com - All Rights Reserved