def debug?
!!ENV["RTX_DEBUG"]
end
def log_debug(msg)
warn "[DEBUG] rtx #{msg}" if debug?
end
def reshim
if `which ruby`.strip != ""
log_debug "reshim"
`rtx reshim`
else
log_debug "reshim skipped: ruby not found"
end
end
module ReshimInstaller
def install(options)
super
reshim
end
end
if defined?(Bundler::Installer)
Bundler::Installer.prepend ReshimInstaller
else
Gem.post_install do |installer|
reshim if installer.spec.executables.any?
end
Gem.post_uninstall do |installer|
reshim if installer.spec.executables.any?
end
end