public Method

Object.`(command)

Makes backticks behave (somewhat more) similarly on all platforms. On win32 `nonexistent_command` raises Errno::ENOENT; on Unix, the spawned shell prints a message to stderr and sets $?. We emulate Unix on the former but not the latter.

Source Code

# File active_support/core_ext/kernel/agnostics.rb, line 6
def `(command) #:nodoc:
  super
rescue Errno::ENOENT => e
  STDERR.puts "#$0: #{e}"
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.