Module: NewRelic::LanguageSupport::Control

Included in:
Control
Defined in:
lib/new_relic/language_support.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/new_relic/language_support.rb', line 5

def self.included(base)
  # need to use syck rather than psych when possible
  if defined?(::YAML::ENGINE)
    if !NewRelic::LanguageSupport.using_engine?('jruby') &&
        (NewRelic::LanguageSupport.using_version?('1.9.1') ||
         NewRelic::LanguageSupport.using_version?('1.9.2'))
      base.class_eval do
        def load_newrelic_yml(*args)
          yamler = ::YAML::ENGINE.yamler
          ::YAML::ENGINE.yamler = 'syck'
          val = super
          ::YAML::ENGINE.yamler = yamler
          val
        end
      end
    end
  end
end