I am using delayed_jobs to run Ruby classes, how can the Ruby detect the name (command) of the process that is running it?
any thoughts?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can determine the name of the file using
$0. You can even set the process name using it like so$0 = 'foo'Dave Thomas’s blog post. If you want to get the command line args, you want to look atARGV.