I use RubyMine to write and debug my Ruby 2.0 code. It uses ruby-debug-ide for that purpose. I want to know if a program is running in debug mode.
I know there is the Ruby $DEBUG
global variable, but as far as I understand ruby-debug-ide didn't change it, because it didn't use the -d
ruby flag.
If I debug my file using Rubymine the command executed looks like this:
/home/user/.rvm/rubies/ruby-2.0.0-p353/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/user/.rvm/gems/ruby-2.0.0-p353/gems/ruby-debug-ide-0.4.22/bin/rdebug-ide --disable-int-handler --port 37737 --dispatcher-port 47992 -- /home/user/file.rb
I tried to use ARGV
or $0
, to determine if the command line contains the string 'rdebug-ide'
but ARGV
is an empty array and $0
is just '/home/user/file.rb'
, how can I get the full command line executed by RubyMine?
ENV['debugger_host'].nil?
– Disvalue