Module: RailsDevelopmentBoost::DependenciesPatch::InstrumentationPatch

Defined in:
lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb

Defined Under Namespace

Modules: Files, Instrumenter, LoadedFile

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.applied?Boolean

Returns:

  • (Boolean)


101
102
103
# File 'lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb', line 101

def self.applied?
  ActiveSupport::Dependencies.singleton_class.include?(self)
end

.apply!Object



93
94
95
96
97
98
99
# File 'lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb', line 93

def self.apply!
  unless applied?
    ActiveSupport::Dependencies.extend self
    RailsDevelopmentBoost::LoadedFile.send :include, LoadedFile
    RailsDevelopmentBoost::LoadedFile::Files.send :include, Files
  end
end

Instance Method Details

#boost_log(action, msg = nil) ⇒ Object



121
122
123
124
# File 'lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb', line 121

def boost_log(action, msg = nil)
  action, msg = msg, action unless msg
  raw_boost_log("#{ "[#{action}] " if action}#{msg}")
end

#load_file_from_explicit_load(expanded_path) ⇒ Object



116
117
118
119
# File 'lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb', line 116

def load_file_from_explicit_load(expanded_path)
  boost_log('EXPLICIT_LOAD_REQUEST', expanded_path)
  super
end

#load_file_without_constant_tracking(path, *args) ⇒ Object



105
106
107
108
109
# File 'lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb', line 105

def load_file_without_constant_tracking(path, *args)
  other_args = ", #{args.map(&:inspect).join(', ')}" if args.any?
  boost_log('LOAD', "load_file(#{path.inspect}#{other_args})")
  super
end

#remove_constant_without_handling_of_connections(const_name) ⇒ Object



111
112
113
114
# File 'lib/rails_development_boost/dependencies_patch/instrumentation_patch.rb', line 111

def remove_constant_without_handling_of_connections(const_name)
  boost_log('REMOVE_CONST', const_name)
  super
end