Class: NRBundlerPatcher
- Inherits:
-
Object
- Object
- NRBundlerPatcher
- Defined in:
- lib/boot/strap.rb
Constant Summary collapse
- BUNDLER =
'bundler'- RUBYOPT =
'RUBYOPT'
Class Method Summary collapse
- .check_for_bundler ⇒ Object
- .check_for_require ⇒ Object
- .check_for_rubyopt ⇒ Object
- .patch ⇒ Object
- .require_bundler ⇒ Object
Class Method Details
.check_for_bundler ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/boot/strap.rb', line 83 def self.check_for_bundler require_bundler raise 'Required Ruby Bundler class Bundler::Runtime not defined!' unless defined?(Bundler::Runtime) unless Bundler::Runtime.method_defined?(:require) raise "The active Ruby Bundler instance doesn't offer Bundler::Runtime#require" end end |
.check_for_require ⇒ Object
73 74 75 |
# File 'lib/boot/strap.rb', line 73 def self.check_for_require raise "#{__FILE__} is meant to be required, not invoked directly" if $PROGRAM_NAME == __FILE__ end |
.check_for_rubyopt ⇒ Object
77 78 79 80 81 |
# File 'lib/boot/strap.rb', line 77 def self.check_for_rubyopt unless ENV[RUBYOPT].to_s.match?("-r #{__FILE__.rpartition('.').first}") raise "#{__FILE__} is meant to be required via the RUBYOPT env var" end end |
.patch ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/boot/strap.rb', line 62 def self.patch check_for_require check_for_rubyopt check_for_bundler Bundler::Runtime.prepend(NRBundlerPatch) rescue StandardError => e Kernel.warn "New Relic entrypoint at #{__FILE__} encountered an issue:\n #{e.}" end |