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?
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 at ARGV
.
$0
Contains the name of the script being executed. (May be assignable so it can go wrong)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With