Module: DerailedBenchmarks
- Defined in:
- lib/derailed_benchmarks/require_tree.rb,
lib/derailed_benchmarks.rb,
lib/derailed_benchmarks/version.rb,
lib/derailed_benchmarks/git/commit.rb,
lib/derailed_benchmarks/auth_helper.rb,
lib/derailed_benchmarks/git/in_path.rb,
lib/derailed_benchmarks/stats_for_file.rb,
lib/derailed_benchmarks/stats_from_dir.rb,
lib/derailed_benchmarks/git/switch_project.rb,
lib/derailed_benchmarks/git/switch_project.rb,
lib/derailed_benchmarks/auth_helpers/devise.rb
Overview
Tree structure used to store and sort require memory costs RequireTree.new(‘get_process_mem’)
Defined Under Namespace
Classes: AuthHelper, AuthHelpers, Git, RequireTree, StatsForFile, StatsFromDir
Constant Summary collapse
- VERSION =
"2.1.0"
Class Attribute Summary collapse
-
.auth ⇒ Object
Returns the value of attribute auth.
Class Method Summary collapse
Class Attribute Details
.auth ⇒ Object
Returns the value of attribute auth.
16 17 18 |
# File 'lib/derailed_benchmarks.rb', line 16 def auth @auth end |
Class Method Details
.add_auth(app) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/derailed_benchmarks.rb', line 34 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) ⇒ Boolean
10 11 12 13 |
# File 'lib/derailed_benchmarks.rb', line 10 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 ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/derailed_benchmarks.rb', line 19 def self.rails_path_on_disk require 'rails/version' rails_version_file = Rails.method(:version).source_location[0] path = Pathname.new(rails_version_file)..parent.parent while path != Pathname.new("/") basename = 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. end |