class AppPerfRpm::Introspector
Constants
- VALID_RUNNERS
Public Class Methods
agentable?()
click to toggle source
# File lib/app_perf_rpm/introspector.rb, line 18 def agentable? if raking? || rspecing? AppPerfRpm.logger.info("Detected rake, not initializing agent") return false end AppPerfRpm.logger.info("Detecting runner...") VALID_RUNNERS.each do |runner| if const_defined?(runner.to_s) AppPerfRpm.logger.info("#{runner} detected. You're valid") return true end end AppPerfRpm.logger.info("No valid runner detected!") false end
const_defined?(string_const)
click to toggle source
# File lib/app_perf_rpm/introspector.rb, line 42 def const_defined?(string_const) begin Object.const_get(string_const) true rescue NameError false end end
raking?()
click to toggle source
# File lib/app_perf_rpm/introspector.rb, line 38 def raking? (File.basename($0) =~ /\Arake/) == 0 end
rspecing?()
click to toggle source
# File lib/app_perf_rpm/introspector.rb, line 34 def rspecing? (File.basename($0) =~ /\Arspec/) == 0 end