Module: Oboe::Rails
- Defined in:
- lib/oboe/frameworks/rails/rails.rb
Defined Under Namespace
Modules: Helpers
Class Method Summary collapse
Class Method Details
.include_helpers ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/oboe/frameworks/rails/rails.rb', line 73 def self.include_helpers # TBD: This would make the helpers available to controllers which is occasionally desired. # ActiveSupport.on_load(:action_controller) do # include Oboe::Rails::Helpers # end if ::Rails::VERSION::MAJOR > 2 ActiveSupport.on_load(:action_view) do include Oboe::Rails::Helpers end else ActionView::Base.send :include, Oboe::Rails::Helpers end end |
.load_initializer ⇒ Object
Helpers
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/oboe/frameworks/rails/rails.rb', line 39 def self.load_initializer # Force load the tracelytics Rails initializer if there is one # Prefer oboe.rb but give priority to tracelytics.rb if it exists if ::Rails::VERSION::MAJOR > 2 rails_root = "#{::Rails.root.to_s}" else rails_root = "#{RAILS_ROOT}" end if File.exists?("#{rails_root}/config/initializers/tracelytics.rb") tr_initializer = "#{rails_root}/config/initializers/tracelytics.rb" else tr_initializer = "#{rails_root}/config/initializers/oboe.rb" end require tr_initializer if File.exists?(tr_initializer) end |
.load_instrumentation ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/oboe/frameworks/rails/rails.rb', line 57 def self.load_instrumentation pattern = File.join(File.dirname(__FILE__), 'inst', '*.rb') Dir.glob(pattern) do |f| begin require f rescue => e $stderr.puts "[oboe/loading] Error loading rails insrumentation file '#{f}' : #{e}" end end if ::Rails::VERSION::MAJOR > 2 puts "Tracelytics oboe gem #{Gem.loaded_specs['oboe'].version.to_s} successfully loaded." else puts "Tracelytics oboe gem #{Oboe::Version::STRING} successfully loaded." end end |