module DerailedBenchmarks
Tree structure used to store and sort require memory costs RequireTree.new
('get_process_mem')
Constants
- VERSION
Attributes
auth[RW]
Public Class Methods
add_auth(app)
click to toggle source
# File lib/derailed_benchmarks.rb, line 33 def self.add_auth(app) if use_auth = ENV['USE_AUTH'] puts "Auth: #{use_auth}" auth.add_app(app) else app end end
gem_is_bundled?(name)
click to toggle source
# File lib/derailed_benchmarks.rb, line 9 def self.gem_is_bundled?(name) specs = ::Bundler.locked_gems.specs.each_with_object({}) {|spec, hash| hash[spec.name] = spec } specs[name] end
rails_path_on_disk()
click to toggle source
# File lib/derailed_benchmarks.rb, line 18 def self.rails_path_on_disk require 'rails/version' rails_version_file = Rails.method(:version).source_location[0] path = Pathname.new(rails_version_file).expand_path.parent.parent while path != Pathname.new("/") basename = path.expand_path.basename.to_s break if basename.start_with?("rails") && basename != "railties" path = path.parent end raise "Could not find rails folder on a folder in #{rails_version_file}" if path == Pathname.new("/") path.expand_path end